[vlc-devel] [PATCH] transcoding: avoid a divide by 0 when source video framerate is mistakenly set to 0 by a demuxer
Emeric Grange
egrange at gopro.com
Tue Oct 6 14:57:03 CEST 2015
---
modules/stream_out/transcode/video.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 2c2d4f3..8f85036 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -465,7 +465,7 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
i_dst_visible_width, i_dst_visible_height
);
- /* Handle frame rate conversion */
+ /* Handle frame rate conversion (encoder) */
if( !id->p_encoder->fmt_out.video.i_frame_rate ||
!id->p_encoder->fmt_out.video.i_frame_rate_base )
{
@@ -485,6 +485,14 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
}
}
+ /* Handle frame rate (decoder) */
+ if (!id->p_decoder->fmt_out.video.i_frame_rate ||
+ !id->p_decoder->fmt_out.video.i_frame_rate_base)
+ {
+ id->p_decoder->fmt_out.video.i_frame_rate = ENC_FRAMERATE;
+ id->p_decoder->fmt_out.video.i_frame_rate_base = ENC_FRAMERATE_BASE;
+ }
+
id->p_encoder->fmt_in.video.orientation =
id->p_encoder->fmt_out.video.orientation =
id->p_decoder->fmt_in.video.orientation;
--
2.3.8 (Apple Git-58)
More information about the vlc-devel
mailing list