AVFormatContext *avFormatCtx;
AVCodecContext *avCodecCtx;
AVFrame *avFrame;
+ AVPacket avPacket;
AVAudioResampleContext *avr;
smpl_t *output;
uint_t read_samples;
AVFormatContext *avFormatCtx = s->avFormatCtx;
AVCodecContext *avCodecCtx = s->avCodecCtx;
AVFrame *avFrame = s->avFrame;
- AVPacket avPacket;
+ AVPacket avPacket = s->avPacket;
av_init_packet (&avPacket);
AVAudioResampleContext *avr = s->avr;
smpl_t *output = s->output;
avformat_free_context(s->avFormatCtx);
s->avFormatCtx = NULL;
}
+#if FF_API_LAVF_AVCTX
+ av_packet_unref(&s->avPacket);
+#else
+ av_free_packet(&s->avPacket);
+#endif
return AUBIO_OK;
}