[vlc-commits] packetizer: hevc: use fmtout rate as date rate
Francois Cartegnie
git at videolan.org
Tue Sep 24 20:57:18 CEST 2019
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Sep 7 18:25:29 2019 +0200| [fe88719c808cda0e91fd4d3da5c67218cb3e73f5] | committer: Francois Cartegnie
packetizer: hevc: use fmtout rate as date rate
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe88719c808cda0e91fd4d3da5c67218cb3e73f5
---
modules/demux/mpeg/h26x.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/modules/demux/mpeg/h26x.c b/modules/demux/mpeg/h26x.c
index 8d6403a7b8..bf0be71395 100644
--- a/modules/demux/mpeg/h26x.c
+++ b/modules/demux/mpeg/h26x.c
@@ -458,22 +458,14 @@ static int Demux( demux_t *p_demux)
es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
if( frame )
{
- if( !p_sys->frame_rate_den )
+ if( p_sys->p_packetizer->fmt_out.video.i_frame_rate_base &&
+ p_sys->p_packetizer->fmt_out.video.i_frame_rate_base != p_sys->frame_rate_den &&
+ p_sys->p_packetizer->fmt_out.video.i_frame_rate &&
+ p_sys->p_packetizer->fmt_out.video.i_frame_rate_base != p_sys->frame_rate_num )
{
- /* Use packetizer's one */
- if( p_sys->p_packetizer->fmt_out.video.i_frame_rate_base &&
- p_sys->p_packetizer->fmt_out.video.i_frame_rate )
- {
- p_sys->frame_rate_num = p_sys->p_packetizer->fmt_out.video.i_frame_rate;
- p_sys->frame_rate_den = p_sys->p_packetizer->fmt_out.video.i_frame_rate_base;
- }
- else
- {
- p_sys->frame_rate_num = 25000;
- p_sys->frame_rate_den = 1000;
- }
- date_Init( &p_sys->dts, 2 * p_sys->frame_rate_num, p_sys->frame_rate_den );
- date_Set( &p_sys->dts, VLC_TICK_0 );
+ p_sys->frame_rate_num = p_sys->p_packetizer->fmt_out.video.i_frame_rate;
+ p_sys->frame_rate_den = p_sys->p_packetizer->fmt_out.video.i_frame_rate_base;
+ date_Change( &p_sys->dts, 2 * p_sys->frame_rate_num, p_sys->frame_rate_den );
msg_Dbg( p_demux, "using %.2f fps", (double) p_sys->frame_rate_num / p_sys->frame_rate_den );
}
More information about the vlc-commits
mailing list