[MPlayer-cvslog] r28689 - trunk/libao2/ao_sun.c

reimar subversion at mplayerhq.hu
Sat Feb 21 14:37:48 CET 2009


Author: reimar
Date: Sat Feb 21 14:37:47 2009
New Revision: 28689

Log:
Move resetting audio_info_t samples, eof and error in ao_sun.c to reset(), avoids
duplication code from init() and fixes hangs after seeking.

Modified:
   trunk/libao2/ao_sun.c

Modified: trunk/libao2/ao_sun.c
==============================================================================
--- trunk/libao2/ao_sun.c	Sat Feb 21 12:44:10 2009	(r28688)
+++ trunk/libao2/ao_sun.c	Sat Feb 21 14:37:47 2009	(r28689)
@@ -584,14 +584,7 @@ static int init(int rate,int channels,in
     ao_data.bps = byte_per_sec = bytes_per_sample * ao_data.samplerate;
     ao_data.outburst = byte_per_sec > 100000 ? 16384 : 8192;
 
-    AUDIO_INITINFO(&info);
-    info.play.samples = 0;
-    info.play.eof = 0;
-    info.play.error = 0;
-    ioctl (audio_fd, AUDIO_SETINFO, &info);
-
-    queued_bursts = 0;
-    queued_samples = 0;
+    reset();
 
     return 1;
 }
@@ -608,7 +601,15 @@ static void uninit(int immed){
 
 // stop playing and empty buffers (for seeking/pause)
 static void reset(void){
+    audio_info_t info;
     flush_audio(audio_fd);
+
+    AUDIO_INITINFO(&info);
+    info.play.samples = 0;
+    info.play.eof = 0;
+    info.play.error = 0;
+    ioctl(audio_fd, AUDIO_SETINFO, &info);
+
     queued_bursts = 0;
     queued_samples = 0;
 }



More information about the MPlayer-cvslog mailing list