]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/apedec.c
Windows Televison (WTV) demuxer
[ffmpeg] / libavcodec / apedec.c
index a90a07fa7deff206fa91344428e8a4a4ac27cf37..497595463b3d523d6461a0d92a17e9d771937988 100644 (file)
@@ -198,7 +198,7 @@ static av_cold int ape_decode_init(AVCodecContext * avctx)
     }
 
     dsputil_init(&s->dsp, avctx);
-    avctx->sample_fmt = SAMPLE_FMT_S16;
+    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
     avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
     return 0;
 }
@@ -877,6 +877,12 @@ static int ape_decode_frame(AVCodecContext * avctx,
     return bytes_used;
 }
 
+static void ape_flush(AVCodecContext *avctx)
+{
+    APEContext *s = avctx->priv_data;
+    s->samples= 0;
+}
+
 AVCodec ape_decoder = {
     "ape",
     AVMEDIA_TYPE_AUDIO,
@@ -887,5 +893,6 @@ AVCodec ape_decoder = {
     ape_decode_close,
     ape_decode_frame,
     .capabilities = CODEC_CAP_SUBFRAMES,
+    .flush = ape_flush,
     .long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
 };