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 {
104
104
105
105
// / decods the data and removes the decoded frame from the buffer
106
106
int decode () override {
107
+ LOG_HELIX (LogLevelHelix::Debug, " decode" );
107
108
int processed = 0 ;
108
109
int available = frame_buffer.available ();
109
110
int bytes_left = frame_buffer.available ();
Original file line number Diff line number Diff line change @@ -102,11 +102,14 @@ class CommonHelix {
102
102
void flush () {
103
103
int rc = 1 ;
104
104
while (rc >= 0 ) {
105
+ // we must start with sych word
105
106
if (!presync ()) break ;
107
+ // we must end with synch world
108
+ if (findSynchWord (3 ) < 0 ) break ;
106
109
rc = decode ();
107
110
if (!resynch (rc)) break ;
108
111
// remove processed data
109
- frame_buffer.clearArray (rc);
112
+ if (rc > 0 ) frame_buffer.clearArray (rc);
110
113
}
111
114
}
112
115
@@ -155,6 +158,7 @@ class CommonHelix {
155
158
bool rc = true ;
156
159
int pos = findSynchWord ();
157
160
if (pos > 3 ) rc = removeInvalidData (pos);
161
+
158
162
return rc;
159
163
}
160
164
You can’t perform that action at this time.
0 commit comments