ffmpegdec->context->bit_rate = 0;
/* FIXME bug in ffmpeg */
+ /*
if (avcodec_open (ffmpegdec->context, avcodec_find_encoder(CODEC_ID_MPEG1VIDEO)) <0 ) {
g_warning ("ffmpegdec: could not open codec");
return GST_PAD_CONNECT_REFUSED;
}
+ */
if (avcodec_open (ffmpegdec->context, oclass->in_plugin) < 0) {
g_warning ("ffmpegdec: could not open codec");
{
GstFFMpegDecClass *oclass = (GstFFMpegDecClass*)(G_OBJECT_GET_CLASS (ffmpegdec));
- ffmpegdec->context = g_malloc0 (sizeof (AVCodecContext));
+ ffmpegdec->context = avcodec_alloc_context();
ffmpegdec->sinkpad = gst_pad_new_from_template (oclass->templ, "sink");
gst_pad_set_connect_function (ffmpegdec->sinkpad, gst_ffmpegdec_sinkconnect);
{
GstFFMpegEncClass *oclass = (GstFFMpegEncClass*)(G_OBJECT_GET_CLASS (ffmpegenc));
- ffmpegenc->context = g_malloc0 (sizeof (AVCodecContext));
+ ffmpegenc->context = avcodec_alloc_context();
if (oclass->in_plugin->type == CODEC_TYPE_VIDEO) {
ffmpegenc->sinkpad = gst_pad_new_from_template (
{
GstFFMpegMuxClass *oclass = (GstFFMpegMuxClass*)(G_OBJECT_GET_CLASS (ffmpegmux));
- ffmpegmux->context = g_malloc0 (sizeof (AVCodecContext));
+ ffmpegmux->context = avcodec_alloc_context();
ffmpegmux->sinkpad = gst_pad_new_from_template (
GST_PAD_TEMPLATE_GET (gst_ffmpegmux_sink_factory), "sink");