diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2011-10-06 18:51:57 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2011-10-06 18:51:57 +0100 |
commit | f207b22c6efa7267b476339d52056e27f1ef930c (patch) | |
tree | c43ae006a2c28ab422bdc6351c81bf13c3dd54c8 /src | |
parent | e4b75132a31fef25960ea7abbf5dace418b1fc37 (diff) | |
parent | ed405d729443f414faa9e92094a23bad236ae9c6 (diff) | |
download | xine-lib-f207b22c6efa7267b476339d52056e27f1ef930c.tar.gz xine-lib-f207b22c6efa7267b476339d52056e27f1ef930c.tar.bz2 |
Merge from 1.1.
--HG--
rename : src/xine-utils/attributes.h => include/xine/attributes.h
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_ts.c | 67 | ||||
-rw-r--r-- | src/xine-engine/xine_private.h | 14 |
2 files changed, 58 insertions, 23 deletions
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index af933aeff..ec5e638cf 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -340,6 +340,11 @@ typedef struct { int rate; int media_num; demux_ts_media media[MAX_PIDS]; + + /* PAT */ + uint32_t last_pat_crc; + uint32_t transport_stream_id; + /* programs */ uint32_t program_number[MAX_PMTS]; uint32_t pmt_pid[MAX_PMTS]; uint8_t *pmt[MAX_PMTS]; @@ -621,6 +626,20 @@ static void demux_ts_parse_pat (demux_ts_t*this, unsigned char *original_pkt, } #endif + if (crc32 == this->last_pat_crc && + this->transport_stream_id == transport_stream_id) { + lprintf("demux_ts: PAT CRC unchanged\n"); + return; + } + + if (this->transport_stream_id != transport_stream_id) { + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + "demux_ts: PAT transport_stream_id changed\n"); + } + + this->last_pat_crc = crc32; + this->transport_stream_id = transport_stream_id; + /* * Process all programs in the program loop. */ @@ -1944,36 +1963,34 @@ static void demux_ts_parse_packet (demux_ts_t*this) { return; } - data_len = PKT_SIZE - data_offset; + /* PAT */ + if (pid == 0) { + demux_ts_parse_pat(this, originalPkt, originalPkt+data_offset-4, + payload_unit_start_indicator); + return; + } - /* - * audio/video pid auto-detection, if necessary - */ - program_count=0; - if(this->media_num<MAX_PMTS) - while ((this->program_number[program_count] != INVALID_PROGRAM) && - (program_count < MAX_PMTS)) { - if (pid == this->pmt_pid[program_count]) { + /* PMT */ + program_count=0; + while ((this->program_number[program_count] != INVALID_PROGRAM) && + (program_count < MAX_PMTS)) { + if (pid == this->pmt_pid[program_count]) { #ifdef TS_LOG - printf ("demux_ts: PMT prog: 0x%.4x pid: 0x%.4x\n", - this->program_number[program_count], - this->pmt_pid[program_count]); + printf ("demux_ts: PMT prog: 0x%.4x pid: 0x%.4x\n", + this->program_number[program_count], + this->pmt_pid[program_count]); #endif - demux_ts_parse_pmt (this, originalPkt, originalPkt+data_offset-4, - payload_unit_start_indicator, - program_count); - return; - } - program_count++; + demux_ts_parse_pmt (this, originalPkt, originalPkt+data_offset-4, + payload_unit_start_indicator, + program_count); + return; } - - if (payload_unit_start_indicator && (this->media_num < MAX_PIDS) && (pid == 0)) { - demux_ts_parse_pat(this, originalPkt, originalPkt+data_offset-4, - payload_unit_start_indicator); - return; + program_count++; } + data_len = PKT_SIZE - data_offset; + if (data_len > PKT_SIZE) { xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, @@ -2336,6 +2353,10 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, /* * Initialise our specialised data. */ + + this->last_pat_crc = 0; + this->transport_stream_id = -1; + for (i = 0; i < MAX_PIDS; i++) { this->media[i].pid = INVALID_PID; this->media[i].buf = NULL; diff --git a/src/xine-engine/xine_private.h b/src/xine-engine/xine_private.h index a82f6a05f..f1e94cd56 100644 --- a/src/xine-engine/xine_private.h +++ b/src/xine-engine/xine_private.h @@ -29,15 +29,25 @@ #ifndef XINE_PRIVATE_H__ #define XINE_PRIVATE_H__ +#ifndef XINE_LIBRARY_COMPILE +# error xine_private.h is for libxine's private use only! +#endif + #include <config.h> #include <xine/xine_internal.h> #if SUPPORT_ATTRIBUTE_VISIBILITY_INTERNAL # define INTERNAL __attribute__((visibility("internal"))) +#elif SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT +# define INTERNAL __attribute__((__visibility__("default"))) #else # define INTERNAL #endif +#ifdef __cplusplus +extern "C" { +#endif + /** * @defgroup load_plugins Plugins loading * @brief Functions related with plugins loading. @@ -101,4 +111,8 @@ int _x_set_file_close_on_exec(int fd) INTERNAL; int _x_set_socket_close_on_exec(int s) INTERNAL; +#ifdef __cplusplus +} +#endif + #endif |