diff h263.c @ 654:850098147a3c libavcodec

export pts from stream if available store pts in stream if available (otherwise use frame_rate)
author michaelni
date Thu, 12 Sep 2002 10:54:53 +0000
parents dddcff6841f2
children e47fa3e3f2d5
line wrap: on
line diff
--- a/h263.c	Thu Sep 12 02:34:56 2002 +0000
+++ b/h263.c	Thu Sep 12 10:54:53 2002 +0000
@@ -1314,8 +1314,11 @@
 
         s->time_increment_bits = av_log2(s->time_increment_resolution - 1) + 1;
     }
-
-    s->time= picture_number*(INT64)FRAME_RATE_BASE*s->time_increment_resolution/s->frame_rate;
+    
+    if(s->avctx->pts)
+        s->time= (s->avctx->pts*s->time_increment_resolution + 500*1000)/(1000*1000);
+    else
+        s->time= picture_number*(INT64)FRAME_RATE_BASE*s->time_increment_resolution/s->frame_rate;
     time_div= s->time/s->time_increment_resolution;
     time_mod= s->time%s->time_increment_resolution;
 
@@ -3993,7 +3996,9 @@
             return FRAME_SKIPED;
         }
     }
-
+    
+    s->avctx->pts= s->time*1000LL*1000LL / s->time_increment_resolution;
+    
     if(check_marker(&s->gb, "before vop_coded")==0 && s->picture_number==0){
         printf("hmm, seems the headers arnt complete, trying to guess time_increment_bits\n");
         for(s->time_increment_bits++ ;s->time_increment_bits<16; s->time_increment_bits++){