diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2009-04-06 00:28:05 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2009-04-06 00:28:05 +0100 |
commit | 317aec21b9ccbbc288eb428e1d74a51723a2b953 (patch) | |
tree | d984ce931c951d89d9ed4b2cd3ef0dc03cd1a786 /src/demuxers | |
parent | 699f3239e00a5ff922cf52a22389be0d2fb86bd7 (diff) | |
parent | a6bc7ed17d202107208bbe637ca92d5886c3d686 (diff) | |
download | xine-lib-317aec21b9ccbbc288eb428e1d74a51723a2b953.tar.gz xine-lib-317aec21b9ccbbc288eb428e1d74a51723a2b953.tar.bz2 |
Merge from 1.1.
Diffstat (limited to 'src/demuxers')
-rw-r--r-- | src/demuxers/demux_matroska.c | 36 | ||||
-rw-r--r-- | src/demuxers/demux_mod.c | 10 | ||||
-rw-r--r-- | src/demuxers/id3.c | 9 | ||||
-rw-r--r-- | src/demuxers/matroska.h | 1 |
4 files changed, 46 insertions, 10 deletions
diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index bdc30df30..829581925 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -2064,6 +2064,31 @@ static int parse_block (demux_matroska_t *this, size_t block_size, return 1; } +static int parse_simpleblock(demux_matroska_t *this, size_t block_len, uint64_t cluster_timecode, uint64_t block_duration) +{ + int has_block = 0; + off_t block_pos = 0; + off_t file_len = 0; + int normpos = 0; + int is_key = 1; + + lprintf("simpleblock\n"); + block_pos = this->input->get_current_pos(this->input); + file_len = this->input->get_length(this->input); + if( file_len ) + normpos = (int) ( (double) block_pos * 65535 / file_len ); + + if (!read_block_data(this, block_len)) + return 0; + + has_block = 1; + /* we have the duration, we can parse the block now */ + if (!parse_block(this, block_len, cluster_timecode, block_duration, + normpos, is_key)) + return 0; + return 1; +} + static int parse_block_group(demux_matroska_t *this, uint64_t cluster_timecode, uint64_t cluster_duration) { @@ -2128,7 +2153,8 @@ static int parse_block_group(demux_matroska_t *this, static int parse_cluster(demux_matroska_t *this) { ebml_parser_t *ebml = this->ebml; - int next_level = 2; + int this_level = ebml->level; + int next_level = this_level; uint64_t timecode = 0; uint64_t duration = 0; @@ -2145,7 +2171,7 @@ static int parse_cluster(demux_matroska_t *this) { this->first_cluster_found = 1; } - while (next_level == 2) { + while (next_level == this_level) { ebml_elem_t elem; if (!ebml_read_elem_head(ebml, &elem)) @@ -2169,6 +2195,11 @@ static int parse_cluster(demux_matroska_t *this) { if ((elem.len > 0) && !parse_block_group(this, timecode, duration)) return 0; break; + case MATROSKA_ID_CL_SIMPLEBLOCK: + lprintf("simpleblock\n"); + if (!parse_simpleblock(this, elem.len, timecode, duration)) + return 0; + break; case MATROSKA_ID_CL_BLOCK: lprintf("block\n"); if (!ebml_skip(ebml, &elem)) @@ -2315,6 +2346,7 @@ static int parse_top_level_head(demux_matroska_t *this, int *next_level) { ebml_elem_t elem; int ret_value = 1; off_t current_pos; + current_pos = this->input->get_current_pos(this->input); lprintf("current_pos: %" PRIdMAX "\n", (intmax_t)current_pos); diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c index e8199be0e..cd55f6781 100644 --- a/src/demuxers/demux_mod.c +++ b/src/demuxers/demux_mod.c @@ -366,11 +366,11 @@ static void *demux_mod_init_plugin (xine_t *xine, void *data) { "audio/x-s3m: s3m: ScreamTracker 3 Module;" "audio/s3m: s3m: ScreamTracker 3 Module;" "application/playerpro: 669: 669 Tracker Module;" - "application/adrift; amf: ADRIFT Module File;" - "audio/med; med; Amiga MED/OctaMED Tracker Module Sound File;" - "audio/x-amf; amf: ADRIFT Module File;" - "audio/x-xm; xm: FastTracker II Audio;" - "audio/xm; xm: FastTracker II Audio;"; + "application/adrift: amf: ADRIFT Module File;" + "audio/med: med: Amiga MED/OctaMED Tracker Module Sound File;" + "audio/x-amf: amf: ADRIFT Module File;" + "audio/x-xm: xm: FastTracker II Audio;" + "audio/xm: xm: FastTracker II Audio;"; this->demux_class.extensions = "mod it stm s3m 669 amf med mdl xm"; this->demux_class.dispose = default_demux_class_dispose; diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c index ab15184af..1919239e6 100644 --- a/src/demuxers/id3.c +++ b/src/demuxers/id3.c @@ -273,11 +273,12 @@ static int id3v22_parse_frame_header(input_plugin_t *input, static int id3v22_interp_frame(input_plugin_t *input, xine_stream_t *stream, id3v22_frame_header_t *frame_header) { - char buf[frame_header->size + 1]; + char buf[frame_header->size + 2]; int enc; if (input->read (input, buf, frame_header->size) == frame_header->size) { buf[frame_header->size] = 0; + buf[frame_header->size + 1] = 0; enc = buf[0]; if( enc >= ID3_ENCODING_COUNT ) enc = 0; @@ -459,11 +460,12 @@ static int id3v23_parse_frame_ext_header(input_plugin_t *input, static int id3v23_interp_frame(input_plugin_t *input, xine_stream_t *stream, id3v23_frame_header_t *frame_header) { - char buf[frame_header->size + 1]; + char buf[frame_header->size + 2]; int enc; if (input->read (input, buf, frame_header->size) == frame_header->size) { buf[frame_header->size] = 0; + buf[frame_header->size + 1] = 0; enc = buf[0]; if( enc >= ID3_ENCODING_COUNT ) enc = 0; @@ -702,11 +704,12 @@ static int id3v24_parse_ext_header(input_plugin_t *input, static int id3v24_interp_frame(input_plugin_t *input, xine_stream_t *stream, id3v24_frame_header_t *frame_header) { - char buf[frame_header->size + 1]; + char buf[frame_header->size + 2]; int enc; if (input->read (input, buf, frame_header->size) == frame_header->size) { buf[frame_header->size] = 0; + buf[frame_header->size + 1] = 0; enc = buf[0]; if( enc >= ID3_ENCODING_COUNT ) enc = 0; diff --git a/src/demuxers/matroska.h b/src/demuxers/matroska.h index 387205723..50583df9c 100644 --- a/src/demuxers/matroska.h +++ b/src/demuxers/matroska.h @@ -62,6 +62,7 @@ #define MATROSKA_ID_CL_BLOCKGROUP 0xA0 #define MATROSKA_ID_CL_BLOCK 0xA1 #define MATROSKA_ID_CL_BLOCKVIRTUAL 0xA2 +#define MATROSKA_ID_CL_SIMPLEBLOCK 0xA3 #define MATROSKA_ID_CL_BLOCKADDITIONS 0x75A1 #define MATROSKA_ID_CL_BLOCKMORE 0xA6 #define MATROSKA_ID_CL_BLOCKADDID 0xEE |