mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
hlsdemux2: Don't leak the datetime in time map structs
Add a function to clean up GstHLSTimeMap structs and free the ref on the optional associated GDateTime Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2873>
This commit is contained in:
parent
a242428532
commit
9db19a3b06
1 changed files with 10 additions and 2 deletions
|
@ -1931,6 +1931,14 @@ gst_hls_time_map_new (void)
|
|||
return map;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_hls_time_map_free (GstHLSTimeMap * map)
|
||||
{
|
||||
if (map->pdt)
|
||||
g_date_time_unref (map->pdt);
|
||||
g_free (map);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_hls_demux_add_time_mapping (GstHLSDemux * demux, gint64 dsn,
|
||||
GstClockTimeDiff stream_time, GDateTime * pdt)
|
||||
|
@ -2018,7 +2026,7 @@ gst_hls_prune_time_mappings (GstHLSDemux * hlsdemux)
|
|||
}
|
||||
}
|
||||
|
||||
g_list_free_full (hlsdemux->mappings, g_free);
|
||||
g_list_free_full (hlsdemux->mappings, (GDestroyNotify) gst_hls_time_map_free);
|
||||
hlsdemux->mappings = active;
|
||||
}
|
||||
|
||||
|
@ -2556,7 +2564,7 @@ gst_hls_demux_reset (GstAdaptiveDemux * ademux)
|
|||
demux->pending_variant = NULL;
|
||||
}
|
||||
|
||||
g_list_free_full (demux->mappings, g_free);
|
||||
g_list_free_full (demux->mappings, (GDestroyNotify) gst_hls_time_map_free);
|
||||
demux->mappings = NULL;
|
||||
|
||||
gst_hls_demux_clear_all_pending_data (demux);
|
||||
|
|
Loading…
Reference in a new issue