ext/ffmpeg/gstffmpegenc.c: Only free context if it was created (otherwise it crashes).

Original commit message from CVS:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_link):
Only free context if it was created (otherwise it crashes).
This commit is contained in:
Ronald S. Bultje 2005-02-05 18:35:18 +00:00
parent 363794a122
commit cdcc9bc7cf
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2005-02-05 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_link):
Only free context if it was created (otherwise it crashes).
2005-02-04 Jan Schmidt <thaytan@mad.scientist.com>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame),

View file

@ -389,7 +389,8 @@ gst_ffmpegenc_link (GstPad * pad, const GstCaps * caps)
/* open codec */
if (avcodec_open (ffmpegenc->context, oclass->in_plugin) < 0) {
avcodec_close (ffmpegenc->context);
if (ffmpegenc->context->priv_data)
avcodec_close (ffmpegenc->context);
GST_DEBUG ("ffenc_%s: Failed to open FFMPEG codec",
oclass->in_plugin->name);
return GST_PAD_LINK_REFUSED;