Skip to content

Commit

Permalink
Fix resize-on-the-fly by processing memory allocation complete.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexarian committed Jan 8, 2024
1 parent 55ab99d commit 78645a9
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion xup/xup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,9 @@ lib_mod_process_message(struct mod *mod, struct stream *s)
int type;
char *phold;

int width;
int height;

LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_process_message:");
in_uint16_le(s, type);
in_uint16_le(s, num_orders);
Expand All @@ -1674,7 +1677,7 @@ lib_mod_process_message(struct mod *mod, struct stream *s)
rv = 0;
if (type == 1) /* original order list */
{
for (index = 0; index < num_orders; index++)
for (index = 0; index < num_orders; ++index)
{
in_uint16_le(s, type);
rv = lib_mod_process_orders(mod, type, s);
Expand Down Expand Up @@ -1727,6 +1730,29 @@ lib_mod_process_message(struct mod *mod, struct stream *s)
s->p = phold + len;
}
}
else if (type == 100) // metadata commands.
{
LOG_DEVEL(LOG_LEVEL_INFO,
"lib_mod_process_message: type 100 len %d", len);
for (index = 0; index < num_orders; ++index)
{
phold = s->p;
in_uint16_le(s, type);
in_uint16_le(s, len);
switch (type)
{
case 3: // memory allocation complete
in_uint16_le(s, width);
in_uint16_le(s, height);
LOG(LOG_LEVEL_INFO, "Received memory_allocation_complete"
" command. width: %d, height: %d",
width, height);
rv = mod->server_reset(mod, width, height, 0);
break;
}
s->p = phold + len;
}
}
else
{
LOG_DEVEL(LOG_LEVEL_TRACE, "unknown type %d", type);
Expand Down

0 comments on commit 78645a9

Please sign in to comment.