OSDN Git Service

omx: hwaccel: decode in one thread
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 9 May 2017 05:49:43 +0000 (13:49 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 9 May 2017 05:49:43 +0000 (13:49 +0800)
As FFmpeg asserts, hardware accelerated decoding with frame threading
is known to be unstable.

To make hardware codecs stable, just decode in one thread.

omx/SoftFFmpegVideo.cpp
omx/ffmpeg_hwaccel.c

index 9034417..e59992b 100644 (file)
@@ -93,7 +93,6 @@ void SoftFFmpegVideo::setDefaultCtx(AVCodecContext *avctx, const AVCodec *codec)
     avctx->skip_idct         = AVDISCARD_DEFAULT;
     avctx->skip_loop_filter  = AVDISCARD_ALL;
     avctx->error_concealment = 3;
-    avctx->thread_count      = 0;
 
     if (fast)   avctx->flags2 |= AV_CODEC_FLAG2_FAST;
 #ifdef CODEC_FLAG_EMU_EDGE
index d59963c..229fcb1 100644 (file)
@@ -106,6 +106,7 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
         }
         ist->active_hwaccel_id = hwaccel->id;
         ist->hwaccel_pix_fmt = *p;
+        s->thread_count = 1;
 #ifdef LIBAV_CONFIG_H
         ist->dec = s->codec;
         ist->dec_ctx = avcodec_alloc_context3(ist->dec);