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:
mplayer-svn 2012-05-18 17:03:09 +00:00 committed by wm4
parent ad8ef269cf
commit d0525a0f59
1 changed files with 2 additions and 1 deletions

View File

@ -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) {