OSDN Git Service

ffmpeg: warn if samples need to be converted in a lossy way for lossless encoders.
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 18 Jun 2011 19:54:11 +0000 (21:54 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 19 Jun 2011 01:54:15 +0000 (03:54 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.c

index 4e8ac20..2921a06 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -617,6 +617,8 @@ static void choose_sample_fmt(AVStream *st, AVCodec *codec)
                 break;
         }
         if (*p == -1) {
+            if((codec->capabilities & CODEC_CAP_LOSSLESS) && av_get_sample_fmt_name(st->codec->sample_fmt) > av_get_sample_fmt_name(codec->sample_fmts[0]))
+                av_log(NULL, AV_LOG_ERROR, "Convertion will not be lossless'\n");
             av_log(NULL, AV_LOG_WARNING,
                    "Incompatible sample format '%s' for codec '%s', auto-selecting format '%s'\n",
                    av_get_sample_fmt_name(st->codec->sample_fmt),