mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-12 02:04:58 +00:00
lavf/matroskaenc: provide more feedback in case of unsupported codec
Also return meaningful error code.
This commit is contained in:
parent
f0703b6cba
commit
6b171f046c
@ -498,8 +498,9 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
|
|||||||
if (!codec->codec_tag)
|
if (!codec->codec_tag)
|
||||||
codec->codec_tag = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id);
|
codec->codec_tag = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id);
|
||||||
if (!codec->codec_tag) {
|
if (!codec->codec_tag) {
|
||||||
av_log(s, AV_LOG_ERROR, "No bmp codec ID found.\n");
|
av_log(s, AV_LOG_ERROR, "No bmp codec tag found for codec %s\n",
|
||||||
ret = -1;
|
avcodec_get_name(codec->codec_id));
|
||||||
|
ret = AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_put_bmp_header(dyn_cp, codec, ff_codec_bmp_tags, 0);
|
ff_put_bmp_header(dyn_cp, codec, ff_codec_bmp_tags, 0);
|
||||||
@ -509,8 +510,9 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
|
|||||||
unsigned int tag;
|
unsigned int tag;
|
||||||
tag = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id);
|
tag = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id);
|
||||||
if (!tag) {
|
if (!tag) {
|
||||||
av_log(s, AV_LOG_ERROR, "No wav codec ID found.\n");
|
av_log(s, AV_LOG_ERROR, "No wav codec tag found for codec %s\n",
|
||||||
ret = -1;
|
avcodec_get_name(codec->codec_id));
|
||||||
|
ret = AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
if (!codec->codec_tag)
|
if (!codec->codec_tag)
|
||||||
codec->codec_tag = tag;
|
codec->codec_tag = tag;
|
||||||
|
Loading…
Reference in New Issue
Block a user