Loading media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp +11 −2 Original line number Original line Diff line number Diff line Loading @@ -962,7 +962,15 @@ bool NuPlayer::Renderer::onDrainAudioQueue() { } } entry->mOffset += written; entry->mOffset += written; if (entry->mOffset == entry->mBuffer->size()) { size_t remainder = entry->mBuffer->size() - entry->mOffset; if ((ssize_t)remainder < mAudioSink->frameSize()) { if (remainder > 0) { ALOGW("Corrupted audio buffer has fractional frames, discarding %zu bytes.", remainder); entry->mOffset += remainder; copy -= remainder; } entry->mNotifyConsumed->post(); entry->mNotifyConsumed->post(); mAudioQueue.erase(mAudioQueue.begin()); mAudioQueue.erase(mAudioQueue.begin()); Loading Loading @@ -990,7 +998,8 @@ bool NuPlayer::Renderer::onDrainAudioQueue() { // AudioSink write is called in non-blocking mode. // AudioSink write is called in non-blocking mode. // It may return with a short count when: // It may return with a short count when: // // // 1) Size to be copied is not a multiple of the frame size. We consider this fatal. // 1) Size to be copied is not a multiple of the frame size. Fractional frames are // discarded. // 2) The data to be copied exceeds the available buffer in AudioSink. // 2) The data to be copied exceeds the available buffer in AudioSink. // 3) An error occurs and data has been partially copied to the buffer in AudioSink. // 3) An error occurs and data has been partially copied to the buffer in AudioSink. // 4) AudioSink is an AudioCache for data retrieval, and the AudioCache is exceeded. // 4) AudioSink is an AudioCache for data retrieval, and the AudioCache is exceeded. Loading Loading
media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp +11 −2 Original line number Original line Diff line number Diff line Loading @@ -962,7 +962,15 @@ bool NuPlayer::Renderer::onDrainAudioQueue() { } } entry->mOffset += written; entry->mOffset += written; if (entry->mOffset == entry->mBuffer->size()) { size_t remainder = entry->mBuffer->size() - entry->mOffset; if ((ssize_t)remainder < mAudioSink->frameSize()) { if (remainder > 0) { ALOGW("Corrupted audio buffer has fractional frames, discarding %zu bytes.", remainder); entry->mOffset += remainder; copy -= remainder; } entry->mNotifyConsumed->post(); entry->mNotifyConsumed->post(); mAudioQueue.erase(mAudioQueue.begin()); mAudioQueue.erase(mAudioQueue.begin()); Loading Loading @@ -990,7 +998,8 @@ bool NuPlayer::Renderer::onDrainAudioQueue() { // AudioSink write is called in non-blocking mode. // AudioSink write is called in non-blocking mode. // It may return with a short count when: // It may return with a short count when: // // // 1) Size to be copied is not a multiple of the frame size. We consider this fatal. // 1) Size to be copied is not a multiple of the frame size. Fractional frames are // discarded. // 2) The data to be copied exceeds the available buffer in AudioSink. // 2) The data to be copied exceeds the available buffer in AudioSink. // 3) An error occurs and data has been partially copied to the buffer in AudioSink. // 3) An error occurs and data has been partially copied to the buffer in AudioSink. // 4) AudioSink is an AudioCache for data retrieval, and the AudioCache is exceeded. // 4) AudioSink is an AudioCache for data retrieval, and the AudioCache is exceeded. Loading