瀏覽代碼

ffmpeg: fix an unprotected debug print

rdb 6 年之前
父節點
當前提交
6364485b49
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      panda/src/ffmpeg/ffmpegAudioCursor.cxx

+ 4 - 2
panda/src/ffmpeg/ffmpegAudioCursor.cxx

@@ -132,8 +132,10 @@ FfmpegAudioCursor(FfmpegAudio *src) :
   // Set up the resample context if necessary.
   // Set up the resample context if necessary.
   if (_audio_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
   if (_audio_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
 #ifdef HAVE_SWRESAMPLE
 #ifdef HAVE_SWRESAMPLE
-    ffmpeg_cat.debug()
-      << "Codec does not use signed 16-bit sample format.  Setting up swresample context.\n";
+    if (ffmpeg_cat.is_debug()) {
+      ffmpeg_cat.debug()
+        << "Codec does not use signed 16-bit sample format.  Setting up swresample context.\n";
+    }
 
 
     _resample_ctx = swr_alloc();
     _resample_ctx = swr_alloc();
     av_opt_set_int(_resample_ctx, "in_channel_count", _audio_channels, 0);
     av_opt_set_int(_resample_ctx, "in_channel_count", _audio_channels, 0);