-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow processing of last output buffer in MediaCodecTrackRenderer drainOutputBuffer #417
Comments
Hm. Doesn't this depend on how you use BUFFER_FLAG_END_OF_STREAM when queuing input buffers? If you set it on the final real input buffer then I'd expect to see it when dequeuing the final real output buffer. If you set it separately on an input buffer that follows the final real one, then I wouldn't expect that. ExoPlayer does the latter, hence why we don't handle the output buffer on which it is set. If you have a concrete example (media + device combination) where this happens, then we can/should fix it. I'm not yet convinced there's a problem though ;). |
I'll try to repro with exoplayer demo and post an update. |
Please re-open if you manage to repro this. Thanks! |
Turns out the standard Google AAC decoder does this, so we end up dropping the last frame of audio. Not particularly important, but we should fix it nevertheless. |
In my own usage of MediaCodec (separate from ExoPlayer) I have observed
dequeueOutputBuffer
return info on an output buffer that has both a) a valid buffer index and b) a flag bitfield that containsMediaCodec.BUFFER_FLAG_END_OF_STREAM
.In MediaCodecTrackRenderer
drainOutputBuffer
(line 832), the detection ofBUFFER_FLAG_END_OF_STREAM
causes the method to return before the call toprocessOutputBuffer
. This prevents processing of the last output buffer.The text was updated successfully, but these errors were encountered: