Skip to content
Snippets Groups Projects
  1. Apr 14, 2025
    • Tristan Matthews's avatar
      contrib: aom: update to 3.12.1 · a85b9a7b
      Tristan Matthews authored
        - Bug Fixes
          * b:396169342: Assertion
            `av1_is_subpelmv_in_range(&ms_params.mv_limits, start_mv)' failed.
          * b:401671154: typo in void init_src_params(...)
          * Coverity defect 323670: Uninitialized scalar variable in
            encode_with_and_without_superres()
          * cmake: bump minimum version to 3.16
          * cfl_ppc: fix subtract_average_vsx
          * Fix an incorrect index in av1_highbd_pixel_proj_error_neon
      a85b9a7b
    • Alexandre Janniaux's avatar
      darwinvlc: remove SIGCHLD GCD handling · 120b4939
      Alexandre Janniaux authored and Rémi Denis-Courmont's avatar Rémi Denis-Courmont committed
      The handling through GCD was added back then in commit
      cc07bce0. In that commit,
      signal(SIGCHLD, SIG_DFL) was already called to ensure the behavior of
      the signal is restored to default handlers.
      
      In `man 3 signal` from the macos manual, it is said that when setting
      SIG_IGN for SIGCHLD, the operating system will not create zombie process
      and the exit status will be ignored. We do want to avoid creating zombie
      process but we also want to have exit status, which means we do indeed
      need the SIG_DFL handler here. See also the following commit on the
      linux side: 94763831.
      
      However, GCD was used to automatically call waitpid() on the process
      that are being signalled as closing. Since we're always calling waitpid
      when spawning any process, this duplicates the handling. But the clients
      are actually using vlc_waitpid which is checking errno != ECHILD, so it
      would break as soon as the GCD handler is executed before...
      120b4939
  2. Apr 13, 2025
  3. Apr 12, 2025
    • Claudio Cambra's avatar
    • Claudio Cambra's avatar
      macosx: Ensure the displaying of the fake title bar gets updated when going... · e2a5545d
      Claudio Cambra authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      macosx: Ensure the displaying of the fake title bar gets updated when going into fullscreen even if we disable library controls
      
      Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
      e2a5545d
    • Alexandre Janniaux's avatar
      clock: prefer start_time over first_pcr · ae286927
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      This prioritize using the start_time path if start_time has been defined
      regardless of whether vlc_clock_SetFirstPcr has been called or not,
      instead of using the first_pcr path as long as first_pcr has been
      defined.
      ae286927
    • Alexandre Janniaux's avatar
      clock: don't generate wait_sync_ref with clock-start · b295062d
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      The conversion function might not have wait_sync_ref defined in the
      next steps as it won't generate the wait_sync_ref itself, but choosing
      the start_date requires transforming the current point.
      
      The assertion on wait_sync_ref is removed given that it would be NULL
      when using start_time.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      b295062d
    • Alexandre Janniaux's avatar
      test: clock: adapt after previous changes · 4d1fcf56
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      Clock must now be started from a dedicated input vlc_clock. The start is
      not yet mandatory but is available and will be mandatory after next
      patches.
      
      Previously, the clock was driven by two values: coeff and offset. The
      idea was that since the clock is supposed to look like an affine line,
      we could extrapolate any `ts` media point into `ts * coeff + offset` in
      system time.
      
      It meant that offset could take any value depending on the difference
      between system time and media time, reducing the interpretability of the
      values.
      
      After this patch, offset is computed from the start of the stream in the
      test, so it will basically only include the difference between the
      timestamp computation and the real clock.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      4d1fcf56
    • Alexandre Janniaux's avatar
      input: decoder: start clock when decoders are ready · 56327ed9
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      DecoderWaitUnblock is waiting for the vlc_input_decoder_StopWait which
      will be called by the es_out when every decoders are ready to start
      playing.
      
      When DecoderWaitUnblock is called and almost ready to return, it means
      that we already have a frame in the output and that playback has
      started. We can compute the monotonic start by calling vlc_clock_Start.
      
      Some care must be taken given that other reasons might unblock the
      decoders, like flushing or closing the decoder.
      
      Currently, vlc_clock_Start() does nothing as long as we didn't start the
      input vlc_clock_t also, but all of the code will be enabled after.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      56327ed9
    • Thomas Guillem's avatar
      decoder: start clock only once and even when not buffered · 95a5e14c
      Thomas Guillem authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      Not buffered can happen if a decoder output a first frame late (after buffering)
      95a5e14c
    • Alexandre Janniaux's avatar
      clock: store start date in last conversion · eb480995
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      This fixes a lipsync issue when a context is created from the beginning
      of the stream.
      eb480995
    • Alexandre Janniaux's avatar
      clock: setup new clock_context selection · 20caec57
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      Ensure that every clocks (even input) has a valid clock_context, and
      specifically select them during vlc_clock_Start(), and un-select them
      during vlc_clock_Reset().
      
      The previous mode is still present in the code to avoid breaking the
      current code until all the necessary changes are introduced, and is
      selected by whether the main_clock->first_pcr value has been set or not.
      
      Now that vlc_clock_main_Reset() is not called anymore at this location,
      the points registered from the input when it is driving the clock bus
      will not be removed.
      
          /!\ As a consequence, --clock-master=input now starts from the input
          /!\ clock points instead of starting from a monotonic clock point.
      
      This indirectly fixes an issue where the output_dejitter is accounted in
      computing the wait_sync_ref date, but also making all the outputs late
      compared to the input clock, leading to "Deferring start" messages from
      the audio output, and then "Starting late" message.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      20caec57
    • Alexandre Janniaux's avatar
      clock: setup input-specific clock reset operations · 3614593f
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      No functional changes for now. The function will be implemented
      differently for the input vlc_clock, so that it always a source of new
      clock context, while the reset of the output clocks will allow selecting
      a newer clock context insteand.
      3614593f
    • Alexandre Janniaux's avatar
      input: es_out: use specific clock reset instead of clock-bus · 7c4157a6
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      vlc_clock_main_Reset() breaks the information inside clock context and
      it makes tracking the context switching harder. By using the
      clock-specific reset function, we'll be able to setup the behaviour of
      the input clock being reset and handle the creation of a new context
      instead.
      7c4157a6
    • Alexandre Janniaux's avatar
      clock: remove wait_sync_ref assignment in slave_reset · 489a2031
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      wait_sync_ref should not be reset when resetting a derived clock. The
      clock bus should instead accept multiple possible time and choose the
      best start time for the given context, and reset() should only allow the
      clock to switch context.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      489a2031
    • Thomas Guillem's avatar
      clock: don't create wait_sync_ref from slave updates · 7a9cc359
      Thomas Guillem authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      We want every outputs to update their points, but they might be forced
      (like the first video picture). Since a valid update follow a convert,
      we prefer to only create wait_sync_ref from convert.
      
      This will be clear with the upcoming vlc_clock_Start rework (the
      wait_sync_ref point will be always created from this upcoming function).
      
      Co-authored-by: Alexandre Janniaux's avatarAlexandre Janniaux <ajanni@videolabs.io>
      7a9cc359
    • Alexandre Janniaux's avatar
      test: clock: call SetFirstPCR in convert_paused_common · b48fc809
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      The initialization of the clock was missing in the test, which was not
      an issue before but will be in the next commits.
      b48fc809
    • Alexandre Janniaux's avatar
      clock: setup monotonic wait_sync_ref start in vlc_clock_Start() · 27ace9d2
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      Previously, calling vlc_clock_ConvertToSystem was the only way to
      initialize the monotonic wait_sync_ref point which will be used to start
      the outputs. The rationale for that is written in commit:
      
          commit 491b48a6
          Author: Thomas Guillem <thomas@gllm.fr>
          Date:   Thu Oct 10 17:25:51 2019 +0200
      
              clock: fix false start with some SPU tracks
      
              Reminder of the design: Any calls to vlc_clock_ConvertToSystem() or
              vlc_clock_Update() will create the reference point (wait_sync_ref) if it is the
              first call of all sub clocks. This point will be used as a reference by all
              clocks until the master does its first vlc_clock_Update().
      
              Creating a reference point from vlc_clock_ConvertToSystem() can be discussed.
              You don't expect to modify the main_clock from a function with such name
              ("convert"). The pro of this design is that vlc_clock_ConvertToSystem() can't
              fail and will always return a valid point. Returning a valid point is
              mandatory for the actual design, let's see how the audio output is using it:
      
              The aout will first call vlc_clock_ConvertToSystem(ts) to get the first system
              date of the ts, this first system date will take into account the output
              dejitter, the input dejitter and the pcr_delay int and will be very likely in
              the future. Enough in the future to wait for any other tracks. When this system
              date is reached by the aout plugin, the aout will call the first update() and
              will drive all other clocks.
              ...
      
      Nowadays, two startup modes can be highlighted for the clock:
      
       - Either the input clock drives the clock bus and we have a reference
         point from the start of the stream in the next patches, so we don't
         use the monotonic start to setup the first clock points.
      
       - Or one of the outputs will drive the clock bus and we setup the first
         time conversion for those output depending on the input start, the
         clock priorities (added in 491b48a6).
      
      In the second point, it can only happen at the beginning of the
      elementary stream, or after a proper flush/seek. By calling a
      vlc_clock_Start function instead, we make it clearer that some setup
      will be done, and we can log those points to trace the startup
      conditions.
      
      The code is extracted from the current vlc_clock_ConvertToSystem startup
      mechanism but has been heavily documented to replace the "Fixup: remove"
      comment.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      27ace9d2
    • Alexandre Janniaux's avatar
      test: add clock_start test · 324d1a55
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      The test is extending the current clock.c test but is specifically
      designed to check the clock startup scenarios. Those tests are also
      matching with the "SCENARIO_RUN" case in the clock.c test.
      
      It doesn't need the tracer infrastructure to run.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      324d1a55
    • Alexandre Janniaux's avatar
      clock: compute offset from start_time · e583c632
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      Previously, the clock was driven by two values: coeff and offset. The
      idea was that since the clock is supposed to look like an affine line,
      we could extrapolate any `ts` media point into `ts * coeff + offset` in
      system time.
      
      It meant that offset could take any value depending on the difference
      between system time and media time, reducing the interpretability of the
      values.
      
      After this patch, offset is computed from the start of the stream, so
      it will basically only include the difference between the timestamp
      computation and the real clock.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      e583c632
    • Alexandre Janniaux's avatar
      clock: clock_master: report 0 as drift · 0ec64c5b
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      ...instead of VLC_TICK_INVALID. Drift is a time difference and a 
      reference clock is never drifting.
      0ec64c5b
    • Alexandre Janniaux's avatar
      clock: use 0 instead of VLC_TICK_INVALID for offset · 67ec80ac
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      Offset is a time difference, so it should really be initialized to 0 and
      not VLC_TICK_INVALID.
      67ec80ac
    • Alexandre Janniaux's avatar
      clock: reset by computing offset from coeff · 90a94a03
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      Resetting the main_clock breaks the clock context information,
      especially regarding startup and monotonic synchronization. We only want
      to reset the coefficient to 1.f, and recompute the offset accordingly.
      90a94a03
    • Alexandre Janniaux's avatar
      clock: implement vlc_clock_Start · 47e7a4d2
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      This commit creates a new way in the clock system to intercept the
      behaviour of the "startup" depending on whether the clock is for the
      input or the output and whether it's a reference clock or a derived one.
      Allowing to specify this behaviour contributes to unify the usage of the
      clock, so that it's easier to use in the future (think start() with the
      current time and startup PCR as planned vs SetFirstPCR() with a
      corrected startup time and the last PCR received). It also contributes
      to improve the cases where the input is a reference clock and paced by
      the source.
      
      The es_out is handling the current startup sequence for the clock by
      resetting the clock, shifting the input clock and setting the startup
      time again. Those functions are mixing three different components and
      behaviour and makes it hard to test the startup scenarios.
      
      vlc_clock_Start() on the input vlc_clock_t will replace those calls by
      providing the correct offset on the output points instead of
      transforming the input points.
      
      In addition, vlc_clock_Start() will be provided to the output clocks so
      that they can provide the wait_sync reference point, instead of relying
      on the first conversion done, and specify the exact startup time for the
      output clocks by computing the additional delay at the moment the
      playback really starts.
      
      Like first_pcr, start_time must be shifted when pause is set. It would
      also be possible to "reset" the start_time when un-pausing to the
      un-pause date.
      
      Note that this commit doesn't change the behaviour yet, and the
      consequences it brings will be seen when SetFirstPCR is effectively
      removed. Current case coverage is also quite low in tests, so failures
      would happen without SetFirstPCR in a random way.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      47e7a4d2
    • Alexandre Janniaux's avatar
      clock: factor the offset computation · 2682cfca
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      We'll be changing the way the offset is computed, and reproduce the
      computation at multiple locations. Factoring the computation in a
      function will allow to simplify the rest of the changes.
      2682cfca
    • Alexandre Janniaux's avatar
      es_out: reset main clock with input clock · 6b4f8837
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      Currently, the main clock is reset once the new buffering is done. This
      buffering step will happen at the following locations:
       - at the beginning of a playback
       - when a seek is triggered by the user
       - when the demux needs to trigger RESET_PCR
      
      But the input clock was already reset at this location and will start to
      provide new points. Resetting the clock there as well as when the
      buffering is done currently changes nothing because we either have
      already flushed everything (seek or RESET_PCR) or we are not running
      through a clock (frame-by-frame mode).
      
      However, future patches will remove the clock reset at the end of the
      buffering and expect the clock to be already reset, to introduce a start
      function for the clock.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      6b4f8837
    • Alexandre Janniaux's avatar
      test_log: move to stderr · f0e42789
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      Logging to stdout makes weird log interlacing with console logger which
      outputs to stderr, and makes it less easy to track synchronize in the
      test log file.
      f0e42789
    • Alexandre Janniaux's avatar
      es_out: remove wake-up delay · 7ed71b86
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      The delay is added to specify some margin for the start but we actually
      want to register the real startup date, since it will be accounted to
      startup the monotonic clock and prepare the playback offset from the
      input clock.
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      7ed71b86
    • Alexandre Janniaux's avatar
      test: clock: add logging · eabf767a
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      eabf767a
    • Alexandre Janniaux's avatar
      test: clock: increase time difference · 02e7a863
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      Using 100 ticks instead of 1 tick allows differentiating
      off-by-VLC_TICK_0 errors from pause not working correctly.
      02e7a863
    • Alexandre Janniaux's avatar
      test: store input vlc_clock · 5fa84df1
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      The input vlc_clock will be used to define start_date for the playback
      timeline, when vlc_clock_Start() operation will be introduced.
      5fa84df1
    • Alexandre Janniaux's avatar
      test: clock: specify start date for run tests · ea2750ff
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      Make sure the start date is always defined for CLOCK_SCENARIO_RUN tests
      so that the proper first PCR is defined.
      ea2750ff
    • Alexandre Janniaux's avatar
      clock: remove extra line · 5b3724c8
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      5b3724c8
    • Kartik Dua's avatar
      Lua : replace recursive logic with iterative approach · 33e05c84
      Kartik Dua authored and Steve Lhomme's avatar Steve Lhomme committed
      Converted recursive implementation to an iterative one to prevent
      stack overflows from deeply nested calls. This enhances stability
      and ensures safer execution for long sequences.
      33e05c84
    • Ash's avatar
      qml: add missing Widgets namespace in MainViewLoader · fd2b0239
      Ash authored and Steve Lhomme's avatar Steve Lhomme committed
      Signed-off by: Ash <ashutoshv191@gmail.com>
      fd2b0239
    • François Cartegnie's avatar
      demux: ts: remove leftoff warning · ed6277fa
      François Cartegnie authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      ed6277fa
  4. Apr 11, 2025
    • Alexandre Janniaux's avatar
      demux: mock: fix track pts when periods are not matching · 7dad039d
      Alexandre Janniaux authored and Steve Lhomme's avatar Steve Lhomme committed
      In the default config, audio packets are 40ms long and video is 25/1
      frame per seconds, so frames are displayed every 40ms. When changing
      framerate to 50/1, everything still works correctly and the DemuxVideo
      call will generate two frames for one audio packet, and the sys->clock
      accumulator will move forward 40ms too.
      
      However, when using any frame rate value that would make 40ms not
      divisible by the video frame duration, eg. 60/1fps which is a period of
      16.666ms, then the video would drift apart from the other tracks.
      Symmetrically, when using any frame rate value < 25/1 that would not be
      divisible by 40ms, the audio would drift apart from the other tracks.
      
      It came from the fact that video and audio were allowed to move forward
      the same amount starting from their previous pts value, which is not the
      same starting point for each track in case the divisibility condition is
      not met.
      
      The following graph represents the situation by drawing the two tracks
      with different origins to show how the video makes more progress than
      the audio in the case audio has 40ms packet and video is 60/1fps.
      
              PTS                           video
              ^               audio            *   --+
              |                  *            /      | We go further than the
              |                 /            *       | audio track here. But
              |                /            /        | we'll continue sending
              |               /            *       --+ packets by group of 3.
              |              /            /
              |             *            *
              |            /            /
              |           /            *
              |          /            /
              |         /            *
              |        *            /
              |       /            *      --+
              |      /            /         | This shows we can generate three
              |     /            *          | video packet for each audio
              |    /            /           | packet in the current state.
              |   *            *          --+
              |  /            /
              +---------------------------------------->ts
      
      By keeping the track-specific start point, we don't miss any value, and
      by setting the maximum date from sys->clock instead of the
      track-specific start point, we ensure we don't send more packets than
      wanted.
      
      Fix #29122
      7dad039d
Loading