summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_mpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_mpeg.c')
-rw-r--r--src/demuxers/demux_mpeg.c70
1 files changed, 17 insertions, 53 deletions
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index dbaae108d..a0d813db6 100644
--- a/src/demuxers/demux_mpeg.c
+++ b/src/demuxers/demux_mpeg.c
@@ -39,9 +39,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "demux.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/demux.h>
+#include <xine/xineutils.h>
#define NUM_PREVIEW_BUFFERS 150
#define SCRATCH_SIZE 256
@@ -246,6 +246,8 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
len = read_bytes(this, 2);
+ //printf( "parse_mpeg2_packet: stream_id=%X\n", stream_id);
+
if (stream_id==0xbd) {
int track;
@@ -483,7 +485,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
}
- } else if ((stream_id >= 0xbc) && ((stream_id & 0xf0) == 0xe0)) {
+ } else if ( ((stream_id >= 0xbc) && ((stream_id & 0xf0) == 0xe0)) || stream_id==0xfd ) {
w = read_bytes(this, 1);
flags = read_bytes(this, 1);
@@ -532,7 +534,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
return;
}
- buf->type = BUF_VIDEO_MPEG;
+ buf->type = (stream_id==0xfd) ? BUF_VIDEO_VC1 : BUF_VIDEO_MPEG;
buf->pts = pts;
buf->decoder_info[0] = pts - dts;
check_newpts( this, pts, PTS_VIDEO );
@@ -1054,11 +1056,6 @@ static int demux_mpeg_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_mpeg_dispose (demux_plugin_t *this_gen) {
-
- free (this_gen);
-}
-
static int demux_mpeg_get_stream_length (demux_plugin_t *this_gen) {
demux_mpeg_t *this = (demux_mpeg_t *) this_gen;
@@ -1090,7 +1087,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_mpeg_send_headers;
this->demux_plugin.send_chunk = demux_mpeg_send_chunk;
this->demux_plugin.seek = demux_mpeg_seek;
- this->demux_plugin.dispose = demux_mpeg_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_mpeg_get_status;
this->demux_plugin.get_stream_length = demux_mpeg_get_stream_length;
this->demux_plugin.get_capabilities = demux_mpeg_get_capabilities;
@@ -1212,19 +1209,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- 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;
- }
- }
- break;
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -1236,40 +1221,19 @@ 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 "MPEG program stream demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "MPEG";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mpg mpeg";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "video/mpeg: mpeg, mpg, mpe: MPEG animation;"
- "video/x-mpeg: mpeg, mpg, mpe: MPEG animation;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_mpeg_class_t *this = (demux_mpeg_class_t *) this_gen;
-
- free (this);
- }
-
static void *init_plugin (xine_t *xine, void *data) {
demux_mpeg_class_t *this;
this = calloc(1, sizeof(demux_mpeg_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_("MPEG program stream demux plugin");
+ this->demux_class.identifier = "MPEG";
+ this->demux_class.mimetypes =
+ "video/mpeg: mpeg, mpg, mpe: MPEG animation;"
+ "video/x-mpeg: mpeg, mpg, mpe: MPEG animation;";
+ this->demux_class.extensions = "mpg mpeg";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -1283,6 +1247,6 @@ static const demuxer_info_t demux_info_mpeg = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "mpeg", XINE_VERSION_CODE, &demux_info_mpeg, init_plugin },
+ { PLUGIN_DEMUX, 27, "mpeg", XINE_VERSION_CODE, &demux_info_mpeg, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};