[vlc-commits] [Git][videolan/vlc][master] avsb: fix invalid state when stopping/flush

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Sep 19 05:42:22 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
b6940087 by Thomas Guillem at 2024-09-19T05:22:04+00:00
avsb: fix invalid state when stopping/flush

In some corner cases where the module is flushed more than one times in
a raw, it was possible that the renderer and observer were first started
during the stop process

- - - - -


1 changed file:

- modules/audio_output/apple/avsamplebuffer.m


Changes:

=====================================
modules/audio_output/apple/avsamplebuffer.m
=====================================
@@ -279,7 +279,7 @@ customBlock_Free(void *refcon, void *doomedMemoryBlock, size_t sizeInBytes)
 
     while (_renderer.readyForMoreMediaData || !_dateReached)
     {
-        if (!_dateReached)
+        if (!_dateReached && !_stopped)
         {
             /* Start playback at the requested date */
 
@@ -307,7 +307,7 @@ customBlock_Free(void *refcon, void *doomedMemoryBlock, size_t sizeInBytes)
                     deadline = _lastDate - writtenTicks;
                 }
 
-                if (timeout != 0)
+                if (timeout != 0 && !_stopped)
                 {
                     msg_Dbg(_aout, "started");
                     [self startNow:0];
@@ -377,12 +377,12 @@ customBlock_Free(void *refcon, void *doomedMemoryBlock, size_t sizeInBytes)
 
 - (void)stopSyncRenderer
 {
+    vlc_mutex_lock(&_bufferLock);
     _sync.rate = 0.0f;
 
     [_renderer stopRequestingMediaData];
     [_renderer flush];
 
-    vlc_mutex_lock(&_bufferLock);
     if (_dateReached)
         [_sync removeTimeObserver:_observer];
 



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

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