summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2013-04-14 19:47:54 -0700
committerDavid Schleef <ds@schleef.org>2013-04-14 19:47:54 -0700
commitca8a4ec35fc4ad787484e6d31d567550f4207b4e (patch)
tree7abcd87113468936ac36187573c96154b540dab6
parentfbb5ded64350b3364c4b917130ae3d8c37a3c689 (diff)
downloadgstreamer-plugins-bad-ca8a4ec35fc4ad787484e6d31d567550f4207b4e.tar.gz
rtmpsrc: Another fix to shut down the connection
-rw-r--r--ext/rtmp/gstrtmpsrc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/rtmp/gstrtmpsrc.c b/ext/rtmp/gstrtmpsrc.c
index 25fec1bb4..17f83db28 100644
--- a/ext/rtmp/gstrtmpsrc.c
+++ b/ext/rtmp/gstrtmpsrc.c
@@ -57,6 +57,8 @@
#include <winsock2.h>
#endif
+#include <sys/socket.h>
+
GST_DEBUG_CATEGORY_STATIC (rtmpsrc_debug);
#define GST_CAT_DEFAULT rtmpsrc_debug
@@ -588,10 +590,11 @@ gst_rtmp_src_unlock (GstBaseSrc * basesrc)
GST_DEBUG_OBJECT (rtmpsrc, "unlock");
- /* This closes the socket, which means that any pending socket calls
- * error out. */
- if (rtmpsrc->rtmp) {
- RTMPSockBuf_Close (&rtmpsrc->rtmp->m_sb);
+ /* This cancels the recv() underlying RTMP_Read, but will cause a
+ * SIGPIPE. Hopefully the app is ignoring it, or you've patched
+ * librtmp. */
+ if (rtmpsrc->rtmp && rtmpsrc->rtmp->m_sb.sb_socket > 0) {
+ shutdown (rtmpsrc->rtmp->m_sb.sb_socket, SHUT_RDWR);
}
return TRUE;