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.
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;