[FFmpeg-cvslog] avcodec/vc1: fix time_base and framerate
Michael Niedermayer
git at videolan.org
Wed Oct 15 16:20:52 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Oct 15 15:54:02 2014 +0200| [220a15c074876b04760e60aeae5badc7412b2f83] | committer: Michael Niedermayer
avcodec/vc1: fix time_base and framerate
They are not just inverses of each other.
This should restore behavior to before the introduction of framerate
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=220a15c074876b04760e60aeae5badc7412b2f83
---
libavcodec/vc1.c | 1 -
libavcodec/vc1_parser.c | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index b03eb94..b3955f2 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -490,7 +490,6 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
}
}
if (v->broadcast) { // Pulldown may be present
- v->s.avctx->framerate.num *= 2;
v->s.avctx->ticks_per_frame = 2;
}
}
diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c
index 33e672f..3a2308e 100644
--- a/libavcodec/vc1_parser.c
+++ b/libavcodec/vc1_parser.c
@@ -112,6 +112,8 @@ static void vc1_extract_header(AVCodecParserContext *s, AVCodecContext *avctx,
break;
}
+ if (avctx->framerate.num)
+ avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
}
static int vc1_parse(AVCodecParserContext *s,
More information about the ffmpeg-cvslog
mailing list