diff options
author | wm4 <wm4@nowhere> | 2013-12-04 20:58:19 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-04 23:12:51 +0100 |
commit | 47c4b5c0003fa50cfefc3f2e8a089a9b0feebe3f (patch) | |
tree | 64ec0d1eaf105aaf113fb7ac4d09cb67452154bd /video | |
parent | 0afd121ae67a60d033fc8f74ec28bbb8b84f031d (diff) | |
download | mpv-47c4b5c0003fa50cfefc3f2e8a089a9b0feebe3f.tar.bz2 mpv-47c4b5c0003fa50cfefc3f2e8a089a9b0feebe3f.tar.xz |
vd_lavc: factor out libavcodec thread setup
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/vd_lavc.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index b48dc7fce7..10e46b78b1 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -49,7 +49,6 @@ #include "video/decode/dec_video.h" #include "demux/stheader.h" #include "demux/packet.h" -#include "osdep/numcores.h" #include "video/csputils.h" #include "lavc.h" @@ -393,9 +392,6 @@ static void init_avctx(struct dec_video *vd, const char *decoder, avctx->codec_type = AVMEDIA_TYPE_VIDEO; avctx->codec_id = lavc_codec->id; - avctx->thread_count = lavc_param->threads; - - #if HAVE_AVUTIL_REFCOUNTING avctx->refcounted_frames = 1; ctx->pic = av_frame_alloc(); @@ -420,17 +416,7 @@ static void init_avctx(struct dec_video *vd, const char *decoder, avctx->release_buffer = mp_codec_release_buffer; } #endif - } - - if (avctx->thread_count == 0) { - int threads = default_thread_count(); - if (threads < 1) { - mp_msg(MSGT_DECVIDEO, MSGL_WARN, "[VD_FFMPEG] Could not determine " - "thread count to use, defaulting to 1.\n"); - threads = 1; - } - threads = FFMIN(threads, 16); - avctx->thread_count = threads; + mp_set_avcodec_threads(avctx, lavc_param->threads); } avctx->flags |= lavc_param->bitexact; |