[FFmpeg-devel] [PATCH 4/4] lavc: print supported list when a encoder is opened with a non supported value

Michael Niedermayer michaelni at gmx.at
Mon Oct 22 02:01:37 CEST 2012


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/utils.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 85df446..a16049a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1041,6 +1041,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
                 snprintf(buf, sizeof(buf), "%d", avctx->sample_fmt);
                 av_log(avctx, AV_LOG_ERROR, "Specified sample format %s is invalid or not supported\n",
                        (char *)av_x_if_null(av_get_sample_fmt_name(avctx->sample_fmt), buf));
+                avcodec_print_supported(avctx, avctx->codec, "sample formats");
                 ret = AVERROR(EINVAL);
                 goto free_and_end;
             }
@@ -1056,6 +1057,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
                 snprintf(buf, sizeof(buf), "%d", avctx->pix_fmt);
                 av_log(avctx, AV_LOG_ERROR, "Specified pixel format %s is invalid or not supported\n",
                        (char *)av_x_if_null(av_get_pix_fmt_name(avctx->pix_fmt), buf));
+                avcodec_print_supported(avctx, avctx->codec, "pixel formats");
                 ret = AVERROR(EINVAL);
                 goto free_and_end;
             }
@@ -1067,6 +1069,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
             if (avctx->codec->supported_samplerates[i] == 0) {
                 av_log(avctx, AV_LOG_ERROR, "Specified sample rate %d is not supported\n",
                        avctx->sample_rate);
+                avcodec_print_supported(avctx, avctx->codec, "sample rates");
                 ret = AVERROR(EINVAL);
                 goto free_and_end;
             }
@@ -1082,6 +1085,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
                     char buf[512];
                     av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout);
                     av_log(avctx, AV_LOG_ERROR, "Specified channel layout '%s' is not supported\n", buf);
+                    avcodec_print_supported(avctx, avctx->codec, "channel layouts");
                     ret = AVERROR(EINVAL);
                     goto free_and_end;
                 }
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list