Attempt to fix potential race condition and mutlithreading issues ... to be tested
Fixed buffer reference and added more logs to track a frames lifetime
Missing initialization and extradata handling backport from wolfgar