[vlc-commits] [Git][videolan/vlc][master] modules: call demux_SetPosition() instead of DEMUX_SET_POSITION

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Jan 17 13:02:06 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
bf815d4a by Steve Lhomme at 2023-01-17T12:30:12+00:00
modules: call demux_SetPosition() instead of DEMUX_SET_POSITION

This is safer and clips the value as well.

- - - - -


2 changed files:

- modules/demux/mpeg/ps.c
- modules/stream_out/chromecast/chromecast_demux.cpp


Changes:

=====================================
modules/demux/mpeg/ps.c
=====================================
@@ -804,7 +804,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             {
                 vlc_tick_t i_time = va_arg( args, vlc_tick_t );
                 i_time -= p_sys->tk[p_sys->i_time_track_index].i_first_pts;
-                return demux_Control( p_demux, DEMUX_SET_POSITION, (double) i_time / p_sys->i_length );
+                return demux_SetPosition( p_demux, (double) i_time / p_sys->i_length, false, true );
             }
             break;
         }


=====================================
modules/stream_out/chromecast/chromecast_demux.cpp
=====================================
@@ -221,7 +221,7 @@ struct demux_cc
                 ret = demux_Control( p_demux->s, DEMUX_SET_TIME, time, false );
 
             if( ret != VLC_SUCCESS && pos >= 0 )
-                demux_Control( p_demux->s, DEMUX_SET_POSITION, pos, false );
+                demux_SetPosition( p_demux->s, pos, false, true );
         }
     }
 
@@ -346,7 +346,7 @@ struct demux_cc
         {
             double pos = va_arg( args, double );
             /* Force imprecise seek */
-            int ret = demux_Control( p_demux->s, DEMUX_SET_POSITION, pos, false );
+            int ret = demux_SetPosition( p_demux->s, pos, false, true );
             if( ret != VLC_SUCCESS )
                 return ret;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bf815d4aeb8cf18c80ec11fca00157a3b3db7c8a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bf815d4aeb8cf18c80ec11fca00157a3b3db7c8a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list