Skip to content

Commit

Permalink
(WIP) vo_placebo: switch from ZOH to nearest neighbour
Browse files Browse the repository at this point in the history
In the still frame path. Otherwise, this really messes up
frame-stepping.
  • Loading branch information
haasn committed May 5, 2021
1 parent deeb55a commit 5a78c03
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions video/out/vo_placebo.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,14 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
}

if (frame->still && mix.num_frames) {
// Recreate ZOH semantics on this frame mix
while (mix.num_frames > 1 && mix.timestamps[1] <= 0.0) {
double best = fabs(mix.timestamps[0]);
// Recreate nearest neighbour semantics on this frame mix
while (mix.num_frames > 1 && fabs(mix.timestamps[1]) < best) {
best = fabs(mix.timestamps[1]);
mix.frames++;
mix.signatures++;
mix.timestamps++;
mix.num_frames--;
}
mix.num_frames = 1;
}
Expand Down

0 comments on commit 5a78c03

Please sign in to comment.