]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mlpenc: remove delay codec capability
authorJames Almer <jamrial@gmail.com>
Wed, 24 Jun 2020 03:28:14 +0000 (00:28 -0300)
committerJames Almer <jamrial@gmail.com>
Wed, 1 Jul 2020 03:23:02 +0000 (00:23 -0300)
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>
libavcodec/mlpenc.c

index c6a7963c2223c4d654e12f8625bc1078b297d30f..f99d2f5d6fe6d3592fc279681551aa98ac96d285 100644 (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},