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

avsb: fix timings being reported after a stop

From the removeTimeObserver documentation:

"Upon return, the caller is guaranteed that no new time observer blocks
will begin executing. Depending on the calling thread and the queue used
to add the time observer, an in-flight block may continue to execute
after this method returns. You can guarantee synchronous time observer
removal by enqueuing the call to removeTimeObserver: on that queue. Call
dispatch_sync after removeTimeObserver: to wait for any in-flight blocks
to finish executing."
parent 9dc02d87
No related branches found
No related tags found
1 merge request!5668avsb: fix timings being reported after a stop
Pipeline #487791 passed with stage
in 13 minutes and 35 seconds
......@@ -310,6 +310,10 @@ customBlock_Free(void *refcon, void *doomedMemoryBlock, size_t sizeInBytes)
_sync.rate = 0.0f;
[_sync removeTimeObserver:_observer];
/* From the doc: "Call dispatch_sync after removeTimeObserver: to wait for
* any in-flight blocks to finish executing." */
dispatch_sync(_timeQueue, ^{});
[_renderer stopRequestingMediaData];
[_renderer flush];
......
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