1 From bb9478be40b450629f165d5d3566f4e4a3ee1b66 Mon Sep 17 00:00:00 2001
2 From: Athanasios Oikonomou <athoik@gmail.com>
3 Date: Tue, 28 Oct 2014 08:48:20 +0200
4 Subject: [PATCH] rtmp: fix seeking and potential segfault
6 Segfault info: https://bugzilla.gnome.org/show_bug.cgi?id=739263
7 Seeking info: http://forums.openpli.org/topic/32910-mediaplayer-seek-doesnt-work-with-rtmp-streams/
9 diff --git a/ext/rtmp/gstrtmpsrc.c b/ext/rtmp/gstrtmpsrc.c
10 index b9ecfcf..8b4bf22 100644
11 --- a/ext/rtmp/gstrtmpsrc.c
12 +++ b/ext/rtmp/gstrtmpsrc.c
13 @@ -86,7 +86,6 @@ static void gst_rtmp_src_get_property (GObject * object, guint prop_id,
14 GValue * value, GParamSpec * pspec);
15 static void gst_rtmp_src_finalize (GObject * object);
17 -static gboolean gst_rtmp_src_unlock (GstBaseSrc * src);
18 static gboolean gst_rtmp_src_stop (GstBaseSrc * src);
19 static gboolean gst_rtmp_src_start (GstBaseSrc * src);
20 static gboolean gst_rtmp_src_is_seekable (GstBaseSrc * src);
21 @@ -137,7 +136,6 @@ gst_rtmp_src_class_init (GstRTMPSrcClass * klass)
23 gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_rtmp_src_start);
24 gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_rtmp_src_stop);
25 - gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_rtmp_src_unlock);
26 gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_rtmp_src_is_seekable);
27 gstbasesrc_class->prepare_seek_segment =
28 GST_DEBUG_FUNCPTR (gst_rtmp_src_prepare_seek_segment);
29 @@ -603,23 +601,6 @@ gst_rtmp_src_start (GstBaseSrc * basesrc)
33 -gst_rtmp_src_unlock (GstBaseSrc * basesrc)
35 - GstRTMPSrc *rtmpsrc = GST_RTMP_SRC (basesrc);
37 - GST_DEBUG_OBJECT (rtmpsrc, "unlock");
39 - /* This closes the socket, which means that any pending socket calls
41 - if (rtmpsrc->rtmp) {
42 - RTMP_Close (rtmpsrc->rtmp);
50 gst_rtmp_src_stop (GstBaseSrc * basesrc)
53 @@ -627,6 +608,7 @@ gst_rtmp_src_stop (GstBaseSrc * basesrc)
54 src = GST_RTMP_SRC (basesrc);
57 + RTMP_Close (src->rtmp);
58 RTMP_Free (src->rtmp);