+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:
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 ();
ffmpegenc->bitrate = 128000;
}
+
+ gst_element_add_pad (GST_ELEMENT (ffmpegenc), ffmpegenc->sinkpad);
+ gst_element_add_pad (GST_ELEMENT (ffmpegenc), ffmpegenc->srcpad);
}
static void
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;
}