diff --git a/ext/libav/gstavauddec.c b/ext/libav/gstavauddec.c index a7befb231d..026051f784 100644 --- a/ext/libav/gstavauddec.c +++ b/ext/libav/gstavauddec.c @@ -131,8 +131,11 @@ gst_ffmpegauddec_class_init (GstFFMpegAudDecClass * klass) static void gst_ffmpegauddec_init (GstFFMpegAudDec * ffmpegdec) { + GstFFMpegAudDecClass *klass = + (GstFFMpegAudDecClass *) G_OBJECT_GET_CLASS (ffmpegdec); + /* some ffmpeg data */ - ffmpegdec->context = avcodec_alloc_context3 (NULL); + ffmpegdec->context = avcodec_alloc_context3 (klass->in_plugin); ffmpegdec->opened = FALSE; gst_audio_decoder_set_drainable (GST_AUDIO_DECODER (ffmpegdec), TRUE); @@ -294,7 +297,7 @@ gst_ffmpegauddec_set_format (GstAudioDecoder * decoder, GstCaps * caps) gst_ffmpegauddec_close (ffmpegdec); /* and reset the defaults that were set when a context is created */ - avcodec_get_context_defaults3 (ffmpegdec->context, NULL); + avcodec_get_context_defaults3 (ffmpegdec->context, oclass->in_plugin); } /* get size and so */ diff --git a/ext/libav/gstavaudenc.c b/ext/libav/gstavaudenc.c index 635655960d..6996da72f1 100644 --- a/ext/libav/gstavaudenc.c +++ b/ext/libav/gstavaudenc.c @@ -166,8 +166,11 @@ gst_ffmpegaudenc_class_init (GstFFMpegAudEncClass * klass) static void gst_ffmpegaudenc_init (GstFFMpegAudEnc * ffmpegaudenc) { + GstFFMpegAudEncClass *klass = + (GstFFMpegAudEncClass *) G_OBJECT_GET_CLASS (ffmpegaudenc); + /* ffmpeg objects */ - ffmpegaudenc->context = avcodec_alloc_context3 (NULL); + ffmpegaudenc->context = avcodec_alloc_context3 (klass->in_plugin); ffmpegaudenc->opened = FALSE; gst_audio_encoder_set_drainable (GST_AUDIO_ENCODER (ffmpegaudenc), TRUE); @@ -243,7 +246,7 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info) } /* set defaults */ - avcodec_get_context_defaults3 (ffmpegaudenc->context, NULL); + avcodec_get_context_defaults3 (ffmpegaudenc->context, oclass->in_plugin); /* if we set it in _getcaps we should set it also in _link */ ffmpegaudenc->context->strict_std_compliance = -1; diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index 279b74dbe1..a53ecfbedc 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -240,8 +240,11 @@ gst_ffmpegviddec_class_init (GstFFMpegVidDecClass * klass) static void gst_ffmpegviddec_init (GstFFMpegVidDec * ffmpegdec) { + GstFFMpegVidDecClass *klass = + (GstFFMpegVidDecClass *) G_OBJECT_GET_CLASS (ffmpegdec); + /* some ffmpeg data */ - ffmpegdec->context = avcodec_alloc_context3 (NULL); + ffmpegdec->context = avcodec_alloc_context3 (klass->in_plugin); ffmpegdec->picture = avcodec_alloc_frame (); ffmpegdec->opened = FALSE; ffmpegdec->skip_frame = ffmpegdec->lowres = 0; @@ -366,7 +369,7 @@ gst_ffmpegviddec_set_format (GstVideoDecoder * decoder, gst_ffmpegviddec_close (ffmpegdec); /* and reset the defaults that were set when a context is created */ - avcodec_get_context_defaults3 (ffmpegdec->context, NULL); + avcodec_get_context_defaults3 (ffmpegdec->context, oclass->in_plugin); } /* set buffer functions */ diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c index 807da6854f..7709d1ad07 100644 --- a/ext/libav/gstavvidenc.c +++ b/ext/libav/gstavvidenc.c @@ -219,8 +219,11 @@ gst_ffmpegvidenc_class_init (GstFFMpegVidEncClass * klass) static void gst_ffmpegvidenc_init (GstFFMpegVidEnc * ffmpegenc) { + GstFFMpegVidEncClass *klass = + (GstFFMpegVidEncClass *) G_OBJECT_GET_CLASS (ffmpegenc); + /* ffmpeg objects */ - ffmpegenc->context = avcodec_alloc_context3 (NULL); + ffmpegenc->context = avcodec_alloc_context3 (klass->in_plugin); ffmpegenc->picture = avcodec_alloc_frame (); ffmpegenc->opened = FALSE; @@ -398,7 +401,7 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder, } /* set defaults */ - avcodec_get_context_defaults3 (ffmpegenc->context, NULL); + avcodec_get_context_defaults3 (ffmpegenc->context, oclass->in_plugin); /* if we set it in _getcaps we should set it also in _link */ ffmpegenc->context->strict_std_compliance = -1;