[vlc-commits] Support draining in aout_PacketFlush()

Rémi Denis-Courmont git at videolan.org
Sat Nov 17 17:21:08 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 17 18:20:52 2012 +0200| [2a0c18e438d217ffaee797e9cc7ed67ad42b671e] | committer: Rémi Denis-Courmont

Support draining in aout_PacketFlush()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a0c18e438d217ffaee797e9cc7ed67ad42b671e
---

 modules/audio_output/packet.c |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/modules/audio_output/packet.c b/modules/audio_output/packet.c
index b2b6137..f245a82 100644
--- a/modules/audio_output/packet.c
+++ b/modules/audio_output/packet.c
@@ -190,11 +190,19 @@ void aout_PacketFlush (audio_output_t *aout, bool drain)
     aout_packet_t *p = aout_packet (aout);
 
     vlc_mutex_lock (&p->lock);
-    aout_FifoReset (&p->partial);
-    aout_FifoReset (&p->fifo);
-    vlc_mutex_unlock (&p->lock);
-
-    (void) drain; /* TODO */
+    if (drain)
+    {
+        mtime_t pts = date_Get (&p->fifo.end_date);
+        vlc_mutex_unlock (&p->lock);
+        if (pts != VLC_TS_INVALID)
+            mwait (pts);
+    }
+    else
+    {
+        aout_FifoReset (&p->partial);
+        aout_FifoReset (&p->fifo);
+        vlc_mutex_unlock (&p->lock);
+    }
 }
 
 



More information about the vlc-commits mailing list