diff --git a/ChangeLog b/ChangeLog index e1b4e15509..9c8f03f701 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-10-05 Thomas Vander Stichele + + * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps): + we have better ways of debugging caps + * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_setcaps): + ye gods. get_template_caps doesn't return a ref, so when the + pad was not linked, crashes would ensue. Serves me right. + 2005-10-03 Thomas Vander Stichele * configure.ac: diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index 20f0bfc6a1..75ae7b9400 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -782,7 +782,6 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, } if (caps != NULL) { - char *str; /* set private data */ if (context && context->extradata_size > 0) { @@ -800,9 +799,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, gst_ffmpeg_set_palette (caps, context); } - str = gst_caps_to_string (caps); - GST_DEBUG ("caps for codec_id=%d: %s", codec_id, str); - g_free (str); + GST_DEBUG ("caps for codec_id=%d: %" GST_PTR_FORMAT, codec_id, caps); } else { GST_WARNING ("No caps found for codec_id=%d", codec_id); diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c index 16929fb6db..c60ab75872 100644 --- a/ext/ffmpeg/gstffmpegenc.c +++ b/ext/ffmpeg/gstffmpegenc.c @@ -421,9 +421,13 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps) GST_DEBUG_OBJECT (ffmpegenc, "picking an output format ..."); allowed_caps = gst_pad_get_allowed_caps (ffmpegenc->srcpad); if (!allowed_caps) { - GST_DEBUG_OBJECT (ffmpegenc, "... but no peer, no caps"); - allowed_caps = gst_pad_get_pad_template_caps (ffmpegenc->srcpad); + GST_DEBUG_OBJECT (ffmpegenc, "... but no peer, using template caps"); + /* we need to copy because get_allowed_caps returns a ref, and + * get_pad_template_caps doesn't */ + allowed_caps = gst_caps_copy ( + gst_pad_get_pad_template_caps (ffmpegenc->srcpad)); } + GST_DEBUG_OBJECT (ffmpegenc, "chose caps %" GST_PTR_FORMAT, allowed_caps); gst_ffmpeg_caps_with_codecid (oclass->in_plugin->id, oclass->in_plugin->type, allowed_caps, ffmpegenc->context);