filter/Convert: make in_audio_format const
This commit is contained in:
parent
8a07724b23
commit
00b04468dc
@ -35,7 +35,7 @@ class ConvertFilter final : public Filter {
|
|||||||
* The input audio format; PCM data is passed to the filter()
|
* The input audio format; PCM data is passed to the filter()
|
||||||
* method in this format.
|
* method in this format.
|
||||||
*/
|
*/
|
||||||
AudioFormat in_audio_format;
|
const AudioFormat in_audio_format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This object is only "open" if #in_audio_format !=
|
* This object is only "open" if #in_audio_format !=
|
||||||
@ -76,7 +76,6 @@ public:
|
|||||||
void
|
void
|
||||||
ConvertFilter::Set(const AudioFormat &_out_audio_format)
|
ConvertFilter::Set(const AudioFormat &_out_audio_format)
|
||||||
{
|
{
|
||||||
assert(in_audio_format.IsValid());
|
|
||||||
assert(_out_audio_format.IsValid());
|
assert(_out_audio_format.IsValid());
|
||||||
|
|
||||||
if (_out_audio_format == out_audio_format)
|
if (_out_audio_format == out_audio_format)
|
||||||
@ -100,6 +99,7 @@ ConvertFilter::Set(const AudioFormat &_out_audio_format)
|
|||||||
ConvertFilter::ConvertFilter(const AudioFormat &audio_format)
|
ConvertFilter::ConvertFilter(const AudioFormat &audio_format)
|
||||||
:Filter(audio_format), in_audio_format(audio_format)
|
:Filter(audio_format), in_audio_format(audio_format)
|
||||||
{
|
{
|
||||||
|
assert(in_audio_format.IsValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<Filter>
|
std::unique_ptr<Filter>
|
||||||
@ -112,8 +112,6 @@ PreparedConvertFilter::Open(AudioFormat &audio_format)
|
|||||||
|
|
||||||
ConvertFilter::~ConvertFilter()
|
ConvertFilter::~ConvertFilter()
|
||||||
{
|
{
|
||||||
assert(in_audio_format.IsValid());
|
|
||||||
|
|
||||||
if (IsActive())
|
if (IsActive())
|
||||||
state.Close();
|
state.Close();
|
||||||
}
|
}
|
||||||
@ -121,8 +119,6 @@ ConvertFilter::~ConvertFilter()
|
|||||||
ConstBuffer<void>
|
ConstBuffer<void>
|
||||||
ConvertFilter::FilterPCM(ConstBuffer<void> src)
|
ConvertFilter::FilterPCM(ConstBuffer<void> src)
|
||||||
{
|
{
|
||||||
assert(in_audio_format.IsValid());
|
|
||||||
|
|
||||||
return IsActive()
|
return IsActive()
|
||||||
? state.Convert(src)
|
? state.Convert(src)
|
||||||
/* optimized special case: no-op */
|
/* optimized special case: no-op */
|
||||||
|
Loading…
Reference in New Issue
Block a user