From 666cb2dac257f29fd375efa6bb81a6f4443f8f8c Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 12 Jul 2013 23:11:04 +0200 Subject: mplayer: remove generic duration calculation This was useless for anything but the raw demuxers. In most cases, this would most likely lead to display of bogus duration values, because the bitrates used are per-track, not the total file bitrate. There was actually no case left where this code was helpful. Note that demux_lavf has its own code for this using the total file bitrate. Also, mplayer.c can calculate the playback percentage from current file position / current file size. This is not removed. --- core/mplayer.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'core/mplayer.c') diff --git a/core/mplayer.c b/core/mplayer.c index f861811b90..5c894012c8 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -3029,17 +3029,7 @@ double get_time_length(struct MPContext *mpctx) if (len >= 0) return len; - struct sh_video *sh_video = mpctx->sh_video; - struct sh_audio *sh_audio = mpctx->sh_audio; - if (sh_video && sh_video->i_bps && sh_audio && sh_audio->i_bps) - return (double) (demuxer->movi_end - demuxer->movi_start) / - (sh_video->i_bps + sh_audio->i_bps); - if (sh_video && sh_video->i_bps) - return (double) (demuxer->movi_end - demuxer->movi_start) / - sh_video->i_bps; - if (sh_audio && sh_audio->i_bps) - return (double) (demuxer->movi_end - demuxer->movi_start) / - sh_audio->i_bps; + // Unknown return 0; } -- cgit v1.2.3