Skip to content

Commit 448053b

Browse files
committed
fix: #338,#339,#340 notify on pmt version changed
1 parent 0472df2 commit 448053b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libmpeg/source/mpeg-ts-dec.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ int ts_demuxer_input(struct ts_demuxer_t* ts, const uint8_t* data, size_t bytes)
166166
uint32_t i, j, k;
167167
uint32_t PID;
168168
size_t consume;
169-
unsigned int count;
169+
unsigned int count, ver;
170170
struct mpeg_bits_t reader;
171171
struct ts_packet_header_t pkhd;
172172

@@ -232,9 +232,10 @@ int ts_demuxer_input(struct ts_demuxer_t* ts, const uint8_t* data, size_t bytes)
232232
if(pkhd.payload_unit_start_indicator)
233233
i += 1; // pointer 0x00
234234

235+
ver = ts->pat.pmts[j].ver;
235236
count = ts->pat.pmts[j].stream_count;
236237
pmt_read(&ts->pat.pmts[j], data + i, bytes - i);
237-
if(count != ts->pat.pmts[j].stream_count)
238+
if(ver != ts->pat.pmts[j].ver || count != ts->pat.pmts[j].stream_count)
238239
ts_demuxer_notify(ts, &ts->pat.pmts[j]);
239240
break;
240241
}

0 commit comments

Comments
 (0)