2014-02-18, 22:31
(2014-02-18, 21:53)Koying Wrote: The concept is good.
The potential problem is see is that there is no guarantee that an attempt won't be made to render a passed buffer after the :ispose and their delete.
The render issue can be solved by checking IsValid() on the buffer during render. The buffers itself are reference counted (your implementation) and one reference is held by the codec. In Dipose the codec releases the reference and invalidates the buffers (synchronized with a lock) so it should be safe. I tested it and XBMC was still holding the buffers until the next codec creation because they were not released in DeleteTexture and it was working. I added a TRACE_FRAMES define to really trace the lifetime of each buffer and it looked good so far. My XBMC is still running after lots of channel switches and video start/stops
It is really good to know that we are on the right track to solve all the issues we had in the past with syncing and frame dropping. Thank you for your implementation, it helped a lot especially for my setup.
[EDIT] And not to forget Stephan for his amazing work he has done and is still doing ...