avcodec: move "thread emulation" warning to common code
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 13 Sep 2011 12:40:13 +0000 (14:40 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 13 Sep 2011 13:05:42 +0000 (15:05 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffplay.c
libavcodec/utils.c

index 8123f43..9d21714 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -2890,9 +2890,6 @@ static int opt_duration(const char *opt, const char *arg)
 static int opt_thread_count(const char *opt, const char *arg)
 {
     thread_count= parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
-#if !HAVE_THREADS
-    fprintf(stderr, "Warning: not compiled with thread support, using thread emulation\n");
-#endif
     return 0;
 }
 
index ee1bfcc..da12dda 100644 (file)
@@ -576,6 +576,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
     }
     avctx->frame_number = 0;
 
+    if (!HAVE_THREADS)
+        av_log(avctx, AV_LOG_WARNING, "Warning: not compiled with thread support, using thread emulation\n");
+
     if (HAVE_THREADS && !avctx->thread_opaque) {
         ret = ff_thread_init(avctx);
         if (ret < 0) {