summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_ipmovie.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_ipmovie.c')
-rw-r--r--src/demuxers/demux_ipmovie.c82
1 files changed, 23 insertions, 59 deletions
diff --git a/src/demuxers/demux_ipmovie.c b/src/demuxers/demux_ipmovie.c
index 6fe185b1a..4d08af6fa 100644
--- a/src/demuxers/demux_ipmovie.c
+++ b/src/demuxers/demux_ipmovie.c
@@ -15,15 +15,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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*/
/*
* Interplay MVE File Demuxer by Mike Melanson (melanson@pcisys.net)
* For more information regarding the Interplay MVE file format, visit:
* http://www.pcisys.net/~melanson/codecs/
- *
- * $Id: demux_ipmovie.c,v 1.27 2007/02/20 00:34:55 dgp85 Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -42,10 +40,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -144,8 +142,8 @@ static int process_ipmovie_chunk(demux_ipmovie_t *this) {
if (this->input->read(this->input, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
CHUNK_PREAMBLE_SIZE)
return CHUNK_BAD;
- chunk_size = LE_16(&chunk_preamble[0]);
- chunk_type = LE_16(&chunk_preamble[2]);
+ chunk_size = _X_LE_16(&chunk_preamble[0]);
+ chunk_type = _X_LE_16(&chunk_preamble[2]);
lprintf("chunk type 0x%04X, 0x%04X bytes:\n", chunk_type, chunk_size);
@@ -191,7 +189,7 @@ static int process_ipmovie_chunk(demux_ipmovie_t *this) {
break;
}
- opcode_size = LE_16(&opcode_preamble[0]);
+ opcode_size = _X_LE_16(&opcode_preamble[0]);
opcode_type = opcode_preamble[2];
opcode_version = opcode_preamble[3];
@@ -228,10 +226,10 @@ static int process_ipmovie_chunk(demux_ipmovie_t *this) {
chunk_type = CHUNK_BAD;
break;
}
- this->fps = 1000000.0 / (LE_32(&scratch[0]) * LE_16(&scratch[4]));
+ this->fps = 1000000.0 / (_X_LE_32(&scratch[0]) * _X_LE_16(&scratch[4]));
this->frame_pts_inc = (int)(90000.0 / this->fps);
lprintf("%.1f frames/second (timer div = %d, subdiv = %d)\n",
- this->fps, LE_32(&scratch[0]), LE_16(&scratch[4]));
+ this->fps, _X_LE_32(&scratch[0]), _X_LE_16(&scratch[4]));
break;
case OPCODE_INIT_AUDIO_BUFFERS:
@@ -246,8 +244,8 @@ static int process_ipmovie_chunk(demux_ipmovie_t *this) {
chunk_type = CHUNK_BAD;
break;
}
- this->wave.nSamplesPerSec = LE_16(&scratch[4]);
- audio_flags = LE_16(&scratch[2]);
+ this->wave.nSamplesPerSec = _X_LE_16(&scratch[4]);
+ audio_flags = _X_LE_16(&scratch[2]);
/* bit 0 of the flags: 0 = mono, 1 = stereo */
this->wave.nChannels = (audio_flags & 1) + 1;
/* bit 1 of the flags: 0 = 8 bit, 1 = 16 bit */
@@ -282,8 +280,8 @@ static int process_ipmovie_chunk(demux_ipmovie_t *this) {
chunk_type = CHUNK_BAD;
break;
}
- this->bih.biWidth = LE_16(&scratch[0]) * 8;
- this->bih.biHeight = LE_16(&scratch[2]) * 8;
+ this->bih.biWidth = _X_LE_16(&scratch[0]) * 8;
+ this->bih.biHeight = _X_LE_16(&scratch[2]) * 8;
/* set up staging area for decode map */
this->decode_map_size = (this->bih.biWidth * this->bih.biHeight) /
(8 * 8) / 2;
@@ -392,8 +390,8 @@ static int process_ipmovie_chunk(demux_ipmovie_t *this) {
}
/* load the palette into internal data structure */
- first_color = LE_16(&scratch[0]);
- color_count = LE_16(&scratch[2]);
+ first_color = _X_LE_16(&scratch[0]);
+ color_count = _X_LE_16(&scratch[2]);
/* sanity check (since they are 16 bit values) */
if ((first_color > 0xFF) || (first_color + color_count > 0x100)) {
lprintf("set_palette indices out of range (%d -> %d)\n",
@@ -533,7 +531,7 @@ static int open_ipmovie_file(demux_ipmovie_t *this) {
IPMOVIE_SIGNATURE_SIZE)
return 0;
- if (strncmp(signature, IPMOVIE_SIGNATURE, IPMOVIE_SIGNATURE_SIZE) != 0)
+ if (memcmp(signature, IPMOVIE_SIGNATURE, IPMOVIE_SIGNATURE_SIZE) != 0)
return 0;
/* file is qualified; skip over the signature bytes (+ 6 unknown) in the stream */
@@ -692,19 +690,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: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -723,39 +709,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Interplay MVE Movie demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "Interplay MVE";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mve mv8";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_ipmovie_class_t *this = (demux_ipmovie_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_ipmovie_init_plugin (xine_t *xine, void *data) {
demux_ipmovie_class_t *this;
this = xine_xmalloc (sizeof (demux_ipmovie_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Interplay MVE Movie demux plugin");
+ this->demux_class.identifier = "Interplay MVE";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "mve mv8";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}