@@ -135,7 +135,7 @@ class OpusAudioDecoder : public AudioDecoder {
135
135
void setOutputStream (Print &out_stream) override { p_print = &out_stream; }
136
136
137
137
void setNotifyAudioChange (AudioInfoDependent &bi) override {
138
- this ->bid = &bi;
138
+ this ->p_notify = &bi;
139
139
}
140
140
141
141
AudioInfo audioInfo () override { return cfg; }
@@ -144,11 +144,12 @@ class OpusAudioDecoder : public AudioDecoder {
144
144
OpusSettings &config () { return cfg; }
145
145
OpusSettings &defaultConfig () { return cfg; }
146
146
147
- void begin (OpusSettings info ) {
147
+ void begin (OpusSettings settings ) {
148
148
TRACED ();
149
- cfg = info;
150
- if (bid != nullptr ) {
151
- bid->setAudioInfo (cfg);
149
+ AudioDecoder::setAudioInfo (settings);
150
+ cfg = settings;
151
+ if (p_notify != nullptr ) {
152
+ p_notify->setAudioInfo (cfg);
152
153
}
153
154
begin ();
154
155
}
@@ -178,6 +179,8 @@ class OpusAudioDecoder : public AudioDecoder {
178
179
}
179
180
180
181
void setAudioInfo (AudioInfo from) override {
182
+ AudioDecoder::setAudioInfo (from);
183
+ info = from;
181
184
cfg.sample_rate = from.sample_rate ;
182
185
cfg.channels = from.channels ;
183
186
cfg.bits_per_sample = from.bits_per_sample ;
@@ -205,7 +208,6 @@ class OpusAudioDecoder : public AudioDecoder {
205
208
206
209
protected:
207
210
Print *p_print = nullptr ;
208
- AudioInfoDependent *bid = nullptr ;
209
211
OpusSettings cfg;
210
212
OpusDecoder *dec;
211
213
bool active;
0 commit comments