[vlc-commits] [Git][videolan/vlc][master] 3 commits: avsb: also set the stopped state when flushed
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Jul 5 04:05:30 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
a0c716f0 by Thomas Guillem at 2024-07-05T03:50:08+00:00
avsb: also set the stopped state when flushed
And reset it on the first play.
The whenDataReady() callback could be stuck from a flush.
- - - - -
1863e112 by Thomas Guillem at 2024-07-05T03:50:08+00:00
avsb: fix data-race with _outChain
It is read/write from the _dataQueue thread.
- - - - -
ff99fc24 by Thomas Guillem at 2024-07-05T03:50:08+00:00
avsb: remove intermediate function
- - - - -
1 changed file:
- modules/audio_output/apple/avsamplebuffer.m
Changes:
=====================================
modules/audio_output/apple/avsamplebuffer.m
=====================================
@@ -110,13 +110,6 @@ API_AVAILABLE(macos(MIN_MACOS), ios(MIN_IOS), tvos(MIN_TVOS) VISIONOS_API_AVAILA
block_ChainRelease(_outChain);
}
-- (void)clearOutChain
-{
- block_ChainRelease(_outChain);
- _outChain = NULL;
- _outChainLast = &_outChain;
-}
-
static void
customBlock_Free(void *refcon, void *doomedMemoryBlock, size_t sizeInBytes)
{
@@ -276,6 +269,8 @@ customBlock_Free(void *refcon, void *doomedMemoryBlock, size_t sizeInBytes)
if (_ptsSamples == -1)
{
+ _stopped = NO;
+
__weak typeof(self) weakSelf = self;
[_renderer requestMediaDataWhenReadyOnQueue:_dataQueue usingBlock:^{
[weakSelf whenDataReady];
@@ -317,18 +312,21 @@ customBlock_Free(void *refcon, void *doomedMemoryBlock, size_t sizeInBytes)
[_renderer stopRequestingMediaData];
[_renderer flush];
- [self clearOutChain];
+ vlc_mutex_lock(&_bufferLock);
+ _stopped = YES;
+
+ block_ChainRelease(_outChain);
+ _outChain = NULL;
+ _outChainLast = &_outChain;
+
+ vlc_cond_signal(&_bufferWait);
+ vlc_mutex_unlock(&_bufferLock);
}
- (void)stop
{
NSNotificationCenter *notifCenter = [NSNotificationCenter defaultCenter];
- vlc_mutex_lock(&_bufferLock);
- _stopped = YES;
- vlc_cond_signal(&_bufferWait);
- vlc_mutex_unlock(&_bufferLock);
-
if (_ptsSamples > 0)
[self stopSyncRenderer];
@@ -432,8 +430,6 @@ customBlock_Free(void *refcon, void *doomedMemoryBlock, size_t sizeInBytes)
[_sync addRenderer:_renderer];
- _stopped = NO;
-
_ptsSamples = -1;
_firstPts = VLC_TICK_INVALID;
_sampleRate = fmt->i_rate;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f878115e184a4d896e4df39bccbde32ea6d9357c...ff99fc24998df86b3d46c8225d108463984a0f4e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f878115e184a4d896e4df39bccbde32ea6d9357c...ff99fc24998df86b3d46c8225d108463984a0f4e
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