[FFmpeg-devel] [PATCH 4/4] swr: fix invalid sample format message.

Clément Bœsch ubitux at gmail.com
Thu Nov 24 16:08:21 CET 2011


If the sample format is invalid, av_get_sample_fmt_name() will always
return NULL.
---
 libswresample/swresample.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 831bae0..0575f7d 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -149,11 +149,11 @@ int swr_init(struct SwrContext *s){
     s->out_sample_fmt= av_get_alt_sample_fmt(s->out_sample_fmt, 0);
 
     if(s-> in_sample_fmt >= AV_SAMPLE_FMT_NB){
-        av_log(s, AV_LOG_ERROR, "Requested sample format %s is invalid\n", av_get_sample_fmt_name(s->in_sample_fmt));
+        av_log(s, AV_LOG_ERROR, "Requested input sample format %d is invalid\n", s->in_sample_fmt);
         return AVERROR(EINVAL);
     }
     if(s->out_sample_fmt >= AV_SAMPLE_FMT_NB){
-        av_log(s, AV_LOG_ERROR, "Requested sample format %s is invalid\n", av_get_sample_fmt_name(s->out_sample_fmt));
+        av_log(s, AV_LOG_ERROR, "Requested output sample format %d is invalid\n", s->out_sample_fmt);
         return AVERROR(EINVAL);
     }
 
-- 
1.7.7.4



More information about the ffmpeg-devel mailing list