[vlc-commits] [Git][videolan/vlc][master] 3 commits: player: fix assert when seeking to negative relative pos

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Thu Jul 23 11:08:33 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
46c85aef by Thomas Guillem at 2026-07-23T12:50:16+02:00
player: fix assert when seeking to negative relative pos

Regression from 5ea729abe44d9ae6c7a9492d9a4be9a414159438

- - - - -
214edced by Thomas Guillem at 2026-07-23T12:50:16+02:00
player: fix vlc_player_SeekByPos range documentation

- - - - -
f85e2668 by Thomas Guillem at 2026-07-23T12:50:16+02:00
lib: media_player: document set_position range

- - - - -


3 changed files:

- include/vlc/libvlc_media_player.h
- include/vlc_player.h
- src/player/input.c


Changes:

=====================================
include/vlc/libvlc_media_player.h
=====================================
@@ -1829,7 +1829,7 @@ LIBVLC_API double libvlc_media_player_get_position( libvlc_media_player_t *p_mi
  *
  * \param p_mi the Media Player
  * \param b_fast prefer fast seeking or precise seeking
- * \param f_pos the position
+ * \param f_pos the position in the range [0;1]
  * \return 0 on success, -1 on error
  */
 LIBVLC_API int libvlc_media_player_set_position( libvlc_media_player_t *p_mi,


=====================================
include/vlc_player.h
=====================================
@@ -702,7 +702,8 @@ vlc_player_GetPosition(vlc_player_t *player);
  * a starting position.
  *
  * @param player locked player instance
- * @param position position in the range [0.f;1.f]
+ * @param position position in the range [0;1] (VLC_PLAYER_WHENCE_ABSOLUTE)
+ * or [-1;1] (VLC_PLAYER_WHENCE_RELATIVE)
  * @param speed precise of fast
  * @param whence absolute or relative
  */


=====================================
src/player/input.c
=====================================
@@ -126,10 +126,15 @@ vlc_player_input_SeekByPos(struct vlc_player_input *input, double position,
 
     /* 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)
+    {
+        assert(position >= -1 && position <=1);
         position += vlc_player_input_GetPos(input, true, vlc_tick_now());
+    }
+    else
+    {
+        assert(position >= 0 && position <=1);
+    }
 
     if (position < 0)
         position = 0;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e837f950ef81e7735c28692c558955f9f650bbe0...f85e26685b4f9870a8d059519b6b665300e853f7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e837f950ef81e7735c28692c558955f9f650bbe0...f85e26685b4f9870a8d059519b6b665300e853f7
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