| 306 | } |
| 307 | |
| 308 | int VideoCacheThread::computeDirection() const |
| 309 | { |
| 310 | // If speed ≠ 0, use its sign; if speed==0, keep last_dir |
| 311 | const int current_speed = speed.load(); |
| 312 | if (current_speed != 0) { |
| 313 | return (current_speed > 0 ? 1 : -1); |
| 314 | } |
| 315 | return last_dir.load(); |
| 316 | } |
| 317 | |
| 318 | void VideoCacheThread::handleUserSeek(int64_t playhead, int dir) |
| 319 | { |