mirror of
https://github.com/Genymobile/scrcpy
synced 2025-09-01 23:05:19 +00:00
Initialize eof flag from BufferInfo
Stop encoding if the codec signaled the end of stream. The eof flag was read, but never written.
This commit is contained in:
@@ -89,6 +89,7 @@ public class ScreenEncoder implements Device.RotationListener {
|
|||||||
MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();
|
MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();
|
||||||
while (!checkRotationChanged() && !eof) {
|
while (!checkRotationChanged() && !eof) {
|
||||||
int outputBufferId = codec.dequeueOutputBuffer(bufferInfo, -1);
|
int outputBufferId = codec.dequeueOutputBuffer(bufferInfo, -1);
|
||||||
|
eof = (bufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0;
|
||||||
try {
|
try {
|
||||||
if (checkRotationChanged()) {
|
if (checkRotationChanged()) {
|
||||||
// must restart encoding with new size
|
// must restart encoding with new size
|
||||||
|
Reference in New Issue
Block a user