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

Commit a9fa836d authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Fix bug in test-resample's AudioBufferProvider"

parents 78541148 47f3f5a1
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -61,6 +61,17 @@ public:
    //  buffer->frameCount  0
    //  buffer->frameCount  0
    virtual status_t getNextBuffer(Buffer* buffer, int64_t pts = kInvalidPTS) = 0;
    virtual status_t getNextBuffer(Buffer* buffer, int64_t pts = kInvalidPTS) = 0;


    // Release (a portion of) the buffer previously obtained by getNextBuffer().
    // It is permissible to call releaseBuffer() multiple times per getNextBuffer().
    // On entry:
    //  buffer->frameCount  number of frames to release, must be <= number of frames
    //                      obtained but not yet released
    //  buffer->raw         unused
    // On return:
    //  buffer->frameCount  0; implementation MUST set to zero
    //  buffer->raw         undefined; implementation is PERMITTED to set to any value,
    //                      so if caller needs to continue using this buffer it must
    //                      keep track of the pointer itself
    virtual void releaseBuffer(Buffer* buffer) = 0;
    virtual void releaseBuffer(Buffer* buffer) = 0;
};
};


+2 −0
Original line number Original line Diff line number Diff line
@@ -202,6 +202,8 @@ int main(int argc, char* argv[]) {
                mNextFrame += buffer->frameCount;
                mNextFrame += buffer->frameCount;
                mUnrel -= buffer->frameCount;
                mUnrel -= buffer->frameCount;
            }
            }
            buffer->frameCount = 0;
            buffer->i16 = NULL;
        }
        }
    } provider(input_vaddr, input_size, channels);
    } provider(input_vaddr, input_size, channels);