Skip to content
Snippets Groups Projects
Commit b6940087 authored by Thomas Guillem's avatar Thomas Guillem Committed by Steve Lhomme
Browse files

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
parent 44486475
No related branches found
No related tags found
1 merge request!6047avsb: fix invalid state when stopping/flush
Pipeline #515357 passed with stage
in 13 minutes and 53 seconds
......@@ -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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment