[vlc-commits] mpeg: avoid double upconversion
Rémi Denis-Courmont
git at videolan.org
Wed Aug 13 22:23:09 CEST 2014
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Aug 13 23:20:00 2014 +0300| [4d3bc8d9b01c6b001733aac151e8ec49f9d95b91] | committer: Rémi Denis-Courmont
mpeg: avoid double upconversion
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4d3bc8d9b01c6b001733aac151e8ec49f9d95b91
---
modules/demux/mpeg/es.c | 2 +-
modules/demux/mpeg/h264.c | 8 ++++----
modules/demux/mpeg/hevc.c | 7 ++++---
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/modules/demux/mpeg/es.c b/modules/demux/mpeg/es.c
index 5f10f69..dacd452 100644
--- a/modules/demux/mpeg/es.c
+++ b/modules/demux/mpeg/es.c
@@ -362,7 +362,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
(double)(uint64_t)( stream_Size( p_demux->s ) );
/* The first few seconds are guaranteed to be very whacky,
* don't bother trying ... Too bad */
- if( f_pos < 0.01 ||
+ if( f_pos < 0.01f ||
(p_sys->i_pts + p_sys->i_time_offset) < 8000000 )
{
return VLC_EGENERIC;
diff --git a/modules/demux/mpeg/h264.c b/modules/demux/mpeg/h264.c
index 8e785fc..fa43994 100644
--- a/modules/demux/mpeg/h264.c
+++ b/modules/demux/mpeg/h264.c
@@ -104,9 +104,9 @@ static int Open( vlc_object_t * p_this )
p_sys->p_es = NULL;
p_sys->i_dts = 0;
p_sys->f_fps = var_CreateGetFloat( p_demux, "h264-fps" );
- if( p_sys->f_fps < 0.001 )
- p_sys->f_fps = 0.001;
- msg_Dbg( p_demux, "using %.2f fps", p_sys->f_fps );
+ if( p_sys->f_fps < 0.001f )
+ p_sys->f_fps = 0.001f;
+ msg_Dbg( p_demux, "using %.2f fps", (double) p_sys->f_fps );
/* Load the mpegvideo packetizer */
es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_H264 );
@@ -173,7 +173,7 @@ static int Demux( demux_t *p_demux)
p_block_out = p_next;
- p_sys->i_dts += (int64_t)((double)1000000.0 / p_sys->f_fps);
+ p_sys->i_dts += (int64_t)((float)CLOCK_FREQ / p_sys->f_fps);
}
}
return 1;
diff --git a/modules/demux/mpeg/hevc.c b/modules/demux/mpeg/hevc.c
index b564ea5..1701747 100644
--- a/modules/demux/mpeg/hevc.c
+++ b/modules/demux/mpeg/hevc.c
@@ -115,7 +115,7 @@ static int Open( vlc_object_t * p_this )
{
p_sys->f_fps = ( p_sys->f_force_fps < 0.001f )? 0.001f:
p_sys->f_force_fps;
- msg_Dbg( p_demux, "using %.2f fps", p_sys->f_fps );
+ msg_Dbg( p_demux, "using %.2f fps", (double) p_sys->f_fps );
}
else
p_sys->f_fps = 0.0f;
@@ -201,7 +201,7 @@ static int Demux( demux_t *p_demux)
if( nal_type < 0x40 && p_sys->f_fps )
{
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_dts );
- p_sys->i_dts += (int64_t)((double)1000000.0 / p_sys->f_fps);
+ p_sys->i_dts += (int64_t)((float)CLOCK_FREQ / p_sys->f_fps);
}
es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
@@ -278,7 +278,8 @@ static int32_t getFPS( demux_t *p_demux, block_t * p_block )
if( num_units_in_tick )
{
p_sys->f_fps = ( (float) time_scale )/( (float) num_units_in_tick );
- msg_Dbg(p_demux,"Using framerate %f fps from VPS", p_sys->f_fps);
+ msg_Dbg(p_demux,"Using framerate %f fps from VPS",
+ (double) p_sys->f_fps);
}
else
{
More information about the vlc-commits
mailing list