From d7dfbc86105ae2ad04a547042140cd12353e65e5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 5 Jan 2015 12:34:34 +0100 Subject: player: use libavutil API to get number of CPUs Our own code was introduced when FFmpeg didn't provide this API (or maybe didn't even have a way to determine the CPU count). But now, av_cpu_count() is available for all FFmpeg/Libav versions we support, and there's no reason to have our own code. libavutil's code seems to be slightly more sophisticated than our's, and it's possible that the detected CPU count is different on some platforms after this change. --- common/av_common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'common/av_common.c') diff --git a/common/av_common.c b/common/av_common.c index eb357d9f05..2d976bbc8d 100644 --- a/common/av_common.c +++ b/common/av_common.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "common/common.h" @@ -30,8 +31,6 @@ #include "av_common.h" #include "codecs.h" -#include "osdep/numcores.h" - int mp_lavc_set_extradata(AVCodecContext *avctx, void *ptr, int size) { if (size) { @@ -129,7 +128,7 @@ void mp_set_av_packet(AVPacket *dst, struct demux_packet *mpkt, AVRational *tb) void mp_set_avcodec_threads(struct mp_log *l, AVCodecContext *avctx, int threads) { if (threads == 0) { - threads = default_thread_count(); + threads = av_cpu_count(); if (threads < 1) { mp_warn(l, "Could not determine thread count to use, defaulting to 1.\n"); threads = 1; -- cgit v1.2.3