[vlc-commits] avcodec: set dummy time base value in probing
Ilkka Ollakka
git at videolan.org
Sat Nov 30 17:16:53 CET 2013
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Nov 30 16:55:00 2013 +0200| [66dbbce44476862016cf4193e5d530bf0baa6637] | committer: Ilkka Ollakka
avcodec: set dummy time base value in probing
Set time base on fps=25 as some codecs need it to be set (atleast DIV3).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=66dbbce44476862016cf4193e5d530bf0baa6637
---
modules/codec/avcodec/encoder.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 910fb13..bae4d3f 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -441,8 +441,10 @@ int OpenEncoder( vlc_object_t *p_this )
p_context->width = p_enc->fmt_in.video.i_visible_width;
p_context->height = p_enc->fmt_in.video.i_visible_height;
- p_context->time_base.num = p_enc->fmt_in.video.i_frame_rate_base;
- p_context->time_base.den = p_enc->fmt_in.video.i_frame_rate;
+ /* if we don't have i_frame_rate_base, we are probing and just checking if we can find codec
+ * so set fps to 25 as some codecs (DIV3 atleast) needs time_base data */
+ p_context->time_base.num = p_enc->fmt_in.video.i_frame_rate_base ? p_enc->fmt_in.video.i_frame_rate_base : 1;
+ p_context->time_base.den = p_enc->fmt_in.video.i_frame_rate_base ? p_enc->fmt_in.video.i_frame_rate : 25 ;
if( p_codec->supported_framerates )
{
AVRational target = {
@@ -454,6 +456,7 @@ int OpenEncoder( vlc_object_t *p_this )
p_context->time_base.num = p_codec->supported_framerates[idx].den;
p_context->time_base.den = p_codec->supported_framerates[idx].num;
}
+ msg_Dbg( p_enc, "Time base set to %d/%d", p_context->time_base.num, p_context->time_base.den );
/* Defaults from ffmpeg.c */
p_context->qblur = 0.5;
More information about the vlc-commits
mailing list