summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-02-05 16:34:27 +0100
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-02-18 13:15:36 +0000
commit656da3d4d60f21914e7f5ea004e8ec924f79ef03 (patch)
tree2438f7bc0cdca97865e91f14353bc6e056a1e2bc /src/plugins
parente47ecb75b5d86af8e861b0331a7ecc2beeb9701d (diff)
GStreamer: improve camerabin audio settings checking.
Don't try setting a sample rate or a channel count equal to 0. Change-Id: Ib2e1728f0d9af09df9c4d3fd1322b5cb174a2981 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
index cbc56f249..356ad8dbd 100644
--- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
@@ -420,7 +420,7 @@ void CameraBinSession::setAudioCaptureCaps()
const int sampleRate = settings.sampleRate();
const int channelCount = settings.channelCount();
- if (sampleRate == -1 && channelCount == -1)
+ if (sampleRate <= 0 && channelCount <=0)
return;
#if GST_CHECK_VERSION(1,0,0)
@@ -434,9 +434,9 @@ void CameraBinSession::setAudioCaptureCaps()
"depth", G_TYPE_INT, 16,
NULL);
#endif
- if (sampleRate != -1)
+ if (sampleRate > 0)
gst_structure_set(structure, "rate", G_TYPE_INT, sampleRate, NULL);
- if (channelCount != -1)
+ if (channelCount > 0)
gst_structure_set(structure, "channels", G_TYPE_INT, channelCount, NULL);
GstCaps *caps = gst_caps_new_full(structure, NULL);