summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaihua Hu <jared.hu@nxp.com>2020-12-30 22:52:01 +0800
committerTim-Philipp Müller <tim@centricular.com>2020-12-31 10:58:37 +0000
commita35760806abf4196c6b1b58ff808ba6302c7fd61 (patch)
tree9aa56e00ebff0f0dad980d480550b9567674808e
parent24d1e75be5d963c8c3b817e3458bb4bde31e86aa (diff)
downloadgstreamer-plugins-bad-a35760806abf4196c6b1b58ff808ba6302c7fd61.tar.gz
dashsink: fix critical log when exit dynamic pipeline
availability-start-time and publish-time shared the same GstDateTime object, this object will be unref twice and cause reference count issue. Should use g_value_dup_boxed() to copy this object. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1932>
-rw-r--r--ext/dash/gstdashsink.c1
-rw-r--r--ext/dash/gstmpdrootnode.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/ext/dash/gstdashsink.c b/ext/dash/gstdashsink.c
index 625750fa8..027e06969 100644
--- a/ext/dash/gstdashsink.c
+++ b/ext/dash/gstdashsink.c
@@ -584,6 +584,7 @@ gst_dash_sink_generate_mpd_content (GstDashSink * sink,
gst_mpd_client_set_root_node (sink->mpd_client,
"type", GST_MPD_FILE_TYPE_DYNAMIC,
"availability-start-time", now, "publish-time", now, NULL);
+ gst_date_time_unref (now);
}
if (sink->minimum_update_period)
gst_mpd_client_set_root_node (sink->mpd_client,
diff --git a/ext/dash/gstmpdrootnode.c b/ext/dash/gstmpdrootnode.c
index bb8acda51..2cac539da 100644
--- a/ext/dash/gstmpdrootnode.c
+++ b/ext/dash/gstmpdrootnode.c
@@ -83,17 +83,17 @@ gst_mpd_root_node_set_property (GObject * object, guint prop_id,
case PROP_MPD_ROOT_AVAILABILTY_START_TIME:
if (self->availabilityStartTime)
gst_date_time_unref (self->availabilityStartTime);
- self->availabilityStartTime = g_value_get_boxed (value);
+ self->availabilityStartTime = g_value_dup_boxed (value);
break;
case PROP_MPD_ROOT_AVAILABILTY_END_TIME:
if (self->availabilityEndTime)
gst_date_time_unref (self->availabilityEndTime);
- self->availabilityEndTime = g_value_get_boxed (value);
+ self->availabilityEndTime = g_value_dup_boxed (value);
break;
case PROP_MPD_ROOT_PUBLISH_TIME:
if (self->publishTime)
gst_date_time_unref (self->publishTime);
- self->publishTime = g_value_get_boxed (value);
+ self->publishTime = g_value_dup_boxed (value);
break;
case PROP_MPD_ROOT_MEDIA_PRESENTATION_DURATION:
self->mediaPresentationDuration = g_value_get_uint64 (value);