diff nut.c @ 2338:4a06a51ceb70 libavformat

move lsb2full to common file
author michael
date Thu, 09 Aug 2007 18:37:28 +0000
parents 59fa1bf41c5d
children a9dc7596498a
line wrap: on
line diff
--- a/nut.c	Thu Aug 09 17:18:59 2007 +0000
+++ b/nut.c	Thu Aug 09 18:37:28 2007 +0000
@@ -35,3 +35,10 @@
             AV_ROUND_DOWN);
     }
 }
+
+int64_t ff_lsb2full(StreamContext *stream, int64_t lsb){
+    int64_t mask = (1<<stream->msb_pts_shift)-1;
+    int64_t delta= stream->last_pts - mask/2;
+    return  ((lsb - delta)&mask) + delta;
+}
+