Commit 0556f090 authored by Benjamin Otte's avatar Benjamin Otte

ext/ffmpeg/: fix memleaks

Original commit message from CVS:
2004-02-11  Benjamin Otte  <in7y118@public.uni-hamburg.de>

* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_base_init):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_base_init):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_base_init):
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_base_init):
fix memleaks
parent aedc3d17
common @ 90097339
Subproject commit 90e64b98d566fd8df793cfc0a9b08b8e5fb356d3
Subproject commit 90097339543fb0a705447b599d7a36138cba4232
......@@ -119,7 +119,7 @@ gst_ffmpegdec_base_init (GstFFMpegDecClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstFFMpegDecClassParams *params;
GstElementDetails *details;
GstElementDetails details;
GstPadTemplate *sinktempl, *srctempl;
params = g_hash_table_lookup (global_plugins,
......@@ -130,16 +130,19 @@ gst_ffmpegdec_base_init (GstFFMpegDecClass *klass)
g_assert (params);
/* construct the element details struct */
details = g_new0 (GstElementDetails, 1);
details->longname = g_strdup_printf("FFMPEG %s decoder",
details.longname = g_strdup_printf("FFMPEG %s decoder",
params->in_plugin->name);
details->klass = g_strdup_printf("Codec/Decoder/%s",
details.klass = g_strdup_printf("Codec/Decoder/%s",
(params->in_plugin->type == CODEC_TYPE_VIDEO) ?
"Video" : "Audio");
details->description = g_strdup_printf("FFMPEG %s decoder",
details.description = g_strdup_printf("FFMPEG %s decoder",
params->in_plugin->name);
details->author = g_strdup("Wim Taymans <wim.taymans@chello.be>\n"
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
details.author = "Wim Taymans <wim.taymans@chello.be>, "
"Ronald Bultje <rbultje@ronald.bitfreak.net>";
gst_element_class_set_details (element_class, &details);
g_free (details.longname);
g_free (details.klass);
g_free (details.description);
/* pad templates */
sinktempl = gst_pad_template_new ("sink", GST_PAD_SINK,
......@@ -149,7 +152,6 @@ gst_ffmpegdec_base_init (GstFFMpegDecClass *klass)
gst_element_class_add_pad_template (element_class, srctempl);
gst_element_class_add_pad_template (element_class, sinktempl);
gst_element_class_set_details (element_class, details);
klass->in_plugin = params->in_plugin;
klass->srctempl = srctempl;
......
......@@ -109,7 +109,7 @@ gst_ffmpegdemux_base_init (GstFFMpegDemuxClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstFFMpegDemuxClassParams *params;
GstElementDetails *details;
GstElementDetails details;
GstPadTemplate *sinktempl, *audiosrctempl, *videosrctempl;
params = g_hash_table_lookup (global_plugins,
......@@ -120,14 +120,17 @@ gst_ffmpegdemux_base_init (GstFFMpegDemuxClass *klass)
g_assert (params);
/* construct the element details struct */
details = g_new0 (GstElementDetails, 1);
details->longname = g_strdup_printf("FFMPEG %s demuxer",
details.longname = g_strdup_printf("FFMPEG %s demuxer",
params->in_plugin->name);
details->klass = g_strdup("Codec/Demuxer");
details->description = g_strdup_printf("FFMPEG %s decoder",
details.klass = g_strdup("Codec/Demuxer");
details.description = g_strdup_printf("FFMPEG %s decoder",
params->in_plugin->name);
details->author = g_strdup("Wim Taymans <wim.taymans@chello.be>\n"
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
details.author = "Wim Taymans <wim.taymans@chello.be>, "
"Ronald Bultje <rbultje@ronald.bitfreak.net>";
gst_element_class_set_details (element_class, &details);
g_free (details.longname);
g_free (details.klass);
g_free (details.description);
/* pad templates */
sinktempl = gst_pad_template_new ("sink",
......@@ -146,7 +149,6 @@ gst_ffmpegdemux_base_init (GstFFMpegDemuxClass *klass)
gst_element_class_add_pad_template (element_class, videosrctempl);
gst_element_class_add_pad_template (element_class, audiosrctempl);
gst_element_class_add_pad_template (element_class, sinktempl);
gst_element_class_set_details (element_class, details);
klass->in_plugin = params->in_plugin;
klass->videosrctempl = videosrctempl;
......
......@@ -151,7 +151,7 @@ gst_ffmpegenc_base_init (GstFFMpegEncClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstFFMpegEncClassParams *params;
GstElementDetails *details;
GstElementDetails details;
GstPadTemplate *srctempl, *sinktempl;
params = g_hash_table_lookup (enc_global_plugins,
......@@ -164,16 +164,19 @@ gst_ffmpegenc_base_init (GstFFMpegEncClass *klass)
g_assert (params);
/* construct the element details struct */
details = g_new0 (GstElementDetails, 1);
details->longname = g_strdup_printf("FFMPEG %s encoder",
details.longname = g_strdup_printf("FFMPEG %s encoder",
params->in_plugin->name);
details->klass = g_strdup_printf("Codec/Encoder/%s",
details.klass = g_strdup_printf("Codec/Encoder/%s",
(params->in_plugin->type == CODEC_TYPE_VIDEO) ?
"Video" : "Audio");
details->description = g_strdup_printf("FFMPEG %s encoder",
details.description = g_strdup_printf("FFMPEG %s encoder",
params->in_plugin->name);
details->author = g_strdup("Wim Taymans <wim.taymans@chello.be>\n"
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
details.author = "Wim Taymans <wim.taymans@chello.be>, "
"Ronald Bultje <rbultje@ronald.bitfreak.net>";
gst_element_class_set_details (element_class, &details);
g_free (details.longname);
g_free (details.klass);
g_free (details.description);
/* pad templates */
sinktempl = gst_pad_template_new ("sink", GST_PAD_SINK,
......@@ -183,7 +186,6 @@ gst_ffmpegenc_base_init (GstFFMpegEncClass *klass)
gst_element_class_add_pad_template (element_class, srctempl);
gst_element_class_add_pad_template (element_class, sinktempl);
gst_element_class_set_details (element_class, details);
klass->in_plugin = params->in_plugin;
klass->srctempl = srctempl;
......
......@@ -114,8 +114,8 @@ gst_ffmpegmux_base_init (GstFFMpegMuxClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstElementDetails details;
GstFFMpegMuxClassParams *params;
GstElementDetails *details;
GstPadTemplate *videosinktempl, *audiosinktempl, *srctempl;
params = g_hash_table_lookup (global_plugins,
......@@ -126,14 +126,17 @@ gst_ffmpegmux_base_init (GstFFMpegMuxClass *klass)
g_assert (params);
/* construct the element details struct */
details = g_new0 (GstElementDetails, 1);
details->longname = g_strdup_printf ("FFMPEG %s Muxer",
details.longname = g_strdup_printf ("FFMPEG %s Muxer",
params->in_plugin->name);
details->klass = g_strdup ("Codec/Muxer");
details->description = g_strdup_printf ("FFMPEG %s Muxer",
details.klass = g_strdup ("Codec/Muxer");
details.description = g_strdup_printf ("FFMPEG %s Muxer",
params->in_plugin->name);
details->author = g_strdup ("Wim Taymans <wim.taymans@chello.be>\n"
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
details.author = "Wim Taymans <wim.taymans@chello.be>, "
"Ronald Bultje <rbultje@ronald.bitfreak.net>";
gst_element_class_set_details (element_class, &details);
g_free (details.longname);
g_free (details.klass);
g_free (details.description);
/* pad templates */
srctempl = gst_pad_template_new ("sink", GST_PAD_SRC,
......@@ -151,7 +154,6 @@ gst_ffmpegmux_base_init (GstFFMpegMuxClass *klass)
gst_element_class_add_pad_template (element_class, srctempl);
gst_element_class_add_pad_template (element_class, videosinktempl);
gst_element_class_add_pad_template (element_class, audiosinktempl);
gst_element_class_set_details (element_class, details);
klass->in_plugin = params->in_plugin;
klass->srctempl = srctempl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment