Commit f356fc57 authored by Baptiste Coudurier's avatar Baptiste Coudurier

clarify encoder and decoder opening error messages

Originally committed as revision 19243 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent a481293f
...@@ -2013,13 +2013,13 @@ static int av_encode(AVFormatContext **output_files, ...@@ -2013,13 +2013,13 @@ static int av_encode(AVFormatContext **output_files,
if (!codec) if (!codec)
codec = avcodec_find_encoder(ost->st->codec->codec_id); codec = avcodec_find_encoder(ost->st->codec->codec_id);
if (!codec) { if (!codec) {
snprintf(error, sizeof(error), "Unsupported codec for output stream #%d.%d", snprintf(error, sizeof(error), "Encoder (codec id %d) not found for output stream #%d.%d",
ost->file_index, ost->index); ost->st->codec->codec_id, ost->file_index, ost->index);
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto dump_format; goto dump_format;
} }
if (avcodec_open(ost->st->codec, codec) < 0) { if (avcodec_open(ost->st->codec, codec) < 0) {
snprintf(error, sizeof(error), "Error while opening codec for output stream #%d.%d - maybe incorrect parameters such as bit_rate, rate, width or height", snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d.%d - maybe incorrect parameters such as bit_rate, rate, width or height",
ost->file_index, ost->index); ost->file_index, ost->index);
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto dump_format; goto dump_format;
...@@ -2036,13 +2036,13 @@ static int av_encode(AVFormatContext **output_files, ...@@ -2036,13 +2036,13 @@ static int av_encode(AVFormatContext **output_files,
if (!codec) if (!codec)
codec = avcodec_find_decoder(ist->st->codec->codec_id); codec = avcodec_find_decoder(ist->st->codec->codec_id);
if (!codec) { if (!codec) {
snprintf(error, sizeof(error), "Unsupported codec (id=%d) for input stream #%d.%d", snprintf(error, sizeof(error), "Decoder (codec id %d) not found for input stream #%d.%d",
ist->st->codec->codec_id, ist->file_index, ist->index); ist->st->codec->codec_id, ist->file_index, ist->index);
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto dump_format; goto dump_format;
} }
if (avcodec_open(ist->st->codec, codec) < 0) { if (avcodec_open(ist->st->codec, codec) < 0) {
snprintf(error, sizeof(error), "Error while opening codec for input stream #%d.%d", snprintf(error, sizeof(error), "Error while opening decoder for input stream #%d.%d",
ist->file_index, ist->index); ist->file_index, ist->index);
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto dump_format; goto dump_format;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment