• Anton Khirnov's avatar
    lavc: do not implicitly share the frame pool between threads · 9d6785d4
    Anton Khirnov authored
    Currently the frame pool used by the default get_buffer2()
    implementation is a single struct, allocated when opening the decoder.
    A pointer to it is simply copied to each frame thread and we assume that
    no thread attempts to modify it at an unexpected time. This is rather
    fragile and potentially dangerous.
    
    With this commit, the frame pool is made refcounted, with the reference
    being propagated across threads along with other context variables. The
    frame pool is now also immutable - when the stream parameters change we
    drop the old reference and create a new one.
    9d6785d4
internal.h 13.5 KB