[MPlayer-cvslog] r34915 - trunk/libmpdemux/demux_audio.c

reimar subversion at mplayerhq.hu
Fri May 18 19:03:09 CEST 2012


Author: reimar
Date: Fri May 18 19:03:09 2012
New Revision: 34915

Log:
Take start offset into account when calculating amount of audio data.

Patch by Benoît Thébaudeau [benoit thebaudeau advansee com]

Modified:
   trunk/libmpdemux/demux_audio.c

Modified: trunk/libmpdemux/demux_audio.c
==============================================================================
--- trunk/libmpdemux/demux_audio.c	Fri May 18 19:01:13 2012	(r34914)
+++ trunk/libmpdemux/demux_audio.c	Fri May 18 19:03:09 2012	(r34915)
@@ -792,7 +792,8 @@ static void demux_close_audio(demuxer_t*
 
 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) {


More information about the MPlayer-cvslog mailing list