From 448053b621ca26e257c93d3b8f7a909b8696b64a Mon Sep 17 00:00:00 2001 From: tao3 Date: Sat, 15 Jun 2024 20:24:16 +0800 Subject: [PATCH] fix: #338,#339,#340 notify on pmt version changed --- libmpeg/source/mpeg-ts-dec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmpeg/source/mpeg-ts-dec.c b/libmpeg/source/mpeg-ts-dec.c index 02e6cf52..c0e8637c 100644 --- a/libmpeg/source/mpeg-ts-dec.c +++ b/libmpeg/source/mpeg-ts-dec.c @@ -166,7 +166,7 @@ int ts_demuxer_input(struct ts_demuxer_t* ts, const uint8_t* data, size_t bytes) uint32_t i, j, k; uint32_t PID; size_t consume; - unsigned int count; + unsigned int count, ver; struct mpeg_bits_t reader; struct ts_packet_header_t pkhd; @@ -232,9 +232,10 @@ int ts_demuxer_input(struct ts_demuxer_t* ts, const uint8_t* data, size_t bytes) if(pkhd.payload_unit_start_indicator) i += 1; // pointer 0x00 + ver = ts->pat.pmts[j].ver; count = ts->pat.pmts[j].stream_count; pmt_read(&ts->pat.pmts[j], data + i, bytes - i); - if(count != ts->pat.pmts[j].stream_count) + if(ver != ts->pat.pmts[j].ver || count != ts->pat.pmts[j].stream_count) ts_demuxer_notify(ts, &ts->pat.pmts[j]); break; }