summaryrefslogtreecommitdiffstats
path: root/common/av_common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-05 12:17:55 +0100
committerwm4 <wm4@nowhere>2015-01-05 12:17:55 +0100
commit0f4bf347c52543057404e5c36f504ab18b901dba (patch)
tree5ead802be1e31c42969d92e74a7193ab94f18e05 /common/av_common.c
parent862a1b6e7eb3b16aad2d12196bd2410e996a27b1 (diff)
downloadmpv-0f4bf347c52543057404e5c36f504ab18b901dba.tar.bz2
mpv-0f4bf347c52543057404e5c36f504ab18b901dba.tar.xz
player: print used number of threads in verbose mode
Also, don't use av_log() for mpv output.
Diffstat (limited to 'common/av_common.c')
-rw-r--r--common/av_common.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/av_common.c b/common/av_common.c
index cced1c0694..eb357d9f05 100644
--- a/common/av_common.c
+++ b/common/av_common.c
@@ -126,19 +126,21 @@ void mp_set_av_packet(AVPacket *dst, struct demux_packet *mpkt, AVRational *tb)
dst->dts = mp_pts_to_av(mpkt ? mpkt->dts : MP_NOPTS_VALUE, tb);
}
-void mp_set_avcodec_threads(AVCodecContext *avctx, int threads)
+void mp_set_avcodec_threads(struct mp_log *l, AVCodecContext *avctx, int threads)
{
if (threads == 0) {
threads = default_thread_count();
if (threads < 1) {
- av_log(avctx, AV_LOG_WARNING, "Could not determine "
- "thread count to use, defaulting to 1.\n");
+ mp_warn(l, "Could not determine thread count to use, defaulting to 1.\n");
threads = 1;
+ } else {
+ mp_verbose(l, "Detected %d logical cores.\n", threads);
}
// Apparently some libavcodec versions have or had trouble with more
// than 16 threads, and/or print a warning when using > 16.
threads = MPMIN(threads, 16);
}
+ mp_verbose(l, "Requesting %d threads for decoding.\n", threads);
avctx->thread_count = threads;
}