{"action":"created","issue":{"url":"https://api.github.com/repos/google/ExoPlayer/issues/417","labels_url":"https://api.github.com/repos/google/ExoPlayer/issues/417/labels{/name}","comments_url":"https://api.github.com/repos/google/ExoPlayer/issues/417/comments","events_url":"https://api.github.com/repos/google/ExoPlayer/issues/417/events","html_url":"https://github.com/google/ExoPlayer/issues/417","id":70767834,"number":417,"title":"Allow processing of last output buffer in MediaCodecTrackRenderer drainOutputBuffer","user":{"login":"ptran-gpfw","id":3084650,"avatar_url":"https://avatars.githubusercontent.com/u/3084650?v=3","gravatar_id":"","url":"https://api.github.com/users/ptran-gpfw","html_url":"https://github.com/ptran-gpfw","followers_url":"https://api.github.com/users/ptran-gpfw/followers","following_url":"https://api.github.com/users/ptran-gpfw/following{/other_user}","gists_url":"https://api.github.com/users/ptran-gpfw/gists{/gist_id}","starred_url":"https://api.github.com/users/ptran-gpfw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptran-gpfw/subscriptions","organizations_url":"https://api.github.com/users/ptran-gpfw/orgs","repos_url":"https://api.github.com/users/ptran-gpfw/repos","events_url":"https://api.github.com/users/ptran-gpfw/events{/privacy}","received_events_url":"https://api.github.com/users/ptran-gpfw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-24T18:54:22Z","updated_at":"2015-04-25T10:03:50Z","closed_at":null,"body":"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 contains `MediaCodec.BUFFER_FLAG_END_OF_STREAM`.\r\n\r\nIn MediaCodecTrackRenderer `drainOutputBuffer` ([line 832](https://github.com/google/ExoPlayer/blob/dev/library/src/main/java/com/google/android/exoplayer/MediaCodecTrackRenderer.java#L832)), the detection of `BUFFER_FLAG_END_OF_STREAM` causes the method to return before the call to `processOutputBuffer`. This prevents processing of the last output buffer."},"comment":{"url":"https://api.github.com/repos/google/ExoPlayer/issues/comments/96171819","html_url":"https://github.com/google/ExoPlayer/issues/417#issuecomment-96171819","issue_url":"https://api.github.com/repos/google/ExoPlayer/issues/417","id":96171819,"user":{"login":"ojw28","id":7881572,"avatar_url":"https://avatars.githubusercontent.com/u/7881572?v=3","gravatar_id":"","url":"https://api.github.com/users/ojw28","html_url":"https://github.com/ojw28","followers_url":"https://api.github.com/users/ojw28/followers","following_url":"https://api.github.com/users/ojw28/following{/other_user}","gists_url":"https://api.github.com/users/ojw28/gists{/gist_id}","starred_url":"https://api.github.com/users/ojw28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojw28/subscriptions","organizations_url":"https://api.github.com/users/ojw28/orgs","repos_url":"https://api.github.com/users/ojw28/repos","events_url":"https://api.github.com/users/ojw28/events{/privacy}","received_events_url":"https://api.github.com/users/ojw28/received_events","type":"User","site_admin":false},"created_at":"2015-04-25T10:03:50Z","updated_at":"2015-04-25T10:03:50Z","body":"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.\r\n\r\nIf 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 ;)."}}