Commit f53525d2 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by Michael Niedermayer

avformat/aiffenc: Use better error codes

Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent c36eae65
...@@ -122,7 +122,7 @@ static int aiff_write_header(AVFormatContext *s) ...@@ -122,7 +122,7 @@ static int aiff_write_header(AVFormatContext *s)
/* First verify if format is ok */ /* First verify if format is ok */
if (!par->codec_tag) if (!par->codec_tag)
return -1; return AVERROR(EINVAL);
if (par->codec_tag != MKTAG('N','O','N','E')) if (par->codec_tag != MKTAG('N','O','N','E'))
aifc = 1; aifc = 1;
...@@ -135,7 +135,7 @@ static int aiff_write_header(AVFormatContext *s) ...@@ -135,7 +135,7 @@ static int aiff_write_header(AVFormatContext *s)
if (aifc) { // compressed audio if (aifc) { // compressed audio
if (!par->block_align) { if (!par->block_align) {
av_log(s, AV_LOG_ERROR, "block align not set\n"); av_log(s, AV_LOG_ERROR, "block align not set\n");
return -1; return AVERROR(EINVAL);
} }
/* Version chunk */ /* Version chunk */
ffio_wfourcc(pb, "FVER"); ffio_wfourcc(pb, "FVER");
...@@ -166,7 +166,7 @@ static int aiff_write_header(AVFormatContext *s) ...@@ -166,7 +166,7 @@ static int aiff_write_header(AVFormatContext *s)
par->bits_per_coded_sample = av_get_bits_per_sample(par->codec_id); par->bits_per_coded_sample = av_get_bits_per_sample(par->codec_id);
if (!par->bits_per_coded_sample) { if (!par->bits_per_coded_sample) {
av_log(s, AV_LOG_ERROR, "could not compute bits per sample\n"); av_log(s, AV_LOG_ERROR, "could not compute bits per sample\n");
return -1; return AVERROR(EINVAL);
} }
if (!par->block_align) if (!par->block_align)
par->block_align = (par->bits_per_coded_sample * par->channels) >> 3; par->block_align = (par->bits_per_coded_sample * par->channels) >> 3;
......
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