avcodec/mlpenc: remove delay codec capability

The encoder has no delayed packets at the end of the encoding
process, so signaling this capability is unnecessary.

This also fixes an assertion failure introduced in 827d6fe73d, as
return values higher than 0 are not expected.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2020-06-24 00:28:14 -03:00
parent 6b57d4d9eb
commit 14f919515d

View File

@@ -2226,9 +2226,6 @@ static int mlp_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if ((ret = ff_alloc_packet2(avctx, avpkt, 87500 * avctx->channels, 0)) < 0)
return ret;
if (!frame)
return 1;
/* add current frame to queue */
if ((ret = ff_af_queue_add(&ctx->afq, frame)) < 0)
return ret;
@@ -2389,7 +2386,7 @@ AVCodec ff_mlp_encoder = {
.init = mlp_encode_init,
.encode2 = mlp_encode_frame,
.close = mlp_encode_close,
.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL,
.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_EXPERIMENTAL,
.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE},
.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0},
.channel_layouts = ff_mlp_channel_layouts,
@@ -2405,7 +2402,7 @@ AVCodec ff_truehd_encoder = {
.init = mlp_encode_init,
.encode2 = mlp_encode_frame,
.close = mlp_encode_close,
.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL,
.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_EXPERIMENTAL,
.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE},
.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0},
.channel_layouts = (const uint64_t[]) {AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_5POINT1_BACK, 0},