Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1b8b7bf authored by Wonsik Kim's avatar Wonsik Kim
Browse files

fix AmrInputStream.read() hang

Test: AmrInputStream.read() no longer hangs
Change-Id: I5b3e1c7667891ce250e447c32213511077c5b5df
parent 1211941a
Loading
Loading
Loading
Loading
+10 −14
Original line number Diff line number Diff line
@@ -140,10 +140,8 @@ public final class AmrInputStream extends InputStream {
                }
            }

            // now read encoded data from the encoder (blocking, since we just filled up the
            // encoder's input with data it should be able to output at least one buffer)
            while (true) {
                int index = mCodec.dequeueOutputBuffer(mInfo, -1);
            // now read encoded data from the encoder
            int index = mCodec.dequeueOutputBuffer(mInfo, 0);
            if (index >= 0) {
                mBufIn = mInfo.size;
                ByteBuffer out = mCodec.getOutputBuffer(index);
@@ -152,8 +150,6 @@ public final class AmrInputStream extends InputStream {
                if ((mInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
                    mSawOutputEOS = true;
                }
                    break;
                }
            }
        }