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

Commit e23f8b1a authored by Krishnankutty Kolathappilly's avatar Krishnankutty Kolathappilly Committed by Steve Kondik
Browse files

libmediaplayerservice: Avoid writing silence for offload tracks

-Audio Sink writes silence to the track if size returned from AudioPlayer
 is zero and when there is no subsequent output.
-Avoid writing silence for offload tracks as decoders do not expected
 any raw data.

CRs-Fixed: 615468
Change-Id: I5044d514126c413f56971e80815f232298f9685c
parent 5543234b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1909,7 +1909,8 @@ void MediaPlayerService::AudioOutput::CallbackWrapper(
                    me, buffer->raw, buffer->size, me->mCallbackCookie,
                    CB_EVENT_FILL_BUFFER);

            if (actualSize == 0 && buffer->size > 0 && me->mNextOutput == NULL) {
            if (actualSize == 0 && buffer->size > 0 && me->mNextOutput == NULL &&
                    me->mFlags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD == 0) {
                // We've reached EOS but the audio track is not stopped yet,
                // keep playing silence.