[vlc-commits] packetizer: mpegvideo: don't override container fps
Francois Cartegnie
git at videolan.org
Fri Aug 3 16:24:10 CEST 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Aug 3 16:13:28 2018 +0200| [60daa22d6092896444b3fa60b2b921cf027337f7] | committer: Francois Cartegnie
packetizer: mpegvideo: don't override container fps
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=60daa22d6092896444b3fa60b2b921cf027337f7
---
modules/packetizer/mpegvideo.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index c2f50da115..c1661d3c3c 100644
--- a/modules/packetizer/mpegvideo.c
+++ b/modules/packetizer/mpegvideo.c
@@ -725,10 +725,16 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
if( num && den && num <= UINT_MAX/2 &&
( p_sys->i_frame_rate != num || p_sys->i_frame_rate_base != den ) )
{
- date_Change( &p_sys->dts, 2 * num, den ); /* fields / den */
- date_Change( &p_sys->prev_iframe_dts, 2 * num, den );
- p_dec->fmt_out.video.i_frame_rate = num;
- p_dec->fmt_out.video.i_frame_rate_base = den;
+ /* Only of not specified by container */
+ if ( !p_dec->fmt_in.video.i_frame_rate ||
+ !p_dec->fmt_in.video.i_frame_rate_base )
+ {
+ date_Change( &p_sys->dts, 2 * num, den ); /* fields / den */
+ date_Change( &p_sys->prev_iframe_dts, 2 * num, den );
+ p_dec->fmt_out.video.i_frame_rate = num;
+ p_dec->fmt_out.video.i_frame_rate_base = den;
+ }
+ /* store internal values */
p_sys->i_frame_rate = num;
p_sys->i_frame_rate_base = den;
}
More information about the vlc-commits
mailing list