mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
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).
This commit is contained in:
parent
dfabf3dd2e
commit
54a86d367d
2 changed files with 14 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue