update this stream's head timestamp */
| 241 | |
| 242 | /* update this stream's head timestamp */ |
| 243 | static void stream_update_ts(SyncQueue *sq, unsigned int stream_idx, int64_t ts) |
| 244 | { |
| 245 | SyncQueueStream *st = &sq->streams[stream_idx]; |
| 246 | |
| 247 | if (ts == AV_NOPTS_VALUE || |
| 248 | (st->head_ts != AV_NOPTS_VALUE && st->head_ts >= ts)) |
| 249 | return; |
| 250 | |
| 251 | st->head_ts = ts; |
| 252 | |
| 253 | /* if this stream is now ahead of some finished stream, then |
| 254 | * this stream is also finished */ |
| 255 | if (sq->head_finished_stream >= 0 && |
| 256 | av_compare_ts(sq->streams[sq->head_finished_stream].head_ts, |
| 257 | sq->streams[sq->head_finished_stream].tb, |
| 258 | ts, st->tb) <= 0) |
| 259 | finish_stream(sq, stream_idx); |
| 260 | |
| 261 | /* update the overall head timestamp if it could have changed */ |
| 262 | if (st->limiting && |
| 263 | (sq->head_stream < 0 || sq->head_stream == stream_idx)) |
| 264 | queue_head_update(sq); |
| 265 | } |
| 266 | |
| 267 | /* If the queue for the given stream (or all streams when stream_idx=-1) |
| 268 | * is overflowing, trigger a fake heartbeat on lagging streams. |
no test coverage detected