diff -ur src/plugins/avcodec.orig/avcodec.c src/plugins/avcodec/avcodec.c
--- src/plugins/avcodec.orig/avcodec.c 2016-02-24 11:59:39.000000000 -0800
+++ src/plugins/avcodec/avcodec.c 2016-02-24 12:01:27.000000000 -0800
* Decoder plugin for ffmpeg avcodec formats
- * Copyright (C) 2006-2011 XMMS2 Team
+ * Copyright (C) 2006-2014 XMMS2 Team
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Lesser General Public License for more details.
-#include "xmms_configuration.h"
-#include "xmms/xmms_xformplugin.h"
-#include "xmms/xmms_sample.h"
-#include "xmms/xmms_log.h"
+#include <xmms_configuration.h>
+#include <xmms/xmms_xformplugin.h>
+#include <xmms/xmms_sample.h>
+#include <xmms/xmms_log.h>
+#include <libavutil/mem.h>
#include "avcodec_compat.h"
#define AVCODEC_BUFFER_SIZE 16384
-#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
AVCodecContext *codecctx;
+ AVFrame *read_out_frame;
xmms_sample_format_t sampleformat;
static gboolean xmms_avcodec_plugin_setup (xmms_xform_plugin_t *xform_plugin);
static gboolean xmms_avcodec_init (xmms_xform_t *xform);
static void xmms_avcodec_destroy (xmms_xform_t *xform);
+static gint xmms_avcodec_internal_read_some (xmms_xform_t *xform, xmms_avcodec_data_t *data, xmms_error_t *error);
+static gint xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data);
+static void xmms_avcodec_internal_append (xmms_avcodec_data_t *data);
static gint xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
static gint64 xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples,
xmms_xform_seek_mode_t whence, xmms_error_t *err);
+static xmms_sample_format_t xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format);