From d4547e6a80fe0dcc76b7453c8b85664738a0e466 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Wed, 16 Dec 2020 09:56:08 +0100 Subject: [PATCH] aac: issue a warning instead of an error on window sequence mismatch --- nihav-commonfmt/src/codecs/aac.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nihav-commonfmt/src/codecs/aac.rs b/nihav-commonfmt/src/codecs/aac.rs index 0329eb5..09a5b6b 100644 --- a/nihav-commonfmt/src/codecs/aac.rs +++ b/nihav-commonfmt/src/codecs/aac.rs @@ -325,12 +325,16 @@ impl ICSInfo { self.window_sequence = br.read(2)? as u8; match self.prev_window_sequence { ONLY_LONG_SEQUENCE | LONG_STOP_SEQUENCE => { - validate!((self.window_sequence == ONLY_LONG_SEQUENCE) || - (self.window_sequence == LONG_START_SEQUENCE)); + if (self.window_sequence != ONLY_LONG_SEQUENCE) && + (self.window_sequence != LONG_START_SEQUENCE) { + println!("incorrect previous window"); + } }, LONG_START_SEQUENCE | EIGHT_SHORT_SEQUENCE => { - validate!((self.window_sequence == EIGHT_SHORT_SEQUENCE) || - (self.window_sequence == LONG_STOP_SEQUENCE)); + if (self.window_sequence != EIGHT_SHORT_SEQUENCE) && + (self.window_sequence != LONG_STOP_SEQUENCE) { + println!("incorrect previous window"); + } }, _ => {}, }; -- 2.39.5