PulseAudio update for input buffer size support.
authorGary Scavone <gary@music.mcgill.ca>
Fri, 27 Dec 2013 23:09:26 +0000 (15:09 -0800)
committerGary Scavone <gary@music.mcgill.ca>
Fri, 27 Dec 2013 23:09:26 +0000 (15:09 -0800)
RtAudio.cpp

index 7e04e98f6cc288829d2710e831dc5786f069b2e8..baaf24eab340d848842091b94ce0dba1379627e6 100644 (file)
@@ -6816,9 +6816,15 @@ bool RtApiPulse::probeDeviceOpen( unsigned int device, StreamMode mode,
   pah = static_cast<PulseAudioHandle *>( stream_.apiHandle );\r
 \r
   int error;\r
+  std::string streamName = "RtAudio";\r
+  if ( !options->streamName.empty() ) streamName = options->streamName;\r
   switch ( mode ) {\r
   case INPUT:\r
-    pah->s_rec = pa_simple_new( NULL, "RtAudio", PA_STREAM_RECORD, NULL, "Record", &ss, NULL, NULL, &error );\r
+    pa_buffer_attr buffer_attr;\r
+    buffer_attr.fragsize = bufferBytes;\r
+    buffer_attr.maxlength = -1;\r
+\r
+    pah->s_rec = pa_simple_new( NULL, streamName.c_str(), PA_STREAM_RECORD, NULL, "Record", &ss, NULL, &buffer_attr, &error );\r
     if ( !pah->s_rec ) {\r
       errorText_ = "RtApiPulse::probeDeviceOpen: error connecting input to PulseAudio server.";\r
       goto error;\r