Commit a1384f99 authored by Edward Hervey's avatar Edward Hervey 🤘

ffmpegdec: Only restore default in AVCodecContext when needed.

Resetting default values is currently very complex in libavcodec, so
we only call it when needed (i.e. when a context was previously used).

Shaves off 10% of the setup of a decoder.
parent 72cd8f18
......@@ -714,11 +714,11 @@ gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps)
GST_OBJECT_UNLOCK (ffmpegdec);
gst_ffmpegdec_drain (ffmpegdec);
GST_OBJECT_LOCK (ffmpegdec);
gst_ffmpegdec_close (ffmpegdec);
gst_ffmpegdec_close (ffmpegdec);
/* set defaults */
avcodec_get_context_defaults (ffmpegdec->context);
/* and reset the defaults that were set when a context is created */
avcodec_get_context_defaults (ffmpegdec->context);
/* set buffer functions */
ffmpegdec->context->get_buffer = gst_ffmpegdec_get_buffer;
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