summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_roq.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_roq.c')
-rw-r--r--src/demuxers/demux_roq.c83
1 files changed, 21 insertions, 62 deletions
diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c
index 0e7c93b97..83e589be0 100644
--- a/src/demuxers/demux_roq.c
+++ b/src/demuxers/demux_roq.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
*/
/*
* RoQ File Demuxer by Mike Melanson (melanson@pcisys.net)
* For more information regarding the RoQ file format, visit:
* http://www.csse.monash.edu.au/~timf/
- *
- * $Id: demux_roq.c,v 1.54 2007/01/19 00:26:40 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"
@@ -95,8 +93,8 @@ static int open_roq_file(demux_roq_t *this) {
return 0;
/* check for the RoQ magic numbers */
- if ((LE_16(&preamble[0]) != RoQ_MAGIC_NUMBER) ||
- (LE_32(&preamble[2]) != 0xFFFFFFFF))
+ if ((_X_LE_16(&preamble[0]) != RoQ_MAGIC_NUMBER) ||
+ (_X_LE_32(&preamble[2]) != 0xFFFFFFFF))
return 0;
this->bih.biSize = sizeof(xine_bmiheader);
@@ -112,7 +110,7 @@ static int open_roq_file(demux_roq_t *this) {
*
* therefore, the frame pts increment is 90000 / fps
*/
- fps = LE_16(&preamble[6]);
+ fps = _X_LE_16(&preamble[6]);
this->frame_pts_inc = 90000 / fps;
/* iterate through the first 2 seconds worth of chunks searching for
@@ -124,16 +122,16 @@ static int open_roq_file(demux_roq_t *this) {
if (this->input->read(this->input, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
RoQ_CHUNK_PREAMBLE_SIZE)
break;
- chunk_type = LE_16(&preamble[0]);
- chunk_size = LE_32(&preamble[2]);
+ chunk_type = _X_LE_16(&preamble[0]);
+ chunk_size = _X_LE_32(&preamble[2]);
if (chunk_type == RoQ_INFO) {
/* fetch the width and height; reuse the preamble bytes */
if (this->input->read(this->input, preamble, 8) != 8)
break;
- this->bih.biWidth = LE_16(&preamble[0]);
- this->bih.biHeight = LE_16(&preamble[2]);
+ this->bih.biWidth = _X_LE_16(&preamble[0]);
+ this->bih.biHeight = _X_LE_16(&preamble[2]);
/* if an audio chunk was already found, search is done */
if (this->wave.nChannels)
@@ -188,8 +186,8 @@ static int demux_roq_send_chunk(demux_plugin_t *this_gen) {
this->status = DEMUX_FINISHED;
return this->status;
}
- chunk_type = LE_16(&preamble[0]);
- chunk_size = LE_32(&preamble[2]);
+ chunk_type = _X_LE_16(&preamble[0]);
+ chunk_size = _X_LE_32(&preamble[2]);
/* if the chunk is an audio chunk, route it to the audio fifo */
if ((chunk_type == RoQ_SOUND_MONO) || (chunk_type == RoQ_SOUND_STEREO)) {
@@ -379,11 +377,6 @@ static int demux_roq_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_roq_dispose (demux_plugin_t *this) {
-
- free(this);
-}
-
static int demux_roq_get_status (demux_plugin_t *this_gen) {
demux_roq_t *this = (demux_roq_t *) this_gen;
@@ -420,7 +413,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_roq_send_headers;
this->demux_plugin.send_chunk = demux_roq_send_chunk;
this->demux_plugin.seek = demux_roq_seek;
- this->demux_plugin.dispose = demux_roq_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_roq_get_status;
this->demux_plugin.get_stream_length = demux_roq_get_stream_length;
this->demux_plugin.get_capabilities = demux_roq_get_capabilities;
@@ -431,19 +424,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:
@@ -462,39 +443,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 "Id RoQ file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "RoQ";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "roq";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_roq_class_t *this = (demux_roq_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_roq_init_plugin (xine_t *xine, void *data) {
demux_roq_class_t *this;
this = xine_xmalloc (sizeof (demux_roq_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_("Id RoQ file demux plugin");
+ this->demux_class.identifier = "RoQ";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "roq";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}