Restore the buffer management in the decoder.

Otherwise we'll segfault when upsampling reference frames.
wip on player
wip
wip