From f5c8e1153ba523eaa871f0fe0ed8a41299185574 Mon Sep 17 00:00:00 2001 From: Koop Mast Date: Thu, 15 Sep 2016 17:30:23 +0000 Subject: [PATCH] Fix a runtime issue which causes the program to SIGABRT when it happens. PR: 212461 Submitted by: cpm@ Obtained from: gstreamer upstream MFH: 2016Q3 --- multimedia/gstreamer1-plugins-bad/Makefile | 2 +- .../files/patch-3aee203 | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 multimedia/gstreamer1-plugins-bad/files/patch-3aee203 diff --git a/multimedia/gstreamer1-plugins-bad/Makefile b/multimedia/gstreamer1-plugins-bad/Makefile index 00ba03e99ae6..b73a0e8b3c57 100644 --- a/multimedia/gstreamer1-plugins-bad/Makefile +++ b/multimedia/gstreamer1-plugins-bad/Makefile @@ -1,7 +1,7 @@ # Created by: Michael Johnson # $FreeBSD$ -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= multimedia COMMENT= GStreamer-plugins that need more quality, testing or documentation diff --git a/multimedia/gstreamer1-plugins-bad/files/patch-3aee203 b/multimedia/gstreamer1-plugins-bad/files/patch-3aee203 new file mode 100644 index 000000000000..5b6024ea363f --- /dev/null +++ b/multimedia/gstreamer1-plugins-bad/files/patch-3aee203 @@ -0,0 +1,55 @@ +From 3aee2039591421f4cc8757353034daf0e011a9ce Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= +Date: Thu, 31 Mar 2016 12:20:30 +0300 +Subject: adaptivedemux: Handle find_stream_for_pad() without + g_assert_not_reached() if no pad is found + +Happens e.g. if a RECONFIGURE event is sent from downstream while we're +switching pads at this very moment. The old pad is gone and the stream has a +new pad. + +https://bugzilla.gnome.org/show_bug.cgi?id=764404 + +diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +index dfe7ba7..ba29214 100644 +--- gst-libs/gst/adaptivedemux/gstadaptivedemux.c ++++ gst-libs/gst/adaptivedemux/gstadaptivedemux.c +@@ -1092,7 +1092,6 @@ gst_adaptive_demux_find_stream_for_pad (GstAdaptiveDemux * demux, GstPad * pad) + return stream; + } + } +- g_assert_not_reached (); + return NULL; + } + +@@ -1241,6 +1240,7 @@ gst_adaptive_demux_src_event (GstPad * pad, GstObject * parent, + gboolean update; + gboolean ret = TRUE; + GstSegment oldsegment; ++ GstAdaptiveDemuxStream *stream = NULL; + + GST_INFO_OBJECT (demux, "Received seek event"); + +@@ -1318,9 +1318,8 @@ gst_adaptive_demux_src_event (GstPad * pad, GstObject * parent, + * use the one that received the event as the 'leading' + * one to do the snap seek. + */ +- if (IS_SNAP_SEEK (flags) && demux_class->stream_seek) { +- GstAdaptiveDemuxStream *stream = +- gst_adaptive_demux_find_stream_for_pad (demux, pad); ++ if (IS_SNAP_SEEK (flags) && demux_class->stream_seek && (stream = ++ gst_adaptive_demux_find_stream_for_pad (demux, pad))) { + GstClockTime ts; + GstSeekFlags stream_seek_flags = flags; + +@@ -1359,6 +1358,7 @@ gst_adaptive_demux_src_event (GstPad * pad, GstObject * parent, + GST_DEBUG_OBJECT (demux, "Adapted snap seek to %" GST_PTR_FORMAT, + event); + } ++ stream = NULL; + + gst_segment_do_seek (&demux->segment, rate, format, flags, start_type, + start, stop_type, stop, &update); +-- +cgit v0.10.2 +