mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avconv: fix some bugs introduced in 630902a1e1336e7ee0cf3dcbcb6eb07af8edf660
These caused scrambled error messages to be printed and floating point exceptions. For example when there was no decoder available for a stream. Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
9bc9188e58
commit
6248694861
6
avconv.c
6
avconv.c
@ -1822,7 +1822,7 @@ static int init_input_stream(int ist_index, OutputStream *output_streams, int nb
|
|||||||
if (ist->decoding_needed) {
|
if (ist->decoding_needed) {
|
||||||
AVCodec *codec = ist->dec;
|
AVCodec *codec = ist->dec;
|
||||||
if (!codec) {
|
if (!codec) {
|
||||||
snprintf(error, sizeof(error), "Decoder (codec id %d) not found for input stream #%d.%d",
|
snprintf(error, error_len, "Decoder (codec id %d) not found for input stream #%d.%d",
|
||||||
ist->st->codec->codec_id, ist->file_index, ist->st->index);
|
ist->st->codec->codec_id, ist->file_index, ist->st->index);
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
@ -1838,7 +1838,7 @@ static int init_input_stream(int ist_index, OutputStream *output_streams, int nb
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (avcodec_open2(ist->st->codec, codec, &ist->opts) < 0) {
|
if (avcodec_open2(ist->st->codec, codec, &ist->opts) < 0) {
|
||||||
snprintf(error, sizeof(error), "Error while opening decoder for input stream #%d.%d",
|
snprintf(error, error_len, "Error while opening decoder for input stream #%d.%d",
|
||||||
ist->file_index, ist->st->index);
|
ist->file_index, ist->st->index);
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
@ -2150,7 +2150,7 @@ static int transcode_init(OutputFile *output_files,
|
|||||||
|
|
||||||
/* init input streams */
|
/* init input streams */
|
||||||
for (i = 0; i < nb_input_streams; i++)
|
for (i = 0; i < nb_input_streams; i++)
|
||||||
if ((ret = init_input_stream(i, output_streams, nb_output_streams, error, sizeof(error)) < 0))
|
if ((ret = init_input_stream(i, output_streams, nb_output_streams, error, sizeof(error))) < 0)
|
||||||
goto dump_format;
|
goto dump_format;
|
||||||
|
|
||||||
/* open files and write file headers */
|
/* open files and write file headers */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user