From c36b5e22ae19757cb65e8c9fc06568322690d0b9 Mon Sep 17 00:00:00 2001 From: Mark Calderbank Date: Tue, 18 Dec 2007 23:57:02 +0000 Subject: [PATCH] Bug in private packet processing (AC3) --- demuxer.cc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/demuxer.cc b/demuxer.cc index 1443b7b..e6f1e3e 100644 --- a/demuxer.cc +++ b/demuxer.cc @@ -48,6 +48,7 @@ void PESPacket::init(UCHAR type) data[3] = type; data[4] = data[5] = 0; packetType = type; + substream = 0; seq_header = 1; // Unknown seq_header status } @@ -283,20 +284,18 @@ bool Demuxer::submitPacket(PESPacket& packet) else sent = packet.getSize(); } - else if (packet_type == PESTYPE_PRIVATE_1) + else if (packet_type == PESTYPE_PRIVATE_1 && + packet.getSubstream() >= PESTYPE_SUBSTREAM_AC30 && + packet.getSubstream() <= PESTYPE_SUBSTREAM_AC3MAX) { - if (packet.getSubstream() >= PESTYPE_SUBSTREAM_AC30 && - packet.getSubstream() <= PESTYPE_SUBSTREAM_AC3MAX) + avail_ac3audchan[packet.getSubstream() - PESTYPE_SUBSTREAM_AC30] = true; + if (packet.getSubstream() == audio_current) { - avail_ac3audchan[packet.getSubstream() - PESTYPE_SUBSTREAM_AC30] = true; - if (packet.getSubstream() == audio_current) - { - sent = audiostream.put(packet.getData(), packet.getSize(), (ispre_1_3_19)? MPTYPE_AC3_PRE13 : MPTYPE_AC3); - } - else - { - sent = packet.getSize(); - } + sent = audiostream.put(packet.getData(), packet.getSize(), (ispre_1_3_19)? MPTYPE_AC3_PRE13 : MPTYPE_AC3); + } + else + { + sent = packet.getSize(); } } else -- 2.39.5