|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
[PATCH] Adding m2ts supportThis patch try to add support for m2ts format.
m2ts is like ts format but with 192 size packets instead of 188. This patch work with m2ts files from a Blu ray. Jose Alberto [demux_ts.patch] Index: src/demuxers/demux_ts.c =================================================================== --- src/demuxers/demux_ts.c (revisión: 261) +++ src/demuxers/demux_ts.c (copia de trabajo) @@ -164,17 +164,18 @@ * The maximum number of PIDs we are prepared to handle in a single program * is the number that fits in a single-packet PMT. */ -#define PKT_SIZE 188 -#define BODY_SIZE (188 - 4) +static int pkt_size = 192; +#define PKT_SIZE pkt_size +#define BODY_SIZE (pkt_size - 4) /* more PIDS are needed due "auto-detection". 40 spare media entries */ -#define MAX_PIDS ((BODY_SIZE - 1 - 13) / 4) + 40 -#define MAX_PMTS ((BODY_SIZE - 1 - 13) / 4) + 10 +#define MAX_PIDS ((192 - 4 - 1 - 13) / 4) + 40 +#define MAX_PMTS (((192 - 4 - 1 - 13) / 4) + 10) * 2 #define SYNC_BYTE 0x47 #define MIN_SYNCS 3 #define NPKT_PER_READ 100 -#define BUF_SIZE (NPKT_PER_READ * PKT_SIZE) +#define BUF_SIZE (NPKT_PER_READ * 192) #define MAX_PES_BUF_SIZE 2048 @@ -741,7 +742,7 @@ p += header_len + 9; packet_len -= header_len + 3; - if (stream_id == 0xbd) { + if ((stream_id == 0xbd) || (stream_id == 0xfd)) { int spu_id; @@ -1178,7 +1179,7 @@ count=ts_payloadsize(originalPkt); - ptr = originalPkt+offset+(PKT_SIZE-count); + ptr = originalPkt+offset+(188-count); len = count-offset; memcpy (this->pmt_write_ptr[program_count], ptr, len); this->pmt_write_ptr[program_count] +=len; @@ -1447,7 +1448,7 @@ demux_ts_get_reg_desc(this, &format_identifier, stream + 5, stream_info_length); /* If no format identifier, assume A52 */ - if ((format_identifier == 0x41432d33) || (format_identifier == 0)) { + if (format_identifier == 0x41432d33) { demux_ts_pes_new(this, this->media_num, pid, this->audio_fifo, stream[0]); this->audio_tracks[this->audio_tracks_count].pid = pid; this->audio_tracks[this->audio_tracks_count].media_index = this->media_num; @@ -1804,7 +1805,7 @@ return; } - data_len = PKT_SIZE - data_offset; + data_len = 188 - data_offset; /* * audio/video pid auto-detection, if necessary @@ -1893,7 +1894,7 @@ } } - if (data_len > PKT_SIZE) { + if (data_len > 188) { xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_ts: demux error! invalid payload size %d\n", data_len); @@ -2204,11 +2205,31 @@ printf ("demux_ts: found 0x47 pattern at offset %d\n", i); #endif ts_detected = 1; + pkt_size = 188; } } } if (!ts_detected) + for (i = 0; i < 192; i++) { + try_again = 0; + if (buf[i] == 0x47) { + for (j = 1; j <= 10; j++) { + if (buf[i + j*192] != 0x47) { + try_again = 1; + break; + } + } + if (try_again == 0) { +#ifdef TS_LOG + printf ("demux_ts: found 0x47 pattern at offset %d\n", i); +#endif + ts_detected = 1; + pkt_size = 192; + } + } + } + if (!ts_detected) return NULL; } break; ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ xine-devel mailing list xine-devel@... https://lists.sourceforge.net/lists/listinfo/xine-devel |
| Free embeddable forum powered by Nabble | Forum Help |