mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
fix selection of working format
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1881 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
9db42672d4
commit
d7a0876d7f
1 changed files with 63 additions and 60 deletions
|
|
@ -236,11 +236,12 @@ pa_resampler* pa_resampler_new(
|
||||||
if ((resample_method >= PA_RESAMPLER_SPEEX_FIXED_BASE && resample_method <= PA_RESAMPLER_SPEEX_FIXED_MAX) ||
|
if ((resample_method >= PA_RESAMPLER_SPEEX_FIXED_BASE && resample_method <= PA_RESAMPLER_SPEEX_FIXED_MAX) ||
|
||||||
(resample_method == PA_RESAMPLER_FFMPEG))
|
(resample_method == PA_RESAMPLER_FFMPEG))
|
||||||
r->work_format = PA_SAMPLE_S16NE;
|
r->work_format = PA_SAMPLE_S16NE;
|
||||||
else if (resample_method == PA_RESAMPLER_TRIVIAL) {
|
else if (resample_method == PA_RESAMPLER_TRIVIAL || resample_method == PA_RESAMPLER_COPY) {
|
||||||
|
|
||||||
if (r->map_required || a->format != b->format) {
|
if (r->map_required || a->format != b->format) {
|
||||||
|
|
||||||
if (a->format == PA_SAMPLE_FLOAT32NE || a->format == PA_SAMPLE_FLOAT32RE)
|
if (a->format == PA_SAMPLE_FLOAT32NE || a->format == PA_SAMPLE_FLOAT32RE ||
|
||||||
|
b->format == PA_SAMPLE_FLOAT32NE || b->format == PA_SAMPLE_FLOAT32RE)
|
||||||
r->work_format = PA_SAMPLE_FLOAT32NE;
|
r->work_format = PA_SAMPLE_FLOAT32NE;
|
||||||
else
|
else
|
||||||
r->work_format = PA_SAMPLE_S16NE;
|
r->work_format = PA_SAMPLE_S16NE;
|
||||||
|
|
@ -251,6 +252,8 @@ pa_resampler* pa_resampler_new(
|
||||||
} else
|
} else
|
||||||
r->work_format = PA_SAMPLE_FLOAT32NE;
|
r->work_format = PA_SAMPLE_FLOAT32NE;
|
||||||
|
|
||||||
|
pa_log_info("Using %s as working format.", pa_sample_format_to_string(r->work_format));
|
||||||
|
|
||||||
r->w_sz = sample_size(r->work_format);
|
r->w_sz = sample_size(r->work_format);
|
||||||
|
|
||||||
if (r->i_ss.format == r->work_format)
|
if (r->i_ss.format == r->work_format)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue