History

avconv: report the error for codec open failure

External codec may have corner case reason to fail at init, better report them instead having the user wonder.

Luca Barbato committed 13 years ago

Commit 42cc6ce1 parent 1e340af1 file · +8 −2Browse files

Unified · Split

avconv.c+8−2
@@ -1371,10 +1371,16 @@ static int init_input_stream(int ist_index, char *error, int error_len) · 1370 unmodified lines
13711371 if (!av_dict_get(ist->opts, "threads", NULL, 0))
13721372 av_dict_set(&ist->opts, "threads", "auto", 0);
13731373 if ((ret = avcodec_open2(ist->st->codec, codec, &ist->opts)) < 0) {
1374+ char errbuf[128];
13741375 if (ret == AVERROR_EXPERIMENTAL)
13751376 abort_codec_experimental(codec, 0);
1376− snprintf(error, error_len, "Error while opening decoder for input stream #%d:%d",
1377− ist->file_index, ist->st->index);
1377+
1378+ av_strerror(ret, errbuf, sizeof(errbuf));
1379+
1380+ snprintf(error, error_len,
1381+ "Error while opening decoder for input stream "
1382+ "#%d:%d : %s",
1383+ ist->file_index, ist->st->index, errbuf);
13781384 return ret;
13791385 }
13801386 assert_avoptions(ist->opts);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t