1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-30 11:42:04 +00:00

demux: rename a variable

It's "better". This is all what's left from an attempt to make the code
slightly nicer.
This commit is contained in:
wm4 2019-05-24 02:20:13 +02:00
parent e2ae3676c2
commit adf4d52ee8

View File

@ -1336,7 +1336,7 @@ static void find_backward_restart_pos(struct demux_stream *ds)
// before restart_pos, but might be up to back_preroll packets earlier.
struct demux_packet *last_keyframe = NULL;
struct demux_packet *last_preroll = NULL;
struct demux_packet *target = NULL;
// Keep this packet at back_preroll packets before last_keyframe.
struct demux_packet *pre_packet = ds->reader_head;
@ -1349,7 +1349,7 @@ static void find_backward_restart_pos(struct demux_stream *ds)
{
if (cur->keyframe) {
last_keyframe = cur;
last_preroll = pre_packet;
target = pre_packet;
}
if (pre_packet_offset) {
@ -1375,7 +1375,7 @@ static void find_backward_restart_pos(struct demux_stream *ds)
}
int got_preroll = 0;
for (struct demux_packet *cur = last_preroll;
for (struct demux_packet *cur = target;
cur != last_keyframe;
cur = cur->next)
got_preroll++;
@ -1383,15 +1383,15 @@ static void find_backward_restart_pos(struct demux_stream *ds)
if (got_preroll < ds->back_preroll && !ds->queue->is_bof)
goto resume_earlier;
// (Round preroll down to last_keyframe in the worst case.)
while (!last_preroll->keyframe)
last_preroll = last_preroll->next;
// (Round preroll down to 0 in the worst case.)
while (!target->keyframe)
target = target->next;
// Skip reader_head from previous keyframe to current one.
// Or if preroll is involved, the first preroll packet.
while (ds->reader_head != last_preroll) {
while (ds->reader_head != target) {
if (!advance_reader_head(ds))
assert(0); // last_preroll must be in list
assert(0); // target must be in list
}
ds->back_restarting = false;