From ffbe6906565108f99fccdd65276c6134b43c7cdf Mon Sep 17 00:00:00 2001 From: Dongil Park Date: Thu, 16 Feb 2017 10:51:44 +0900 Subject: [PATCH] hlsdemux: Fix checking adaptation_field_control field to parse pcr The PCR_flag and PCR value is in adaptation_field, not in payload. The MSB of adaptation_field_control is used as whether adaptation_ field is exist or not. For the case(PCR in only adaptation_field without payload), we modify checking condition about adaptation_field_control field. https://bugzilla.gnome.org/show_bug.cgi?id=778731 --- ext/hls/gsthlsdemux-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/hls/gsthlsdemux-util.c b/ext/hls/gsthlsdemux-util.c index efa1129a33..d8456732d1 100644 --- a/ext/hls/gsthlsdemux-util.c +++ b/ext/hls/gsthlsdemux-util.c @@ -246,8 +246,8 @@ gst_hlsdemux_tsreader_find_pcrs_mpegts (GstHLSTSReader * r, GST_LOG ("Found packet for PID %04x (PMT)", r->pmt_pid); handle_pmt (r, p, size); } - /* sync byte (0x47), error indicator (TEI) not set, has_payload */ - else if ((hdr & 0xFF800010) == 0x47000010 + /* sync byte (0x47), error indicator (TEI) not set, has_adaptation_field */ + else if ((hdr & 0xFF800020) == 0x47000020 && ((hdr >> 8) & 0x1fff) == r->pcr_pid) { GST_LOG ("Found packet for PID %04x (PCR)", r->pcr_pid); handle_pcr (r, p, size);