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/1928>
This commit is contained in:
Haihua Hu 2020-12-30 22:52:01 +08:00
parent 1f1a5b4ad1
commit a4a532c092
2 changed files with 4 additions and 3 deletions

View file

@ -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,

View file

@ -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);