mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-21 18:04:00 +00:00
dashdemux: do not send bogus duration messages when mediaPresentationDuration is unknown
This commit is contained in:
parent
fba69179e4
commit
fe05060044
2 changed files with 10 additions and 6 deletions
|
@ -673,12 +673,15 @@ gst_dash_demux_sink_event (GstPad * pad, GstEvent * event)
|
||||||
if (!gst_mpd_client_is_live (demux->client)) {
|
if (!gst_mpd_client_is_live (demux->client)) {
|
||||||
GstClockTime duration = gst_mpd_client_get_duration (demux->client);
|
GstClockTime duration = gst_mpd_client_get_duration (demux->client);
|
||||||
|
|
||||||
|
if (duration != GST_CLOCK_TIME_NONE) {
|
||||||
GST_DEBUG_OBJECT (demux, "Sending duration message : %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (demux, "Sending duration message : %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (duration));
|
GST_TIME_ARGS (duration));
|
||||||
if (duration != GST_CLOCK_TIME_NONE)
|
|
||||||
gst_element_post_message (GST_ELEMENT (demux),
|
gst_element_post_message (GST_ELEMENT (demux),
|
||||||
gst_message_new_duration (GST_OBJECT (demux),
|
gst_message_new_duration (GST_OBJECT (demux),
|
||||||
GST_FORMAT_TIME, duration));
|
GST_FORMAT_TIME, duration));
|
||||||
|
} else {
|
||||||
|
GST_DEBUG_OBJECT (demux, "mediaPresentationDuration unknown, can not send the duration message");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gst_dash_demux_resume_download_task (demux);
|
gst_dash_demux_resume_download_task (demux);
|
||||||
gst_dash_demux_resume_stream_task (demux);
|
gst_dash_demux_resume_stream_task (demux);
|
||||||
|
|
|
@ -2934,9 +2934,10 @@ gst_mpd_client_get_duration (GstMpdClient * client)
|
||||||
g_return_val_if_fail (client != NULL, GST_CLOCK_TIME_NONE);
|
g_return_val_if_fail (client != NULL, GST_CLOCK_TIME_NONE);
|
||||||
|
|
||||||
GST_MPD_CLIENT_LOCK (client);
|
GST_MPD_CLIENT_LOCK (client);
|
||||||
|
if (client->mpd_node->mediaPresentationDuration != -1) {
|
||||||
duration = client->mpd_node->mediaPresentationDuration * GST_MSECOND;
|
duration = client->mpd_node->mediaPresentationDuration * GST_MSECOND;
|
||||||
|
} else {
|
||||||
/* We can only get the duration for on-demand streams */
|
/* We can only get the duration for on-demand streams */
|
||||||
if (!duration) {
|
|
||||||
duration = GST_CLOCK_TIME_NONE;
|
duration = GST_CLOCK_TIME_NONE;
|
||||||
}
|
}
|
||||||
GST_MPD_CLIENT_UNLOCK (client);
|
GST_MPD_CLIENT_UNLOCK (client);
|
||||||
|
|
Loading…
Reference in a new issue