diff options
author | Thiago Santos <ts.santos@sisa.samsung.com> | 2014-05-13 11:22:58 -0300 |
---|---|---|
committer | Thiago Santos <ts.santos@sisa.samsung.com> | 2014-05-13 11:22:58 -0300 |
commit | 16d969b945d897c931e7727641ef4cd0df7027a5 (patch) | |
tree | 611a7898f7bae5969941d2fcc387cf9a547385c9 | |
parent | 288e8d5c0ed21e11f5aa8e0dcb50f1f1ac584108 (diff) | |
download | gstreamer-plugins-bad-16d969b945d897c931e7727641ef4cd0df7027a5.tar.gz |
dashdemux: mpdparser: properly unref gstdatetime
Avoid leaking the GstDateTime instances when summing dates
CID #1212143
-rw-r--r-- | ext/dash/gstmpdparser.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index a6f12f108..b1e30fd77 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -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)) |