[PATCH] Make ffmpeg warns the user when the selected sample format is ignored.

Stefano Sabatini stefano.sabatini-lala
Fri Jan 14 15:50:55 CET 2011


---
 ffmpeg.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 1c7ccbb..f92b81c 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -599,8 +599,14 @@ static void choose_sample_fmt(AVStream *st, AVCodec *codec)
             if(*p == st->codec->sample_fmt)
                 break;
         }
-        if(*p == -1)
+        if (*p == -1) {
+            av_log(NULL, AV_LOG_WARNING,
+                   "Invalid sample format '%s' in stream format '%s', selecting format '%s'\n",
+                   av_get_sample_fmt_name(st->codec->sample_fmt),
+                   codec->name,
+                   av_get_sample_fmt_name(codec->sample_fmts[0]));
             st->codec->sample_fmt = codec->sample_fmts[0];
+        }
     }
 }
 
-- 
1.7.2.3


--gBBFr7Ir9EOA20Yy--



More information about the ffmpeg-devel mailing list