mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 16:21:17 +00:00
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.
This commit is contained in:
parent
72cd8f1843
commit
a1384f990b
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
||||
/* set defaults */
|
||||
/* 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;
|
||||
|
|
Loading…
Reference in a new issue