mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 22:05:58 +00:00
dash: fix parsing of streams to get correct fragment durations
Use the current stream base time instead of the 0th stream base time to get default duration for fragments.
This commit is contained in:
parent
54542a6000
commit
9777fc5cb5
1 changed files with 6 additions and 7 deletions
|
@ -126,7 +126,8 @@ static gboolean gst_mpd_client_add_media_segment (GstActiveStream * stream,
|
||||||
GstSegmentURLNode * url_node, guint number, guint start,
|
GstSegmentURLNode * url_node, guint number, guint start,
|
||||||
GstClockTime start_time, GstClockTime duration);
|
GstClockTime start_time, GstClockTime duration);
|
||||||
static const gchar *gst_mpdparser_mimetype_to_caps (const gchar * mimeType);
|
static const gchar *gst_mpdparser_mimetype_to_caps (const gchar * mimeType);
|
||||||
static GstClockTime gst_mpd_client_get_segment_duration (GstMpdClient * client);
|
static GstClockTime gst_mpd_client_get_segment_duration (GstMpdClient * client,
|
||||||
|
GstActiveStream * stream);
|
||||||
|
|
||||||
/* Adaptation Set */
|
/* Adaptation Set */
|
||||||
static GstAdaptationSetNode
|
static GstAdaptationSetNode
|
||||||
|
@ -2503,16 +2504,14 @@ gst_mpdparser_parse_baseURL (GstMpdClient * client, GstActiveStream * stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstClockTime
|
static GstClockTime
|
||||||
gst_mpd_client_get_segment_duration (GstMpdClient * client)
|
gst_mpd_client_get_segment_duration (GstMpdClient * client,
|
||||||
|
GstActiveStream * stream)
|
||||||
{
|
{
|
||||||
GstActiveStream *stream;
|
|
||||||
GstStreamPeriod *stream_period;
|
GstStreamPeriod *stream_period;
|
||||||
GstMultSegmentBaseType *base = NULL;
|
GstMultSegmentBaseType *base = NULL;
|
||||||
GstClockTime duration;
|
GstClockTime duration;
|
||||||
guint timescale;
|
guint timescale;
|
||||||
|
|
||||||
stream =
|
|
||||||
gst_mpdparser_get_active_stream_by_index (client, client->stream_idx);
|
|
||||||
g_return_val_if_fail (stream != NULL, GST_CLOCK_TIME_NONE);
|
g_return_val_if_fail (stream != NULL, GST_CLOCK_TIME_NONE);
|
||||||
stream_period = gst_mpdparser_get_stream_period (client);
|
stream_period = gst_mpdparser_get_stream_period (client);
|
||||||
g_return_val_if_fail (stream_period != NULL, GST_CLOCK_TIME_NONE);
|
g_return_val_if_fail (stream_period != NULL, GST_CLOCK_TIME_NONE);
|
||||||
|
@ -2798,7 +2797,7 @@ gst_mpd_client_setup_representation (GstMpdClient * client,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
duration = gst_mpd_client_get_segment_duration (client);
|
duration = gst_mpd_client_get_segment_duration (client, stream);
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (duration))
|
if (!GST_CLOCK_TIME_IS_VALID (duration))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -2870,7 +2869,7 @@ gst_mpd_client_setup_representation (GstMpdClient * client,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
duration = gst_mpd_client_get_segment_duration (client);
|
duration = gst_mpd_client_get_segment_duration (client, stream);
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (duration)
|
if (!GST_CLOCK_TIME_IS_VALID (duration)
|
||||||
|| !GST_CLOCK_TIME_IS_VALID (PeriodEnd)
|
|| !GST_CLOCK_TIME_IS_VALID (PeriodEnd)
|
||||||
|| duration <= 0)
|
|| duration <= 0)
|
||||||
|
|
Loading…
Reference in a new issue