aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h261.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-08-14 18:17:14 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-08-14 18:17:14 +0000
commit94c8fbdcad29548f7ba38c4ced39dbe19ef07499 (patch)
tree231ea951d11666a77e90c13f97812f1a4bcc2751 /libavcodec/h261.c
parent0f812f5291850bc7471bfa5ecbb01313b01899a9 (diff)
downloadffmpeg-94c8fbdcad29548f7ba38c4ced39dbe19ef07499.tar.gz
fix codec timebase and timestamps
Originally committed as revision 5998 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h261.c')
-rw-r--r--libavcodec/h261.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libavcodec/h261.c b/libavcodec/h261.c
index 0f0abef1e9..39fc66d3a9 100644
--- a/libavcodec/h261.c
+++ b/libavcodec/h261.c
@@ -781,7 +781,14 @@ static int h261_decode_picture_header(H261Context *h){
}
/* temporal reference */
- s->picture_number = get_bits(&s->gb, 5); /* picture timestamp */
+ i= get_bits(&s->gb, 5); /* picture timestamp */
+ if(i < (s->picture_number&31))
+ i += 32;
+ s->picture_number = (s->picture_number&~31) + i;
+
+ s->avctx->time_base= (AVRational){1001, 30000};
+ s->current_picture.pts= s->picture_number;
+
/* PTYPE starts here */
skip_bits1(&s->gb); /* split screen off */
@@ -998,10 +1005,6 @@ assert(s->current_picture.pict_type == s->pict_type);
*pict= *(AVFrame*)s->current_picture_ptr;
ff_print_debug_info(s, pict);
- /* Return the Picture timestamp as the frame number */
- /* we substract 1 because it is added on utils.c */
- avctx->frame_number = s->picture_number - 1;
-
*data_size = sizeof(AVFrame);
return get_consumed_bytes(s, buf_size);