[vlc-commits] [Git][videolan/vlc][master] 2 commits: test: player: seeks: don't SetPosition(2)
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Jul 16 12:36:41 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
1572bcd5 by Thomas Guillem at 2026-07-16T12:22:55+00:00
test: player: seeks: don't SetPosition(2)
The goal was to seek at EOF, 1.0f is enough.
- - - - -
5ea729ab by Thomas Guillem at 2026-07-16T12:22:55+00:00
player: assert that position is in [0;1] range
This is a kind of API missusage that we need to notify early (by aborting).
- - - - -
2 changed files:
- src/player/input.c
- test/src/player/seeks.c
Changes:
=====================================
src/player/input.c
=====================================
@@ -124,6 +124,10 @@ vlc_player_input_SeekByPos(struct vlc_player_input *input, double position,
vlc_player_t *player = input->player;
vlc_player_assert_seek_params(speed, whence);
+ /* Assert before we modify position internally, this only check that user
+ * positions are correct. */
+ assert(position >= 0 && position <=1);
+
if (whence != VLC_PLAYER_WHENCE_ABSOLUTE)
position += vlc_player_input_GetPos(input, true, vlc_tick_now());
=====================================
test/src/player/seeks.c
=====================================
@@ -45,7 +45,7 @@ test_seeks(struct ctx *ctx)
assert_position(ctx, &VEC_LAST(vec));
}
- vlc_player_SetPosition(player, 2.0f);
+ vlc_player_SetPosition(player, 1.0f);
test_prestop(ctx);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2b347c2cec4737c8bb215ea04b3a50d024adf982...5ea729abe44d9ae6c7a9492d9a4be9a414159438
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2b347c2cec4737c8bb215ea04b3a50d024adf982...5ea729abe44d9ae6c7a9492d9a4be9a414159438
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list