Xpra: Ticket #865: video encoders should never be closed whilst encoding is in progress

Found in attachment/ticket/863/xpra863encoding(1).txt:

Traceback (most recent call last):
1245	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 958, in delayed_region_soft_timeout
1246	    self.do_send_delayed()
1247	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 1048, in do_send_delayed
1248	    self.send_delayed_regions(*delayed)
1249	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 1063, in send_delayed_regions
1250	    self.do_send_delayed_regions(damage_time, window, regions, coding, options)
1251	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_video_source.py", line 552, in do_send_delayed_regions
1252	    WindowSource.do_send_delayed_regions(self, damage_time, window, regions, coding, options)
1253	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 1098, in do_send_delayed_regions
1254	    send_full_window_update()
1255	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 1077, in send_full_window_update
1256	    self.process_damage_region(damage_time, window, 0, 0, ww, wh, actual_encoding, options)
1257	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_video_source.py", line 632, in process_damage_region
1258	    WindowSource.process_damage_region(self, damage_time, window, x, y, w-dw, h-dh, coding, options)
1259	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 1199, in process_damage_region
1260	    self.make_data_packet_cb(*item)
1261	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 1261, in make_data_packet_cb
1262	    packet = self.make_data_packet(damage_time, process_damage_time, wid, image, coding, sequence, options)
1263	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 1601, in make_data_packet
1264	    ret = encoder(coding, image, options)
1265	  File "/usr/lib64/python2.7/site-packages/xpra/server/window_video_source.py", line 1267, in video_encode
1266	    ret = self._video_encoder.compress_image(csc_image, quality, speed, options)
1267	  File "xpra/codecs/enc_x264/encoder.pyx", line 549, in xpra.codecs.enc_x264.encoder.Encoder.compress_image (xpra/codecs/enc_x264/encoder.c:6237)
1268	AttributeError: 'int' object has no attribute 'append'

The error shown is because of another minor bug fixes in r9460. (backport unimportant)

The real issue is that this bug can only trigger if we finish compressing the pixture with x264 after the encoder context has been freed, which is illegal.

The encoder context can be freed:

Looks fine, but the stacktrace does not lie!

Thu, 21 May 2015 03:39:23 GMT - Antoine Martin: status changed; resolution set

Fixed in r9463, this was caused by the av-sync stuff #835 in r9372.

When not av-syncing (ie with older clients), we would call make_data_packet_cb from the UI thread instead of the encode thread...

Sat, 23 Jan 2021 05:08:15 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/865