ffmpegdec: Use auto-threads if available, and only slice-threading

Slice threading causes less latency (and corruption)
This commit is contained in:
Edward Hervey 2012-03-02 17:27:30 +01:00
parent 0a16f7edf6
commit 57c7f59268

View file

@ -884,11 +884,16 @@ gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps)
* supports it) */
ffmpegdec->context->debug_mv = ffmpegdec->debug_mv;
if (ffmpegdec->max_threads == 0)
ffmpegdec->context->thread_count = gst_ffmpeg_auto_max_threads ();
else
if (ffmpegdec->max_threads == 0) {
if (!(oclass->in_plugin->capabilities & CODEC_CAP_AUTO_THREADS))
ffmpegdec->context->thread_count = gst_ffmpeg_auto_max_threads ();
else
ffmpegdec->context->thread_count = 0;
} else
ffmpegdec->context->thread_count = ffmpegdec->max_threads;
ffmpegdec->context->thread_type = FF_THREAD_SLICE;
/* open codec - we don't select an output pix_fmt yet,
* simply because we don't know! We only get it
* during playback... */