… | |
… | |
76 | { |
76 | { |
77 | reset_state (); |
77 | reset_state (); |
78 | send_packet_printf ("drawinfo %d too many commands in queue, ignoring.", NDI_RED); |
78 | send_packet_printf ("drawinfo %d too many commands in queue, ignoring.", NDI_RED); |
79 | } |
79 | } |
80 | else |
80 | else |
|
|
81 | { |
81 | cmd_queue.push_back (command ( |
82 | cmd_queue.push_back (command ()); |
82 | stamp, handler, (char *)salloc (datalen + 1, data), datalen |
83 | command &cmd = cmd_queue.back (); |
83 | )); |
84 | cmd.stamp = stamp; |
|
|
85 | cmd.handler = handler; |
|
|
86 | cmd.data = salloc<char> (datalen + 1, data); |
|
|
87 | cmd.datalen = datalen; |
|
|
88 | } |
84 | } |
89 | } |
85 | |
90 | |
86 | bool |
91 | bool |
87 | client::handle_command () |
92 | client::handle_command () |
88 | { |
93 | { |
… | |
… | |
100 | send_packet_printf ("drawinfo %d ignoring delayed command.", NDI_RED); |
105 | send_packet_printf ("drawinfo %d ignoring delayed command.", NDI_RED); |
101 | } |
106 | } |
102 | else |
107 | else |
103 | execute (cmd.handler, cmd.data, cmd.datalen); |
108 | execute (cmd.handler, cmd.data, cmd.datalen); |
104 | |
109 | |
105 | sfree (cmd.data, cmd.datalen); |
|
|
106 | cmd_queue.pop_front (); |
110 | cmd_queue.pop_front (); |
107 | |
111 | |
108 | return true; |
112 | return true; |
109 | } |
113 | } |
110 | |
114 | |