From: Benjamin O. <co...@us...> - 2003-04-11 00:24:34
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: company Date: Thu Apr 10 2003 17:24:32 PDT Log message: make alsa not pause playback but drain the buffer on EOS Modified files: ext/alsa : gstalsa.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/alsa/gstalsa.c.diff?r1=1.42&r2=1.43 ====Begin Diffs==== Index: gstalsa.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/ext/alsa/gstalsa.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- gstalsa.c 27 Mar 2003 03:16:31 -0000 1.42 +++ gstalsa.c 11 Apr 2003 00:24:19 -0000 1.43 @@ -112,6 +112,8 @@ static gboolean gst_alsa_sink_check_event (GstAlsa *this, gint pad_nr, GstEvent *event); /* alsa setup / start / stop functions */ +static void gst_alsa_set_eos (GstAlsa *this); + static gboolean gst_alsa_probe_hw_params (GstAlsa *this, GstAlsaFormat *format); static gboolean gst_alsa_set_hw_params (GstAlsa *this); static gboolean gst_alsa_set_sw_params (GstAlsa *this); @@ -1353,7 +1355,7 @@ if (event) { switch (GST_EVENT_TYPE (event)) { case GST_EVENT_EOS: - gst_element_set_eos (GST_ELEMENT (this)); + gst_alsa_set_eos (this); cont = FALSE; break; case GST_EVENT_INTERRUPT: @@ -1373,6 +1375,12 @@ /*** AUDIO SETUP / START / STOP ***********************************************/ +static void +gst_alsa_set_eos (GstAlsa *this) +{ + gst_alsa_drain_audio (this); + gst_element_set_eos (GST_ELEMENT (this)); +} static gboolean gst_alsa_open_audio (GstAlsa *this) { @@ -1542,7 +1550,8 @@ } static gboolean -gst_alsa_drain_audio (GstAlsa *this) { +gst_alsa_drain_audio (GstAlsa *this) +{ g_assert (this != NULL); g_return_val_if_fail (this != NULL, FALSE); g_return_val_if_fail (this->handle != NULL, FALSE); |