diff options
author | Ilya Konstantinov <ilya.konstantinov@gmail.com> | 2015-05-07 21:18:27 +0200 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2015-05-11 21:11:30 +1000 |
commit | c948484c7fe764467ee749aa04d02617d8fee591 (patch) | |
tree | e5407c2bf20459a599b788eda450d378f31dff3f /sys | |
parent | 6007829e77b6335b80d66d258013d17cab426707 (diff) | |
download | gstreamer-plugins-bad-c948484c7fe764467ee749aa04d02617d8fee591.tar.gz |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/applemedia/avfvideosrc.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/applemedia/avfvideosrc.m b/sys/applemedia/avfvideosrc.m index 176502adb..00f5c6524 100644 --- a/sys/applemedia/avfvideosrc.m +++ b/sys/applemedia/avfvideosrc.m @@ -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; } |