I'm always crashing when closing (any call to decode_avi) because gsttividdec2
receives EOS after decode_thread stops the codec.
viddec2->circBuf is free'd and NULL when it starts to drain.
I manage to get it working by switching:
Rendezvous_meet(viddec2->waitOnDecodeDrain); (line 1702)
Rendezvous_force(viddec2->waitOnDecodeDrain); (line 1556)
decode_thread thus waits for the circbuf to be drained before calling