File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ class AACDecoderHelix : public CommonHelix {
104104
105105 // / decods the data and removes the decoded frame from the buffer
106106 int decode () override {
107+ LOG_HELIX (LogLevelHelix::Debug, " decode" );
107108 int processed = 0 ;
108109 int available = frame_buffer.available ();
109110 int bytes_left = frame_buffer.available ();
Original file line number Diff line number Diff line change @@ -102,11 +102,14 @@ class CommonHelix {
102102 void flush () {
103103 int rc = 1 ;
104104 while (rc >= 0 ) {
105+ // we must start with sych word
105106 if (!presync ()) break ;
107+ // we must end with synch world
108+ if (findSynchWord (3 ) < 0 ) break ;
106109 rc = decode ();
107110 if (!resynch (rc)) break ;
108111 // remove processed data
109- frame_buffer.clearArray (rc);
112+ if (rc > 0 ) frame_buffer.clearArray (rc);
110113 }
111114 }
112115
@@ -155,6 +158,7 @@ class CommonHelix {
155158 bool rc = true ;
156159 int pos = findSynchWord ();
157160 if (pos > 3 ) rc = removeInvalidData (pos);
161+
158162 return rc;
159163 }
160164
You can’t perform that action at this time.
0 commit comments