summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_wav.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_wav.c')
-rw-r--r--src/demuxers/demux_wav.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c
index e23f43aa5..1e46d8526 100644
--- a/src/demuxers/demux_wav.c
+++ b/src/demuxers/demux_wav.c
@@ -22,7 +22,7 @@
* MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net)
* based on WAV specs that are available far and wide
*
- * $Id: demux_wav.c,v 1.63 2005/06/04 20:29:16 jstembridge Exp $
+ * $Id: demux_wav.c,v 1.65 2007/03/17 20:57:04 dgp85 Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -86,18 +86,7 @@ static int open_wav_file(demux_wav_t *this) {
if (_x_demux_read_header(this->input, signature, WAV_SIGNATURE_SIZE) != WAV_SIGNATURE_SIZE)
return 0;
- if ((signature[0] != 'R') ||
- (signature[1] != 'I') ||
- (signature[2] != 'F') ||
- (signature[3] != 'F') ||
- (signature[8] != 'W') ||
- (signature[9] != 'A') ||
- (signature[10] != 'V') ||
- (signature[11] != 'E') ||
- (signature[12] != 'f') ||
- (signature[13] != 'm') ||
- (signature[14] != 't') ||
- (signature[15] != ' '))
+ if (memcmp(signature, "RIFF", 4) || memcmp(&signature[8], "WAVEfmt ", 8) )
return 0;
/* file is qualified; skip over the header bytes in the stream */
@@ -108,7 +97,7 @@ static int open_wav_file(demux_wav_t *this) {
(unsigned char *)&this->wave_size, 4) != 4)
return 0;
this->wave_size = le2me_32(this->wave_size);
- this->wave = (xine_waveformatex *) malloc( this->wave_size );
+ this->wave = xine_xmalloc( this->wave_size );
if (this->input->read(this->input, (void *)this->wave, this->wave_size) !=
this->wave_size) {
@@ -365,7 +354,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
case METHOD_BY_EXTENSION: {
- char *extensions, *mrl;
+ const char *extensions, *mrl;
mrl = input->get_mrl (input);
extensions = class_gen->get_extensions (class_gen);
@@ -404,19 +393,19 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static char *get_description (demux_class_t *this_gen) {
+static const char *get_description (demux_class_t *this_gen) {
return "WAV file demux plugin";
}
-static char *get_identifier (demux_class_t *this_gen) {
+static const char *get_identifier (demux_class_t *this_gen) {
return "WAV";
}
-static char *get_extensions (demux_class_t *this_gen) {
+static const char *get_extensions (demux_class_t *this_gen) {
return "wav";
}
-static char *get_mimetypes (demux_class_t *this_gen) {
+static const char *get_mimetypes (demux_class_t *this_gen) {
return "audio/x-wav: wav: WAV audio;"
"audio/wav: wav: WAV audio;"
"audio/x-pn-wav: wav: WAV audio;"