]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/apedec.c
arm: Add an option for making sure NEON registers aren't clobbered
[ffmpeg] / libavcodec / apedec.c
index d28e51aae6678c20d4bc7d4093ecd866108c7289..8669db880593f9c7335626d359664ba3017152c6 100644 (file)
@@ -1402,7 +1402,6 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
     int32_t *sample24;
     int i, ch, ret;
     int blockstodecode;
-    int bytes_used = 0;
 
     /* this should never be negative, but bad things will happen if it is, so
        check it just to make sure. */
@@ -1468,7 +1467,6 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
             return AVERROR_INVALIDDATA;
         }
 
-        bytes_used = avpkt->size;
     }
 
     if (!s->data) {
@@ -1540,7 +1538,7 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
 
     *got_frame_ptr = 1;
 
-    return bytes_used;
+    return (s->samples == 0) ? avpkt->size : 0;
 }
 
 static void ape_flush(AVCodecContext *avctx)
@@ -1566,6 +1564,7 @@ static const AVClass ape_decoder_class = {
 
 AVCodec ff_ape_decoder = {
     .name           = "ape",
+    .long_name      = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
     .type           = AVMEDIA_TYPE_AUDIO,
     .id             = AV_CODEC_ID_APE,
     .priv_data_size = sizeof(APEContext),
@@ -1574,7 +1573,6 @@ AVCodec ff_ape_decoder = {
     .decode         = ape_decode_frame,
     .capabilities   = CODEC_CAP_SUBFRAMES | CODEC_CAP_DELAY | CODEC_CAP_DR1,
     .flush          = ape_flush,
-    .long_name      = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
     .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
                                                       AV_SAMPLE_FMT_S16P,
                                                       AV_SAMPLE_FMT_S32P,