summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward.hervey@collabora.co.uk>2012-03-02 17:27:30 +0100
committerEdward Hervey <edward.hervey@collabora.co.uk>2012-03-02 17:27:30 +0100
commit57c7f592689ea9110c4d6ec3b3090bbe1649eea3 (patch)
treec9a9f0eb935529dbc250d6ad9adc44040a38ecf7
parent0a16f7edf6952639c30dbb53930b63fcb1edaa64 (diff)
ffmpegdec: Use auto-threads if available, and only slice-threading
Slice threading causes less latency (and corruption)
-rw-r--r--ext/ffmpeg/gstffmpegdec.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index fa2e2f4..918abf8 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -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... */