mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
avfvideosrc: fix unconditional buffer queue unlock
Unless stopRequest is set, we should unlock conditionally -- otherwise, the 'create:' method can wake up to an empty buffer queue and pull a nil buffer. https://bugzilla.gnome.org/show_bug.cgi?id=748054
This commit is contained in:
parent
6007829e77
commit
c948484c7f
1 changed files with 2 additions and 2 deletions
|
@ -824,7 +824,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||||
{
|
{
|
||||||
[bufQueueLock lock];
|
[bufQueueLock lock];
|
||||||
stopRequest = NO;
|
stopRequest = NO;
|
||||||
[bufQueueLock unlock];
|
[bufQueueLock unlockWithCondition:([bufQueue count] == 0) ? NO_BUFFERS : HAS_BUFFER_OR_STOP_REQUEST];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
@ -862,7 +862,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||||
[self getSampleBuffer:sampleBuffer timestamp:×tamp duration:&duration];
|
[self getSampleBuffer:sampleBuffer timestamp:×tamp duration:&duration];
|
||||||
|
|
||||||
if (timestamp == GST_CLOCK_TIME_NONE) {
|
if (timestamp == GST_CLOCK_TIME_NONE) {
|
||||||
[bufQueueLock unlock];
|
[bufQueueLock unlockWithCondition:([bufQueue count] == 0) ? NO_BUFFERS : HAS_BUFFER_OR_STOP_REQUEST];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue