mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
mpegaudioenc: return AVERROR codes instead of -1
This commit is contained in:
parent
7a8cbb39f6
commit
be60eec668
@ -75,7 +75,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
if (channels <= 0 || channels > 2){
|
if (channels <= 0 || channels > 2){
|
||||||
av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed in mp2\n", channels);
|
av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed in mp2\n", channels);
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
bitrate = bitrate / 1000;
|
bitrate = bitrate / 1000;
|
||||||
s->nb_channels = channels;
|
s->nb_channels = channels;
|
||||||
@ -93,7 +93,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
if (i == 3){
|
if (i == 3){
|
||||||
av_log(avctx, AV_LOG_ERROR, "Sampling rate %d is not allowed in mp2\n", freq);
|
av_log(avctx, AV_LOG_ERROR, "Sampling rate %d is not allowed in mp2\n", freq);
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
s->freq_index = i;
|
s->freq_index = i;
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
if (i == 15){
|
if (i == 15){
|
||||||
av_log(avctx, AV_LOG_ERROR, "bitrate %d is not allowed in mp2\n", bitrate);
|
av_log(avctx, AV_LOG_ERROR, "bitrate %d is not allowed in mp2\n", bitrate);
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
s->bitrate_index = i;
|
s->bitrate_index = i;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user