summaryrefslogtreecommitdiff
path: root/src/libreal/xine_real_audio_decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libreal/xine_real_audio_decoder.c')
-rw-r--r--src/libreal/xine_real_audio_decoder.c63
1 files changed, 24 insertions, 39 deletions
diff --git a/src/libreal/xine_real_audio_decoder.c b/src/libreal/xine_real_audio_decoder.c
index d1bb94230..b9231a2b7 100644
--- a/src/libreal/xine_real_audio_decoder.c
+++ b/src/libreal/xine_real_audio_decoder.c
@@ -15,9 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- * $Id: audio_decoder.c,v 1.59 2007/03/17 15:45:41 dgp85 Exp $
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* thin layer to use real binary-only codecs in xine
*
@@ -40,10 +38,10 @@
*/
#include "bswap.h"
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
#include "real_common.h"
@@ -163,27 +161,27 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) {
* extract header data
*/
- version = BE_16 (buf->content+4);
+ version = _X_BE_16 (buf->content+4);
lprintf ("header buffer detected, header version %d\n", version);
#ifdef LOG
xine_hexdump (buf->content, buf->size);
#endif
- flavor = BE_16 (buf->content+22);
- coded_frame_size = BE_32 (buf->content+24);
- codec_data_length= BE_16 (buf->content+40);
- coded_frame_size2= BE_16 (buf->content+42);
- subpacket_size = BE_16 (buf->content+44);
+ flavor = _X_BE_16 (buf->content+22);
+ coded_frame_size = _X_BE_32 (buf->content+24);
+ codec_data_length= _X_BE_16 (buf->content+40);
+ coded_frame_size2= _X_BE_16 (buf->content+42);
+ subpacket_size = _X_BE_16 (buf->content+44);
this->sps = subpacket_size;
this->w = coded_frame_size2;
this->h = codec_data_length;
if (version == 4) {
- samples_per_sec = BE_16 (buf->content+48);
- bits_per_sample = BE_16 (buf->content+52);
- num_channels = BE_16 (buf->content+54);
+ samples_per_sec = _X_BE_16 (buf->content+48);
+ bits_per_sample = _X_BE_16 (buf->content+52);
+ num_channels = _X_BE_16 (buf->content+54);
/* FIXME: */
if (buf->type==BUF_AUDIO_COOK) {
@@ -196,10 +194,10 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) {
extras = buf->content+71;
} else {
- samples_per_sec = BE_16 (buf->content+54);
- bits_per_sample = BE_16 (buf->content+58);
- num_channels = BE_16 (buf->content+60);
- data_len = BE_32 (buf->content+74);
+ samples_per_sec = _X_BE_16 (buf->content+54);
+ bits_per_sample = _X_BE_16 (buf->content+58);
+ num_channels = _X_BE_16 (buf->content+60);
+ data_len = _X_BE_32 (buf->content+74);
extras = buf->content+78;
}
@@ -339,7 +337,7 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) {
return 0;
}
- this->stream->audio_out->open(this->stream->audio_out,
+ (this->stream->audio_out->open) (this->stream->audio_out,
this->stream,
bits_per_sample,
samples_per_sec,
@@ -352,7 +350,7 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) {
return 1;
}
-static unsigned char sipr_swaps[38][2]={
+static const unsigned char sipr_swaps[38][2]={
{0,63},{1,22},{2,44},{3,90},{5,81},{7,31},{8,86},{9,58},{10,36},{12,68},
{13,39},{14,73},{15,53},{16,69},{17,57},{19,88},{20,34},{21,71},{24,46},
{25,94},{26,54},{28,75},{29,50},{32,70},{33,92},{35,74},{38,85},{40,56},
@@ -584,19 +582,6 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
/*
* real plugin class
*/
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "realadec";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "real binary-only codec based audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
void *init_realadec (xine_t *xine, void *data) {
real_class_t *this;
@@ -605,9 +590,9 @@ void *init_realadec (xine_t *xine, void *data) {
this = (real_class_t *) xine_xmalloc (sizeof (real_class_t));
this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
+ this->decoder_class.identifier = "realadec";
+ this->decoder_class.description = N_("real binary-only codec based audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
_x_real_codecs_init(xine);
@@ -618,7 +603,7 @@ void *init_realadec (xine_t *xine, void *data) {
* exported plugin catalog entry
*/
-static uint32_t audio_types[] = {
+static const uint32_t audio_types[] = {
BUF_AUDIO_COOK, BUF_AUDIO_ATRK, /* BUF_AUDIO_14_4, BUF_AUDIO_28_8, */ BUF_AUDIO_SIPRO, 0
};