Commit 43d197a8 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

ext/ffmpeg/: Don't leak caps in some cases and make build bots happy again.

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_register):
Don't leak caps in some cases and make build bots happy again.
parent 8c08c787
2006-09-29 Tim-Philipp Müller <tim at centricular dot net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_register):
Don't leak caps in some cases and make build bots happy again.
2006-09-23 Edward Hervey <edward@fluendo.com>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
......
common @ 9991f6fa
Subproject commit a8c15b7a2c75fc2bd83850cb17cb05a1ee84ecaf
Subproject commit 9991f6fa61ee11475c390dd6675ef7952f079e43
......@@ -2060,7 +2060,7 @@ gst_ffmpegdec_register (GstPlugin * plugin)
while (in_plugin) {
GstFFMpegDecClassParams *params;
GstCaps *srccaps, *sinkcaps;
GstCaps *srccaps = NULL, *sinkcaps = NULL;
gchar *type_name;
/* no quasi-codecs, please */
......@@ -2088,13 +2088,8 @@ gst_ffmpegdec_register (GstPlugin * plugin)
} else {
srccaps = gst_ffmpeg_codectype_to_caps (in_plugin->type, NULL);
}
if (!sinkcaps || !srccaps) {
if (sinkcaps)
gst_caps_unref (sinkcaps);
if (srccaps)
gst_caps_unref (srccaps);
if (!sinkcaps || !srccaps)
goto next;
}
/* construct the type */
type_name = g_strdup_printf ("ffdec_%s", in_plugin->name);
......@@ -2107,8 +2102,8 @@ gst_ffmpegdec_register (GstPlugin * plugin)
params = g_new0 (GstFFMpegDecClassParams, 1);
params->in_plugin = in_plugin;
params->srccaps = srccaps;
params->sinkcaps = sinkcaps;
params->srccaps = gst_caps_ref (srccaps);
params->sinkcaps = gst_caps_ref (sinkcaps);
g_hash_table_insert (global_plugins,
GINT_TO_POINTER (0), (gpointer) params);
......@@ -2156,6 +2151,10 @@ gst_ffmpegdec_register (GstPlugin * plugin)
GINT_TO_POINTER (type), (gpointer) params);
next:
if (sinkcaps)
gst_caps_unref (sinkcaps);
if (srccaps)
gst_caps_unref (srccaps);
in_plugin = in_plugin->next;
}
g_hash_table_remove (global_plugins, GINT_TO_POINTER (0));
......
......@@ -910,7 +910,7 @@ gst_ffmpegenc_register (GstPlugin * plugin)
while (in_plugin) {
gchar *type_name;
GstCaps *srccaps, *sinkcaps;
GstCaps *srccaps = NULL, *sinkcaps = NULL;
GstFFMpegEncClassParams *params;
/* no quasi codecs, please */
......@@ -953,8 +953,8 @@ gst_ffmpegenc_register (GstPlugin * plugin)
params = g_new0 (GstFFMpegEncClassParams, 1);
params->in_plugin = in_plugin;
params->srccaps = srccaps;
params->sinkcaps = sinkcaps;
params->srccaps = gst_caps_ref (srccaps);
params->sinkcaps = gst_caps_ref (sinkcaps);
g_hash_table_insert (enc_global_plugins,
GINT_TO_POINTER (0), (gpointer) params);
......@@ -972,6 +972,10 @@ gst_ffmpegenc_register (GstPlugin * plugin)
GINT_TO_POINTER (type), (gpointer) params);
next:
if (sinkcaps)
gst_caps_unref (sinkcaps);
if (srccaps)
gst_caps_unref (srccaps);
in_plugin = in_plugin->next;
}
g_hash_table_remove (enc_global_plugins, GINT_TO_POINTER (0));
......
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