[vlc-commits] [Git][videolan/vlc][master] 2 commits: aout: don't update the clock while stopping

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Wed Jul 26 15:38:34 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
3469a537 by Thomas Guillem at 2023-07-26T15:18:24+00:00
aout: don't update the clock while stopping

This fixes the following assert:

src/player/timer.c:301: void vlc_player_UpdateTimer(vlc_player_t *, vlc_es_id_t *, _Bool, const struct vlc_player_timer_point *, vlc_tick_t, unsigned int, unsigned int): assertion "point->ts != VLC_TICK_INVALID" failed

- - - - -
fa9f010c by Thomas Guillem at 2023-07-26T15:18:24+00:00
audiotrack: check timestamp position

This also fixes the assert from the previous commit. The combination of
the 2 bugs caused the assert.

- - - - -


2 changed files:

- modules/audio_output/android/audiotrack.c
- src/audio_output/dec.c


Changes:

=====================================
modules/audio_output/android/audiotrack.c
=====================================
@@ -1228,6 +1228,8 @@ AudioTrack_ReportTiming( JNIEnv *env, aout_stream_t *stream )
         vlc_tick_t frame_date_us =
             VLC_TICK_FROM_NS(JNI_AUDIOTIMESTAMP_GET_LONG( nanoTime ));
         jlong frame_post_last = JNI_AUDIOTIMESTAMP_GET_LONG( framePosition );
+        if( frame_post_last == 0 )
+            return VLC_EGENERIC;
 
         /* the low-order 32 bits of position is in wrapping frame units
          * similar to AudioTrack#getPlaybackHeadPosition. */


=====================================
src/audio_output/dec.c
=====================================
@@ -671,6 +671,16 @@ void vlc_aout_stream_NotifyTiming(vlc_aout_stream *stream, vlc_tick_t system_ts,
                                   vlc_tick_t audio_ts)
 {
     vlc_mutex_lock(&stream->timing.lock);
+
+    if (unlikely(stream->timing.first_pts == VLC_TICK_INVALID))
+    {
+        /* While closing the stream, it is possible (but unlikely) that the
+         * module updates a timing point just after the stream is reset, and
+         * just before the module is stopped. */
+        vlc_mutex_unlock(&stream->timing.lock);
+        return;
+    }
+
     vlc_tick_t rate_audio_ts = stream->timing.rate_audio_ts;
     vlc_tick_t rate_system_ts = stream->timing.rate_system_ts;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ad65c058ddb04a409c412dd56e89fb3109e0f894...fa9f010cb906176fa5703e1555ede00a651a5e06

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