diff options
author | phintuka <phintuka> | 2009-08-25 11:14:35 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2009-08-25 11:14:35 +0000 |
commit | a4ac72a766c3e859f4ac54ec0eaee3c954d98275 (patch) | |
tree | e13ba1751244cb5018786f944d5ad15e078ee2db | |
parent | 8dc00b161f1873153171e7e248e453455ff8b1f1 (diff) | |
download | xineliboutput-a4ac72a766c3e859f4ac54ec0eaee3c954d98275.tar.gz xineliboutput-a4ac72a766c3e859f4ac54ec0eaee3c954d98275.tar.bz2 |
PKT_SIZE --> this->pkt_size (in selected places)
-rw-r--r-- | xine/BluRay/demux_ts.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/xine/BluRay/demux_ts.c b/xine/BluRay/demux_ts.c index 3219c3f4..7efd89e3 100644 --- a/xine/BluRay/demux_ts.c +++ b/xine/BluRay/demux_ts.c @@ -299,6 +299,8 @@ typedef struct { int status; + int pkt_size; /* TS packet size */ + int blockSize; int rate; int media_num; @@ -1523,10 +1525,10 @@ static int sync_correct(demux_ts_t*this, uint8_t *buf, int32_t npkt_read) { xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_ts: about to resync!\n"); for (p=0; p < npkt_read; p++) { - for(n=0; n < PKT_SIZE; n++) { + for(n=0; n < this->pkt_size; n++) { sync_ok = 1; for (i=0; i < MIN(MIN_SYNCS, npkt_read - p); i++) { - if (buf[n + ((i+p) * PKT_SIZE)] != SYNC_BYTE) { + if (buf[n + ((i+p) * this->pkt_size)] != SYNC_BYTE) { sync_ok = 0; break; } @@ -1538,13 +1540,13 @@ static int sync_correct(demux_ts_t*this, uint8_t *buf, int32_t npkt_read) { if (sync_ok) { /* Found sync, fill in */ - memmove(&buf[0], &buf[n + p * PKT_SIZE], - ((PKT_SIZE * (npkt_read - p)) - n)); + memmove(&buf[0], &buf[n + p * this->pkt_size], + ((this->pkt_size * (npkt_read - p)) - n)); read_length = this->input->read(this->input, - &buf[(PKT_SIZE * (npkt_read - p)) - n], - n + p * PKT_SIZE); + &buf[(this->pkt_size * (npkt_read - p)) - n], + n + p * this->pkt_size); /* FIXME: when read_length is not as required... we now stop demuxing */ - if (read_length != (n + p * PKT_SIZE)) { + if (read_length != (n + p * this->pkt_size)) { xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_ts_tsync_correct: sync found, but read failed\n"); return 0; @@ -1586,15 +1588,15 @@ static unsigned char * demux_synchronise(demux_ts_t* this) { /* NEW: handle read returning less packets than NPKT_PER_READ... */ do { read_length = this->input->read(this->input, this->buf, - PKT_SIZE * NPKT_PER_READ); - if (read_length < 0 || read_length % PKT_SIZE) { + this->pkt_size * NPKT_PER_READ); + if (read_length < 0 || read_length % this->pkt_size) { xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_ts: read returned %d bytes (not a multiple of %d!)\n", - read_length, PKT_SIZE); + read_length, this->pkt_size); this->status = DEMUX_FINISHED; return NULL; } - this->npkt_read = read_length / PKT_SIZE; + this->npkt_read = read_length / this->pkt_size; #ifdef TS_READ_STATS this->rstat[this->npkt_read]++; @@ -1621,7 +1623,7 @@ static unsigned char * demux_synchronise(demux_ts_t* this) { return NULL; } } - return_pointer = &(this->buf)[PKT_SIZE * this->packet_number]; + return_pointer = &(this->buf)[this->pkt_size * this->packet_number]; this->packet_number++; return return_pointer; } @@ -2316,7 +2318,9 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, /* dvb */ this->event_queue = xine_event_new_queue (this->stream); - + + this->pkt_size = PKT_SIZE; + this->numPreview=0; return &this->demux_plugin; |