summaryrefslogtreecommitdiff
path: root/src/libxineadec/gsm610.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libxineadec/gsm610.c')
-rw-r--r--src/libxineadec/gsm610.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c
index 23c0d2104..4ca3827d7 100644
--- a/src/libxineadec/gsm610.c
+++ b/src/libxineadec/gsm610.c
@@ -58,8 +58,8 @@
#include "xineutils.h"
#include "bswap.h"
-#include "gsm610/private.h"
-#include "gsm610/gsm.h"
+#include "private.h"
+#include "gsm.h"
#define AUDIOBUFSIZE 128*1024
@@ -83,7 +83,6 @@ typedef struct gsm610_decoder_s {
int bufsize;
int size;
- unsigned short decode_buffer[GSM610_BLOCK_SIZE];
gsm gsm_state;
} gsm610_decoder_t;
@@ -135,6 +134,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
this->size += buf->size;
if (buf->decoder_flags & BUF_FLAG_FRAME_END) { /* time to decode a frame */
+ int16_t decode_buffer[GSM610_BLOCK_SIZE];
/* handle the Microsoft variant of GSM data */
if (this->buf_type == BUF_AUDIO_MSGSM) {
@@ -151,7 +151,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
in_ptr = 0;
while (this->size) {
- gsm_decode(this->gsm_state, &this->buf[in_ptr], this->decode_buffer);
+ gsm_decode(this->gsm_state, &this->buf[in_ptr], decode_buffer);
if ((in_ptr % 65) == 0) {
in_ptr += 33;
this->size -= 33;
@@ -164,7 +164,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
* always contain at least 160 samples */
audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
- xine_fast_memcpy(audio_buffer->mem, this->decode_buffer,
+ xine_fast_memcpy(audio_buffer->mem, decode_buffer,
GSM610_BLOCK_SIZE * 2);
audio_buffer->num_frames = GSM610_BLOCK_SIZE;
@@ -186,7 +186,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
in_ptr = 0;
while (this->size) {
- gsm_decode(this->gsm_state, &this->buf[in_ptr], this->decode_buffer);
+ gsm_decode(this->gsm_state, &this->buf[in_ptr], decode_buffer);
in_ptr += 33;
this->size -= 33;
@@ -194,7 +194,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
* always contain at least 160 samples */
audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
- xine_fast_memcpy(audio_buffer->mem, this->decode_buffer,
+ xine_fast_memcpy(audio_buffer->mem, decode_buffer,
GSM610_BLOCK_SIZE * 2);
audio_buffer->num_frames = GSM610_BLOCK_SIZE;
@@ -249,18 +249,6 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
return &this->audio_decoder;
}
-static char *get_identifier (audio_decoder_class_t *this) {
- return "GSM 6.10";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "GSM 6.10 audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
gsm610_class_t *this ;
@@ -268,9 +256,9 @@ static void *init_plugin (xine_t *xine, void *data) {
this = (gsm610_class_t *) xine_xmalloc (sizeof (gsm610_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 = "GSM 6.10";
+ this->decoder_class.description = N_("GSM 6.10 audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
return this;
}
@@ -288,6 +276,6 @@ static const decoder_info_t dec_info_audio = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_DECODER, 15, "gsm610", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
+ { PLUGIN_AUDIO_DECODER, 16, "gsm610", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};