aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-02-28 20:58:07 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-02-28 20:58:07 +0000
commitefd8c1f64d3b1673021162210e0b265bcd5ea4c8 (patch)
treef0fcc97b2e01ac3884dc1bf0cda3db934c5c3f55 /libavcodec
parentcd0d9a9de68f6407498f9eb9b452cbe74c403c9f (diff)
downloadffmpeg-efd8c1f64d3b1673021162210e0b265bcd5ea4c8.tar.gz
Adjust time_base exactly when changing ticks_per_frame to 2 this is safer
and for some raw h264 we managed to change the timebase twice before. Originally committed as revision 17669 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 3322877df1..b1c1f7054d 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2210,8 +2210,12 @@ static av_cold int decode_init(AVCodecContext *avctx){
h->outputed_poc = INT_MIN;
h->prev_poc_msb= 1<<16;
reset_sei(h);
- if(avctx->codec_id == CODEC_ID_H264)
+ if(avctx->codec_id == CODEC_ID_H264){
+ if(avctx->ticks_per_frame == 1){
+ s->avctx->time_base.den *=2;
+ }
avctx->ticks_per_frame = 2;
+ }
return 0;
}
@@ -3776,9 +3780,6 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
s->avctx->time_base.den *= 2;
av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den,
s->avctx->time_base.num, s->avctx->time_base.den, 1<<30);
- }else if(!h->sps.time_scale && !s->avctx->frame_number){
- s->avctx->time_base.den *=2;
- h->sps.time_scale= s->avctx->time_base.den;
}
}