dashdemux: mpdparser: properly unref gstdatetime

Avoid leaking the GstDateTime instances when summing dates

CID #1212143
This commit is contained in:
Thiago Santos 2014-05-13 11:22:58 -03:00
parent 288e8d5c0e
commit 16d969b945

View file

@ -3477,11 +3477,16 @@ gst_mpd_client_get_segment_index_at_time (GstMpdClient * client,
return -1;
if (stream_period && stream_period->period) {
/* intentionally not unreffing avail_start */
avail_start = gst_mpd_client_add_time_difference (avail_start,
GstDateTime *t;
t = gst_mpd_client_add_time_difference (avail_start,
stream_period->period->start * 1000);
gst_date_time_unref (avail_start);
avail_start = t;
}
diff = gst_mpd_client_calculate_time_difference (avail_start, time);
gst_date_time_unref (avail_start);
if (diff < 0)
return -2;
if (diff > gst_mpd_client_get_media_presentation_duration (client))