mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-10-05 15:48:46 +00:00
Avoid resetting pending frame
The function update_texture() calls update_texture_internal() and falls
back to set_pending_frame() if it fails.
When the frame passed is the pending frame, call only the _internal()
version instead.
This will prevent issues with frame reference counts by ensuring the
source and destination frames are never the same.
Refs 6298ef095f
Refs #6357 <https://github.com/Genymobile/scrcpy/issues/6357>
This commit is contained in:
parent
e11399aff0
commit
bfb0872493
1 changed files with 7 additions and 1 deletions
|
@ -181,6 +181,11 @@ sc_display_set_pending_frame(struct sc_display *display, const AVFrame *frame) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forward declaration
|
||||||
|
static bool
|
||||||
|
sc_display_update_texture_internal(struct sc_display *display,
|
||||||
|
const AVFrame *frame);
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
sc_display_apply_pending(struct sc_display *display) {
|
sc_display_apply_pending(struct sc_display *display) {
|
||||||
if (display->pending.flags & SC_DISPLAY_PENDING_FLAG_SIZE) {
|
if (display->pending.flags & SC_DISPLAY_PENDING_FLAG_SIZE) {
|
||||||
|
@ -196,7 +201,8 @@ sc_display_apply_pending(struct sc_display *display) {
|
||||||
|
|
||||||
if (display->pending.flags & SC_DISPLAY_PENDING_FLAG_FRAME) {
|
if (display->pending.flags & SC_DISPLAY_PENDING_FLAG_FRAME) {
|
||||||
assert(display->pending.frame);
|
assert(display->pending.frame);
|
||||||
bool ok = sc_display_update_texture(display, display->pending.frame);
|
bool ok = sc_display_update_texture_internal(display,
|
||||||
|
display->pending.frame);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue