Commit 54a86d36 authored by Ronald S. Bultje's avatar Ronald S. Bultje

ext/ffmpeg/gstffmpegenc.c: Set chain function before adding pad, fix memleak...

ext/ffmpeg/gstffmpegenc.c: Set chain function before adding pad, fix memleak on error, error out on encode errors bec...

Original commit message from CVS:
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_init),
(gst_ffmpegenc_chain_video):
Set chain function before adding pad, fix memleak on error, error
out on encode errors because none of subsequent frames will work
any better (this is not input dependent).
parent dfabf3dd
2004-10-11 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_init),
(gst_ffmpegenc_chain_video):
Set chain function before adding pad, fix memleak on error, error
out on encode errors because none of subsequent frames will work
any better (this is not input dependent).
2004-10-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* configure.ac:
......
......@@ -243,9 +243,6 @@ gst_ffmpegenc_init (GstFFMpegEnc * ffmpegenc)
ffmpegenc->srcpad = gst_pad_new_from_template (oclass->srctempl, "src");
gst_pad_use_explicit_caps (ffmpegenc->srcpad);
gst_element_add_pad (GST_ELEMENT (ffmpegenc), ffmpegenc->sinkpad);
gst_element_add_pad (GST_ELEMENT (ffmpegenc), ffmpegenc->srcpad);
/* ffmpeg objects */
ffmpegenc->context = avcodec_alloc_context ();
ffmpegenc->picture = avcodec_alloc_frame ();
......@@ -263,6 +260,9 @@ gst_ffmpegenc_init (GstFFMpegEnc * ffmpegenc)
ffmpegenc->bitrate = 128000;
}
gst_element_add_pad (GST_ELEMENT (ffmpegenc), ffmpegenc->sinkpad);
gst_element_add_pad (GST_ELEMENT (ffmpegenc), ffmpegenc->srcpad);
}
static void
......@@ -404,8 +404,10 @@ gst_ffmpegenc_chain_video (GstPad * pad, GstData * _data)
GST_BUFFER_MAXSIZE (outbuf), ffmpegenc->picture);
if (ret_size < 0) {
g_warning ("ffenc_%s: failed to encode buffer", oclass->in_plugin->name);
GST_ELEMENT_ERROR (ffmpegenc, LIBRARY, ENCODE, (NULL),
("ffenc_%s: failed to encode buffer", oclass->in_plugin->name));
gst_buffer_unref (inbuf);
gst_buffer_unref (outbuf);
return;
}
......
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