pcm_convert: removed pcm_convert_size()
The function is unused, since we added the pcm_buffer library.
This commit is contained in:
parent
ac3e2de28b
commit
656d5c9c7b
@ -146,20 +146,3 @@ pcm_convert(struct pcm_convert_state *state,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t pcm_convert_size(const struct audio_format *inFormat, size_t src_size,
|
|
||||||
const struct audio_format *outFormat)
|
|
||||||
{
|
|
||||||
const double ratio = (double)outFormat->sample_rate /
|
|
||||||
(double)inFormat->sample_rate;
|
|
||||||
size_t dest_size = src_size;
|
|
||||||
|
|
||||||
/* no partial frames allowed */
|
|
||||||
assert((src_size % audio_format_frame_size(inFormat)) == 0);
|
|
||||||
|
|
||||||
dest_size /= audio_format_frame_size(inFormat);
|
|
||||||
dest_size = ceil((double)dest_size * ratio);
|
|
||||||
dest_size *= audio_format_frame_size(outFormat);
|
|
||||||
|
|
||||||
return dest_size;
|
|
||||||
}
|
|
||||||
|
@ -48,7 +48,4 @@ pcm_convert(struct pcm_convert_state *state,
|
|||||||
const struct audio_format *dest_format,
|
const struct audio_format *dest_format,
|
||||||
size_t *dest_size_r);
|
size_t *dest_size_r);
|
||||||
|
|
||||||
size_t pcm_convert_size(const struct audio_format *inFormat, size_t inSize,
|
|
||||||
const struct audio_format *outFormat);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user