aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-04-29 17:01:17 +0200
committerAnton Khirnov <anton@khirnov.net>2014-05-18 20:33:38 +0200
commitd246231e4714119faac6c7acd881d3b687bb8b11 (patch)
treea91d317b07d5a7eef7523c60fb1b90f56f1250dc
parent968a62a9d9e3a785ce1f79b80facfe09c6c14544 (diff)
downloadffmpeg-d246231e4714119faac6c7acd881d3b687bb8b11.tar.gz
wavenc: use codec descriptors to get the codec name
Also, return a proper error code.
-rw-r--r--libavformat/wavenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index 86ed557802..25f6ffcde0 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -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");
+ return AVERROR(ENOSYS);
}
ff_end_tag(pb, fmt);