mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
closedcaption: cea708decoder: fix some memory leaks
This commit is contained in:
parent
6dad8b7c78
commit
92e5c5a85a
3 changed files with 28 additions and 0 deletions
|
@ -123,6 +123,7 @@ gst_cea708dec_clear_window_text (Cea708Dec * decoder, guint window_id);
|
|||
static void
|
||||
gst_cea708dec_scroll_window_up (Cea708Dec * decoder, guint window_id);
|
||||
static void gst_cea708dec_init_window (Cea708Dec * decoder, guint window_id);
|
||||
static void gst_cea708dec_clear_window (Cea708Dec * decoder, cea708Window * w);
|
||||
static void
|
||||
gst_cea708dec_set_pen_attributes (Cea708Dec * decoder,
|
||||
guint8 * dtvcc_buffer, int index);
|
||||
|
@ -174,6 +175,20 @@ gst_cea708dec_create (PangoContext * pango_context)
|
|||
return decoder;
|
||||
}
|
||||
|
||||
void
|
||||
gst_cea708dec_free (Cea708Dec * dec)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_708_WINDOWS; i++) {
|
||||
cea708Window *window = dec->cc_windows[i];
|
||||
gst_cea708dec_clear_window (dec, window);
|
||||
g_free (window);
|
||||
}
|
||||
memset (dec, 0, sizeof (Cea708Dec));
|
||||
g_free (dec);
|
||||
}
|
||||
|
||||
void
|
||||
gst_cea708dec_set_service_number (Cea708Dec * decoder, gint8 desired_service)
|
||||
{
|
||||
|
@ -1298,6 +1313,13 @@ gst_cea708dec_scroll_window_up (Cea708Dec * decoder, guint window_id)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_cea708dec_clear_window (Cea708Dec * decoder, cea708Window * window)
|
||||
{
|
||||
g_free (window->text_image);
|
||||
memset (window, 0, sizeof (cea708Window));
|
||||
}
|
||||
|
||||
static void
|
||||
gst_cea708dec_init_window (Cea708Dec * decoder, guint window_id)
|
||||
{
|
||||
|
|
|
@ -473,6 +473,9 @@ struct _Cea708Dec
|
|||
};
|
||||
|
||||
Cea708Dec *gst_cea708dec_create (PangoContext * pango_context);
|
||||
|
||||
void gst_cea708dec_free (Cea708Dec *dec);
|
||||
|
||||
void
|
||||
gst_cea708dec_set_service_number (Cea708Dec * decoder, gint8 desired_service);
|
||||
gboolean
|
||||
|
|
|
@ -301,6 +301,9 @@ gst_cea_cc_overlay_finalize (GObject * object)
|
|||
overlay->next_composition = NULL;
|
||||
}
|
||||
|
||||
gst_cea708dec_free (overlay->decoder);
|
||||
overlay->decoder = NULL;
|
||||
|
||||
g_mutex_clear (&overlay->lock);
|
||||
g_cond_clear (&overlay->cond);
|
||||
|
||||
|
|
Loading…
Reference in a new issue