fix for av_cold and decode_end