Browse code

ffmpeg: warns the user when the selected pixel format is ignored

Signed-off-by: Anton Khirnov <anton@khirnov.net>

Stefano Sabatini authored on 2011/03/26 23:26:45
Showing 1 changed files
... ...
@@ -590,8 +590,15 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec)
590 590
             if(*p == st->codec->pix_fmt)
591 591
                 break;
592 592
         }
593
-        if(*p == -1)
593
+        if (*p == -1) {
594
+            if(st->codec->pix_fmt != PIX_FMT_NONE)
595
+                av_log(NULL, AV_LOG_WARNING,
596
+                        "Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'\n",
597
+                        av_pix_fmt_descriptors[st->codec->pix_fmt].name,
598
+                        codec->name,
599
+                        av_pix_fmt_descriptors[codec->pix_fmts[0]].name);
594 600
             st->codec->pix_fmt = codec->pix_fmts[0];
601
+        }
595 602
     }
596 603
 }
597 604