[MPlayer-cvslog] r23829 - trunk/libao2/ao_oss.c

reimar subversion at mplayerhq.hu
Thu Jul 19 21:15:59 CEST 2007


Author: reimar
Date: Thu Jul 19 21:15:59 2007
New Revision: 23829

Log:
Somewhat hackish fix for A-V desync with ao_oss and frame stepping:
send 0-samples according to the amount of data lost during pause.


Modified:
   trunk/libao2/ao_oss.c

Modified: trunk/libao2/ao_oss.c
==============================================================================
--- trunk/libao2/ao_oss.c	(original)
+++ trunk/libao2/ao_oss.c	Thu Jul 19 21:15:59 2007
@@ -147,6 +147,7 @@ static int oss2format(int format)
 static char *dsp=PATH_DEV_DSP;
 static audio_buf_info zz;
 static int audio_fd=-1;
+static int prepause_space;
 
 static const char *oss_mixer_device = PATH_DEV_MIXER;
 static int oss_mixer_channel = SOUND_MIXER_PCM;
@@ -448,13 +449,21 @@ static void reset(void){
 // stop playing, keep buffers (for pause)
 static void audio_pause(void)
 {
+    prepause_space = get_space();
     uninit(1);
 }
 
 // resume playing, after audio_pause()
 static void audio_resume(void)
 {
+    int fillcnt;
     reset();
+    fillcnt = get_space() - prepause_space;
+    if (fillcnt > 0) {
+      void *silence = calloc(fillcnt, 1);
+      play(silence, fillcnt, 0);
+      free(silence);
+    }
 }
 
 



More information about the MPlayer-cvslog mailing list