mpdparser: fix period start time scaling

This GstStreamPeriod start value is expressed in nanoseconds,
and the glib time addition function expects microseconds.
There seems to have been a confusion with GstPeriodNode's start
field, which is expressed in milliseconds.

Additionally, add a warning if the timestamp modification did
not succeed, and NULL was returned.
This commit is contained in:
Vincent Penquerc'h 2015-09-07 12:09:41 +01:00
parent 779ad060a4
commit 6d1eda9391

View file

@ -4563,9 +4563,14 @@ gst_mpd_client_get_next_segment_availability_end_time (GstMpdClient * client,
if (stream_period && stream_period->period) {
GstDateTime *t =
gst_mpd_client_add_time_difference (availability_start_time,
stream_period->start * 1000);
stream_period->start / 1000);
gst_date_time_unref (availability_start_time);
availability_start_time = t;
if (availability_start_time == NULL) {
GST_WARNING_OBJECT (client, "Failed to offset availability_start_time");
return NULL;
}
}
offset = (1 + seg_idx) * seg_duration;