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
@ -824,7 +824,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||
{
|
||||
[bufQueueLock lock];
|
||||
stopRequest = NO;
|
||||
[bufQueueLock unlock];
|
||||
[bufQueueLock unlockWithCondition:([bufQueue count] == 0) ? NO_BUFFERS : HAS_BUFFER_OR_STOP_REQUEST];
|
||||
|
||||
return YES;
|
||||
}
|
||||
@ -862,7 +862,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||
[self getSampleBuffer:sampleBuffer timestamp:×tamp duration:&duration];
|
||||
|
||||
if (timestamp == GST_CLOCK_TIME_NONE) {
|
||||
[bufQueueLock unlock];
|
||||
[bufQueueLock unlockWithCondition:([bufQueue count] == 0) ? NO_BUFFERS : HAS_BUFFER_OR_STOP_REQUEST];
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user