Commit d246231e authored by Anton Khirnov's avatar Anton Khirnov
Browse files

wavenc: use codec descriptors to get the codec name

Also, return a proper error code.
parent 968a62a9
......@@ -110,9 +110,10 @@ static int wav_write_header(AVFormatContext *s)
/* format header */
fmt = ff_start_tag(pb, "fmt ");
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",
s->streams[0]->codec->codec ? s->streams[0]->codec->codec->name : "NONE");
return -1;
desc ? desc->name : "unknown");
ff_end_tag(pb, fmt);
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