diff options
author | wm4 <wm4@nowhere> | 2013-07-12 23:11:04 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-12 23:11:04 +0200 |
commit | 666cb2dac257f29fd375efa6bb81a6f4443f8f8c (patch) | |
tree | 30da69ba5de0f967d0fe15fd1bd0f143f873dcc2 | |
parent | 32b828e442a933ad0c06d0b8d167db0f7d1b1e75 (diff) | |
download | mpv-666cb2dac257f29fd375efa6bb81a6f4443f8f8c.tar.bz2 mpv-666cb2dac257f29fd375efa6bb81a6f4443f8f8c.tar.xz |
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.
-rw-r--r-- | core/mplayer.c | 12 |
1 files changed, 1 insertions, 11 deletions
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; } |