mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
wavenc: use codec descriptors to get the codec name
Also, return a proper error code.
This commit is contained in:
parent
968a62a9d9
commit
d246231e47
@ -110,9 +110,10 @@ static int wav_write_header(AVFormatContext *s)
|
|||||||
/* format header */
|
/* format header */
|
||||||
fmt = ff_start_tag(pb, "fmt ");
|
fmt = ff_start_tag(pb, "fmt ");
|
||||||
if (ff_put_wav_header(pb, s->streams[0]->codec) < 0) {
|
if (ff_put_wav_header(pb, s->streams[0]->codec) < 0) {
|
||||||
|
const AVCodecDescriptor *desc = avcodec_descriptor_get(s->streams[0]->codec->codec_id);
|
||||||
av_log(s, AV_LOG_ERROR, "%s codec not supported in WAVE format\n",
|
av_log(s, AV_LOG_ERROR, "%s codec not supported in WAVE format\n",
|
||||||
s->streams[0]->codec->codec ? s->streams[0]->codec->codec->name : "NONE");
|
desc ? desc->name : "unknown");
|
||||||
return -1;
|
return AVERROR(ENOSYS);
|
||||||
}
|
}
|
||||||
ff_end_tag(pb, fmt);
|
ff_end_tag(pb, fmt);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user