pa_cvolume hardware_volume;
-#ifdef __TIZEN__
+#ifndef __TIZEN__
+ unsigned int *rates;
+#else
pa_sample_format_t *supported_formats;
+ unsigned int *supported_rates;
#endif
- unsigned int *rates;
size_t
frame_size,
* framework, but this must be changed if we do. */
/* Count how many sample rates we support */
+#ifdef __TIZEN__
+ for (idx = 0, n = 0; u->supported_rates[idx]; idx++)
+#else
for (idx = 0, n = 0; u->rates[idx]; idx++)
+#endif
n++;
/* First insert non-PCM formats since we prefer those. */
PA_IDXSET_FOREACH(f, formats, idx) {
if (!pa_format_info_is_pcm(f)) {
g = pa_format_info_copy(f);
+#ifdef __TIZEN__
+ pa_format_info_set_prop_int_array(g, PA_PROP_FORMAT_RATE, (int *) u->supported_rates, n);
+#else
pa_format_info_set_prop_int_array(g, PA_PROP_FORMAT_RATE, (int *) u->rates, n);
+#endif
pa_idxset_put(u->formats, g, NULL);
}
}
pa_assert(u);
+#ifdef __TIZEN__
+ for (i = 0; u->supported_rates[i]; i++) {
+ if (u->supported_rates[i] == spec->rate) {
+#else
for (i = 0; u->rates[i]; i++) {
if (u->rates[i] == spec->rate) {
+#endif
supported = true;
break;
}
goto fail;
}
-#endif
+ u->supported_rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate);
+ if (!u->supported_rates) {
+#else
u->rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate);
if (!u->rates) {
+#endif
pa_log_error("Failed to find any supported sample rates.");
goto fail;
}
u->sink->reconfigure = sink_reconfigure_cb;
u->sink->userdata = u;
#ifdef __TIZEN__
- u->sink->supported_sample_rates = u->rates;
+ u->sink->supported_sample_rates = u->supported_rates;
#endif
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
if (u->supported_formats)
pa_xfree(u->supported_formats);
-#endif
+ if (u->supported_rates)
+ pa_xfree(u->supported_rates);
+#else
if (u->rates)
pa_xfree(u->rates);
+#endif
reserve_done(u);
monitor_done(u);
pa_cvolume hardware_volume;
-#ifdef __TIZEN__
+#ifndef __TIZEN__
+ unsigned int *rates;
+#else
pa_sample_format_t *supported_formats;
+ unsigned int *supported_rates;
#endif
- unsigned int *rates;
size_t
frame_size,
pa_assert(u);
+#ifdef __TIZEN__
+ for (i = 0; u->supported_rates[i]; i++) {
+ if (u->supported_rates[i] == spec->rate) {
+#else
for (i = 0; u->rates[i]; i++) {
if (u->rates[i] == spec->rate) {
+#endif
supported = true;
break;
}
goto fail;
}
-#endif
+ u->supported_rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate);
+ if (!u->supported_rates) {
+#else
u->rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate);
if (!u->rates) {
+#endif
pa_log_error("Failed to find any supported sample rates.");
goto fail;
}
if (u->supported_formats)
pa_xfree(u->supported_formats);
-#endif
+ if (u->supported_rates)
+ pa_xfree(u->supported_rates);
+#else
if (u->rates)
pa_xfree(u->rates);
+#endif
reserve_done(u);
monitor_done(u);