diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-05-07 09:20:32 +0400 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 15:42:42 +0300 |
commit | 5359381864b57967341774cbaea896b20b946c84 (patch) | |
tree | b848491695fe48df15a861b12f817bd5b5773f23 /libavcodec/libgsmenc.c | |
parent | 06ed1927b11be71bf6a9946ea8b2964cdd914d45 (diff) |
libgsm: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/libgsmenc.c')
-rw-r--r-- | libavcodec/libgsmenc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/libgsmenc.c b/libavcodec/libgsmenc.c index a2f6c1c62e..4f473b7cd3 100644 --- a/libavcodec/libgsmenc.c +++ b/libavcodec/libgsmenc.c @@ -49,12 +49,6 @@ static av_cold int libgsm_encode_close(AVCodecContext *avctx) { } static av_cold int libgsm_encode_init(AVCodecContext *avctx) { - if (avctx->channels > 1) { - av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n", - avctx->channels); - return -1; - } - if (avctx->sample_rate != 8000) { av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n", avctx->sample_rate); @@ -132,7 +126,10 @@ const AVCodec ff_libgsm_encoder = { .encode2 = libgsm_encode_frame, .close = libgsm_encode_close, .defaults = libgsm_defaults, +#if FF_API_OLD_CHANNEL_LAYOUT .channel_layouts= (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, +#endif + .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .wrapper_name = "libgsm", @@ -149,7 +146,10 @@ const AVCodec ff_libgsm_ms_encoder = { .encode2 = libgsm_encode_frame, .close = libgsm_encode_close, .defaults = libgsm_defaults, +#if FF_API_OLD_CHANNEL_LAYOUT .channel_layouts= (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, +#endif + .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .wrapper_name = "libgsm", |