mirror of https://github.com/mpv-player/mpv
demux_audio: fix calculation of audio length
Take start offset into account when calculating amount of audio data. Patch by Benoît Thébaudeau [benoit thebaudeau advansee com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34915 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
This commit is contained in:
parent
ad8ef269cf
commit
d0525a0f59
|
@ -790,7 +790,8 @@ static void demux_close_audio(demuxer_t* demuxer) {
|
|||
|
||||
static int demux_audio_control(demuxer_t *demuxer,int cmd, void *arg){
|
||||
sh_audio_t *sh_audio=demuxer->audio->sh;
|
||||
int audio_length = sh_audio->i_bps ? demuxer->movi_end / sh_audio->i_bps : 0;
|
||||
int audio_length = sh_audio->i_bps && demuxer->movi_end > demuxer->movi_start ?
|
||||
(demuxer->movi_end - demuxer->movi_start) / sh_audio->i_bps : 0;
|
||||
da_priv_t* priv = demuxer->priv;
|
||||
|
||||
switch(cmd) {
|
||||
|
|
Loading…
Reference in New Issue