summaryrefslogtreecommitdiff
path: root/libavcodec/h263.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-09-12 10:54:53 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-09-12 10:54:53 +0000
commit15415af4188f50a3225121c3400b5c05bcaaeda0 (patch)
tree0ea4512d345d9bb5f7fa916b7773217d0527a021 /libavcodec/h263.c
parent02ac31361bdc62d5b0307dd52a42901fb7e7544f (diff)
export pts from stream if available
store pts in stream if available (otherwise use frame_rate) Originally committed as revision 923 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r--libavcodec/h263.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index 378ad2a090..05c0f6a567 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -1314,8 +1314,11 @@ void ff_set_mpeg4_time(MpegEncContext * s, int picture_number){
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 @@ int mpeg4_decode_picture_header(MpegEncContext * s)
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++){