diff options
-rw-r--r-- | src/demuxers/demux_aiff.c | 4 | ||||
-rw-r--r-- | src/demuxers/demux_aud.c | 2 | ||||
-rw-r--r-- | src/demuxers/demux_film.c | 4 | ||||
-rw-r--r-- | src/demuxers/demux_real.c | 20 | ||||
-rw-r--r-- | src/demuxers/demux_snd.c | 4 | ||||
-rw-r--r-- | src/demuxers/demux_tta.c | 2 | ||||
-rw-r--r-- | src/demuxers/demux_vqa.c | 4 | ||||
-rw-r--r-- | src/demuxers/demux_wc3movie.c | 10 |
8 files changed, 18 insertions, 32 deletions
diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index 6f8953a90..273992f64 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -115,8 +115,8 @@ static int open_aiff_file(demux_aiff_t *this) { return 0; /* check the signature */ - if ((_X_BE_32(&signature[0]) != FORM_TAG) || - (_X_BE_32(&signature[8]) != AIFF_TAG)) + if( !_x_is_fourcc(&signature[0], "FORM") || + !_x_is_fourcc(&signature[8], "AIFF") ) return 0; /* file is qualified; skip over the header bytes in the stream */ diff --git a/src/demuxers/demux_aud.c b/src/demuxers/demux_aud.c index b99c67806..7730de1fa 100644 --- a/src/demuxers/demux_aud.c +++ b/src/demuxers/demux_aud.c @@ -143,7 +143,7 @@ static int demux_aud_send_chunk(demux_plugin_t *this_gen) { } /* validate the chunk */ - if (_X_LE_32(&chunk_preamble[4]) != 0x0000DEAF) { + if (!_x_is_fourcc(&chunk_preamble[4], "\xAF\xDE\x00\x00")) { this->status = DEMUX_FINISHED; return this->status; } diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index 27986d9e1..dcd57f76c 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -141,9 +141,9 @@ static int open_film_file(demux_film_t *film) { return 0; /* FILM signature correct? */ - if (strncmp(scratch, "FILM", 4)) { + if (!_x_is_fourcc(scratch, "FILM")) return 0; - } + llprintf(DEBUG_FILM_LOAD, "found 'FILM' signature\n"); /* file is qualified; skip over the header bytes in the stream */ diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index f258fd73a..957cd5caa 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -174,18 +174,6 @@ typedef struct { demux_class_t demux_class; } demux_real_class_t; -static int is_indx_tag(const void *ptr) { - return memcmp(ptr, "INDX", 4) == 0; -} - -static int is_data_tag(const void *ptr) { - return memcmp(ptr, "DATA", 4) == 0; -} - -static int is_rmf_tag(const void *ptr) { - return memcmp(ptr, ".RMF", 4) == 0; -} - static void real_parse_index(demux_real_t *this) { off_t next_index_chunk = this->index_start; @@ -208,7 +196,7 @@ static void real_parse_index(demux_real_t *this) { } /* Check chunk is actually an index chunk */ - if(!is_indx_tag(&index_chunk_header[0])) { + if(!_x_is_fourcc(&index_chunk_header[0], "INDX")) { lprintf("expected index chunk found chunk type: %.4s\n", &index_chunk_header[0]); break; } @@ -402,7 +390,7 @@ static void real_parse_headers (demux_real_t *this) { return; } - if ( !is_rmf_tag(signature) ) { + if ( !_x_is_fourcc(signature, ".RMF") ) { this->status = DEMUX_FINISHED; lprintf ("signature not found '%.4s'\n", signature); return; @@ -686,7 +674,7 @@ static void real_parse_headers (demux_real_t *this) { int i; /* Check for end of the data chunk */ - if (is_indx_tag(&search_buffer[offset]) || is_data_tag(&search_buffer[offset])) + if (_x_is_fourcc(&search_buffer[offset], "INDX") || _x_is_fourcc(&search_buffer[offset], "DATA")) break; const int stream = _X_BE_16(&search_buffer[offset + 4]); @@ -1058,7 +1046,7 @@ static int demux_real_send_chunk(demux_plugin_t *this_gen) { } /* Check to see if we've gone past the end of the data chunk */ - if (is_indx_tag(&header[0]) || is_data_tag(&header[0])) { + if (_x_is_fourcc(&header[0], "INDX") || _x_is_fourcc(&header[0], "DATA")) { lprintf("finished reading data chunk\n"); this->status = DEMUX_FINISHED; return this->status; diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c index 51a4315e5..b98b66758 100644 --- a/src/demuxers/demux_snd.c +++ b/src/demuxers/demux_snd.c @@ -42,8 +42,6 @@ #define SND_HEADER_SIZE 24 #define PCM_BLOCK_ALIGN 1024 -/* this is the big-endian hex value '.snd' */ -#define snd_TAG 0x2E736E64 typedef struct { demux_plugin_t demux_plugin; @@ -83,7 +81,7 @@ static int open_snd_file(demux_snd_t *this) { return 0; /* check the signature */ - if (_X_BE_32(&header[0]) != snd_TAG) + if ( !_x_is_fourcc(&header[0], ".snd") ) return 0; /* file is qualified; skip over the header bytes in the stream */ diff --git a/src/demuxers/demux_tta.c b/src/demuxers/demux_tta.c index 8e0595bda..68305a444 100644 --- a/src/demuxers/demux_tta.c +++ b/src/demuxers/demux_tta.c @@ -72,7 +72,7 @@ static int open_tta_file(demux_tta_t *this) { if (_x_demux_read_header(this->input, peek, 4) != 4) return 0; - if ( _X_BE_32(peek) != FOURCC_32('T', 'T', 'A', '1') ) + if ( !_x_is_fourcc(peek, "TTA1") ) return 0; if ( this->input->read(this->input, this->header.buffer, sizeof(this->header)) != sizeof(this->header) ) diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c index ae0fd8231..5fb8273dd 100644 --- a/src/demuxers/demux_vqa.c +++ b/src/demuxers/demux_vqa.c @@ -96,8 +96,8 @@ static int open_vqa_file(demux_vqa_t *this) { return 0; /* check for the VQA signatures */ - if ((_X_BE_32(&scratch[0]) != FORM_TAG) || - (_X_BE_32(&scratch[8]) != WVQA_TAG)) + if (!_x_is_fourcc(&scratch[0], "FORM") || + !_x_is_fourcc(&scratch[8], "WVQA") ) return 0; /* file is qualified; skip to the start of the VQA header */ diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c index 64ae431fb..7750c3e0e 100644 --- a/src/demuxers/demux_wc3movie.c +++ b/src/demuxers/demux_wc3movie.c @@ -357,9 +357,9 @@ static int open_mve_file(demux_mve_t *this) { if (_x_demux_read_header(this->input, header, WC3_HEADER_SIZE) != WC3_HEADER_SIZE) return 0; - if ((_X_BE_32(&header[0]) != FORM_TAG) || - (_X_BE_32(&header[8]) != MOVE_TAG) || - (_X_BE_32(&header[12]) != PC_TAG)) + if ( !_x_is_fourcc(&header[0], "FORM") || + !_x_is_fourcc(&header[8], "MOVE") || + !_x_is_fourcc(&header[12], "_PC_") ) return 0; /* file is qualified */ @@ -402,8 +402,8 @@ static int open_mve_file(demux_mve_t *this) { return 0; } - if ((_X_BE_32(&preamble[0]) != PALT_TAG) || - (_X_BE_32(&preamble[4]) != PALETTE_CHUNK_SIZE)) { + if ( !_x_is_fourcc(&preamble[0], "PALT") || + (_X_BE_32(&preamble[4]) != PALETTE_CHUNK_SIZE)) { xine_log(this->stream->xine, XINE_LOG_MSG, _("demux_wc3movie: There was a problem while loading palette chunks\n")); free (this->palettes); |