From 43c506ff60c92ec3a40f64e20efe9d48e4b13208 Mon Sep 17 00:00:00 2001 From: phintuka Date: Thu, 10 Sep 2009 11:13:59 +0000 Subject: Reset PMT buffer only when PMT pid changes. Fixes collecting PMT packets when PMT spans over multiple TS packets and PAT is muxed to middle of PMT packets. --- xine/BluRay/demux_ts.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xine/BluRay/demux_ts.c b/xine/BluRay/demux_ts.c index b9dce7df..79315004 100644 --- a/xine/BluRay/demux_ts.c +++ b/xine/BluRay/demux_ts.c @@ -678,14 +678,16 @@ static void demux_ts_parse_pat (demux_ts_t*this, unsigned char *original_pkt, this->last_pmt_crc = 0; this->videoPid = INVALID_PID; this->spu_pid = INVALID_PID; - } - this->pmt_pid[program_count] = pmt_pid; - if (this->pmt[program_count] != NULL) { - free(this->pmt[program_count]); - this->pmt[program_count] = NULL; - this->pmt_write_ptr[program_count] = NULL; + this->pmt_pid[program_count] = pmt_pid; + + if (this->pmt[program_count] != NULL) { + free(this->pmt[program_count]); + this->pmt[program_count] = NULL; + this->pmt_write_ptr[program_count] = NULL; + } } + #ifdef TS_PAT_LOG if (this->program_number[program_count] != INVALID_PROGRAM) printf ("demux_ts: PAT acquired count=%d programNumber=0x%04x " -- cgit v1.2.3