From: <wt...@ke...> - 2007-10-22 16:45:00
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: wtay Date: Mon Oct 22 2007 16:45:03 UTC Log message: Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com> * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_loop_interleaved): Fix race when pausing a RTSP stream in interleaved. Fixes #475784. Modified files: . : ChangeLog gst/rtsp : gstrtspsrc.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3146&r2=1.3147 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/rtsp/gstrtspsrc.c.diff?r1=1.116&r2=1.117 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.3146 retrieving revision 1.3147 diff -u -d -r1.3146 -r1.3147 --- ChangeLog 22 Oct 2007 09:53:15 -0000 1.3146 +++ ChangeLog 22 Oct 2007 16:44:47 -0000 1.3147 @@ -1,5 +1,13 @@ 2007-10-22 Wim Taymans <wim...@gm...> + Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com> + + * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_loop_interleaved): + Fix race when pausing a RTSP stream in interleaved. + Fixes #475784. +2007-10-22 Wim Taymans <wim...@gm...> Patch by: Peter Kjellerstedt <pkj at axis com> * gst/rtp/gstrtpmp4vpay.c: (gst_rtp_mp4v_pay_finalize): Index: gstrtspsrc.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/rtsp/gstrtspsrc.c,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- gstrtspsrc.c 17 Oct 2007 15:08:02 -0000 1.116 +++ gstrtspsrc.c 22 Oct 2007 16:44:48 -0000 1.117 @@ -2459,9 +2459,21 @@ GST_DEBUG_OBJECT (src, "doing receive"); + /* We need to check if playback has been paused while we have been + * doing something else in our own GstTask (e.g. pushing buffer). There + * is a slight chance that we have just received data buffer when PAUSE + * state change happens (in another thread). In this case we well be + * totally ignorant of that unless we explicitly check it here. */ + GST_RTSP_STATE_LOCK (src); + if (src->state == GST_RTSP_STATE_READY) { + /* We are looping in a paused mode */ + GST_RTSP_STATE_UNLOCK (src); + goto already_paused; + } /* protect the connection with the connection lock so that we can see when * we are finished doing server communication */ res = gst_rtspsrc_connection_receive (src, &message, src->ptcp_timeout); + GST_RTSP_STATE_UNLOCK (src); switch (res) { case GST_RTSP_OK: @@ -2634,6 +2646,11 @@ gst_rtsp_connection_flush (src->connection, FALSE); return GST_FLOW_WRONG_STATE; } +already_paused: + { + GST_DEBUG_OBJECT (src, "got interrupted: playback already paused"); + return GST_FLOW_WRONG_STATE; + } receive_error: { gchar *str = gst_rtsp_strresult (res); |