mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
audioencoder: unref before memset
Unref allocator and input_caps in encoder context before memsetting the context.
This commit is contained in:
parent
420dacb2d5
commit
82e5ec553b
1 changed files with 6 additions and 6 deletions
|
@ -465,7 +465,13 @@ gst_audio_encoder_reset (GstAudioEncoder * enc, gboolean full)
|
|||
enc->priv->ctx.headers = NULL;
|
||||
enc->priv->ctx.new_headers = FALSE;
|
||||
|
||||
if (enc->priv->ctx.allocator)
|
||||
gst_object_unref (enc->priv->ctx.allocator);
|
||||
enc->priv->ctx.allocator = NULL;
|
||||
|
||||
gst_caps_replace (&enc->priv->ctx.input_caps, NULL);
|
||||
gst_caps_replace (&enc->priv->ctx.caps, NULL);
|
||||
|
||||
memset (&enc->priv->ctx, 0, sizeof (enc->priv->ctx));
|
||||
gst_audio_info_init (&enc->priv->ctx.info);
|
||||
|
||||
|
@ -477,12 +483,6 @@ gst_audio_encoder_reset (GstAudioEncoder * enc, gboolean full)
|
|||
g_list_foreach (enc->priv->pending_events, (GFunc) gst_event_unref, NULL);
|
||||
g_list_free (enc->priv->pending_events);
|
||||
enc->priv->pending_events = NULL;
|
||||
|
||||
if (enc->priv->ctx.allocator)
|
||||
gst_object_unref (enc->priv->ctx.allocator);
|
||||
enc->priv->ctx.allocator = NULL;
|
||||
|
||||
gst_caps_replace (&enc->priv->ctx.input_caps, NULL);
|
||||
}
|
||||
|
||||
gst_segment_init (&enc->input_segment, GST_FORMAT_TIME);
|
||||
|
|
Loading…
Reference in a new issue