summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Konstantinov <ilya.konstantinov@gmail.com>2015-04-15 20:13:27 +0300
committerArun Raghavan <git@arunraghavan.net>2015-07-09 19:49:26 +0530
commitc1634c6008808ca3fc4ce162d3cf4d28180048e9 (patch)
tree782233531c74ea1845133a2e6eec310d09aa33e3
parente9d7e021f57500e45da396e18676f122cc1fa6a4 (diff)
osxaudiosrc: no resampling on OS Xosxaudio
Unlike Remote IO, AUHAL doesn't have built-in resampling for sources -- confirmed by Core Audio engineer Doug Wyatt: http://lists.apple.com/archives/coreaudio-api/2006/Sep/msg00088.html https://bugzilla.gnome.org/show_bug.cgi?id=743758
-rw-r--r--sys/osxaudio/gstosxcoreaudio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/osxaudio/gstosxcoreaudio.c b/sys/osxaudio/gstosxcoreaudio.c
index 9dd75325f..d516e6d20 100644
--- a/sys/osxaudio/gstosxcoreaudio.c
+++ b/sys/osxaudio/gstosxcoreaudio.c
@@ -624,6 +624,21 @@ gst_core_audio_probe_caps (GstCoreAudio * core_audio, GstCaps * in_caps)
gst_structure_remove_field (out_s, "channel-mask");
}
+#ifndef HAVE_IOS
+ if (core_audio->is_src && got_outer_asbd
+ && outer_asbd.mSampleRate != kAudioStreamAnyRate) {
+ /* According to Core Audio engineer, AUHAL does not support sample rate conversion.
+ * on sources. Therefore, we fixate the sample rate.
+ *
+ * "You definitely cannot do rate conversion as part of getting input from AUHAL.
+ * That's the most common cause of those "cannot do in current context" errors."
+ * http://lists.apple.com/archives/coreaudio-api/2006/Sep/msg00088.html
+ */
+ gst_structure_set (out_s, "rate", G_TYPE_INT,
+ (gint) outer_asbd.mSampleRate, NULL);
+ }
+#endif
+
/* Special cases for upmixing and downmixing.
* Other than that, the AUs don't upmix or downmix multi-channel audio,
* e.g. if you push 5.1-surround audio to a stereo configuration,