summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_vox.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_vox.c')
-rw-r--r--src/demuxers/demux_vox.c68
1 files changed, 24 insertions, 44 deletions
diff --git a/src/demuxers/demux_vox.c b/src/demuxers/demux_vox.c
index 480ef3042..4b6b4aad7 100644
--- a/src/demuxers/demux_vox.c
+++ b/src/demuxers/demux_vox.c
@@ -16,11 +16,13 @@
* 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
- *
+ */
+
+/*
* VOX Demuxer by Mike Melanson (melanson@pcisys.net)
* This a demuxer for .vox files containing raw Dialogic ADPCM data.
*
- * $Id: demux_vox.c,v 1.4 2003/04/17 19:01:32 miguelfreitas Exp $
+ * $Id: demux_vox.c,v 1.5 2003/07/04 15:12:51 andruil Exp $
*
*/
@@ -44,31 +46,17 @@
#define DIALOGIC_SAMPLERATE 8000
typedef struct {
-
demux_plugin_t demux_plugin;
xine_stream_t *stream;
-
- config_values_t *config;
-
fifo_buffer_t *video_fifo;
fifo_buffer_t *audio_fifo;
-
input_plugin_t *input;
-
int status;
-
- char last_mrl[1024];
} demux_vox_t;
typedef struct {
-
demux_class_t demux_class;
-
- /* class-wide, global variables here */
-
- xine_t *xine;
- config_values_t *config;
} demux_vox_class_t;
static int demux_vox_send_chunk (demux_plugin_t *this_gen) {
@@ -196,29 +184,10 @@ static int demux_vox_get_optional_data(demux_plugin_t *this_gen,
}
static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *stream,
- input_plugin_t *input_gen) {
+ input_plugin_t *input) {
- input_plugin_t *input = (input_plugin_t *) input_gen;
demux_vox_t *this;
- this = xine_xmalloc (sizeof (demux_vox_t));
- this->stream = stream;
- this->input = input;
-
- this->demux_plugin.send_headers = demux_vox_send_headers;
- this->demux_plugin.send_chunk = demux_vox_send_chunk;
- this->demux_plugin.seek = demux_vox_seek;
- this->demux_plugin.dispose = demux_vox_dispose;
- this->demux_plugin.get_status = demux_vox_get_status;
- this->demux_plugin.get_stream_length = demux_vox_get_stream_length;
- this->demux_plugin.get_video_frame = NULL;
- this->demux_plugin.got_video_frame_cb= NULL;
- this->demux_plugin.get_capabilities = demux_vox_get_capabilities;
- this->demux_plugin.get_optional_data = demux_vox_get_optional_data;
- this->demux_plugin.demux_class = class_gen;
-
- this->status = DEMUX_FINISHED;
-
switch (stream->content_detection_method) {
case METHOD_BY_CONTENT:
@@ -229,19 +198,32 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
mrl = input->get_mrl (input);
extensions = class_gen->get_extensions (class_gen);
- if (!xine_demux_check_extension (mrl, extensions)) {
- free (this);
+ if (!xine_demux_check_extension (mrl, extensions))
return NULL;
- }
}
break;
default:
- free (this);
return NULL;
}
- strncpy (this->last_mrl, input->get_mrl (input), 1024);
+ this = xine_xmalloc (sizeof (demux_vox_t));
+ this->stream = stream;
+ this->input = input;
+
+ this->demux_plugin.send_headers = demux_vox_send_headers;
+ this->demux_plugin.send_chunk = demux_vox_send_chunk;
+ this->demux_plugin.seek = demux_vox_seek;
+ this->demux_plugin.dispose = demux_vox_dispose;
+ this->demux_plugin.get_status = demux_vox_get_status;
+ this->demux_plugin.get_stream_length = demux_vox_get_stream_length;
+ this->demux_plugin.get_video_frame = NULL;
+ this->demux_plugin.got_video_frame_cb= NULL;
+ this->demux_plugin.get_capabilities = demux_vox_get_capabilities;
+ this->demux_plugin.get_optional_data = demux_vox_get_optional_data;
+ this->demux_plugin.demux_class = class_gen;
+
+ this->status = DEMUX_FINISHED;
return &this->demux_plugin;
}
@@ -273,9 +255,7 @@ void *demux_vox_init_plugin (xine_t *xine, void *data) {
demux_vox_class_t *this;
- this = xine_xmalloc (sizeof (demux_vox_class_t));
- this->config = xine->config;
- this->xine = xine;
+ this = xine_xmalloc (sizeof (demux_vox_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;