NetEqImpl::GetDecoderFormat: Return RTP clockrate, not codec sample rate
Well, in fact we need to return both. But return codec sample rate
separately and let the SdpAudioFormat contain the RTP clockrate,
otherwise we're essentially lying to our callers.
Bug: webrtc:11028
Change-Id: I40f36cb9db6b9824404ade6b0515a8312ff97009
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156307
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29444}
diff --git a/modules/audio_coding/acm2/acm_receiver.h b/modules/audio_coding/acm2/acm_receiver.h
index f07f8a9..1512656 100644
--- a/modules/audio_coding/acm2/acm_receiver.h
+++ b/modules/audio_coding/acm2/acm_receiver.h
@@ -203,11 +203,17 @@
void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const;
private:
+ struct DecoderInfo {
+ int payload_type;
+ int sample_rate_hz;
+ int num_channels;
+ SdpAudioFormat sdp_format;
+ };
+
uint32_t NowInTimestamp(int decoder_sampling_rate) const;
rtc::CriticalSection crit_sect_;
- absl::optional<std::pair<int, SdpAudioFormat>> last_decoder_
- RTC_GUARDED_BY(crit_sect_);
+ absl::optional<DecoderInfo> last_decoder_ RTC_GUARDED_BY(crit_sect_);
ACMResampler resampler_ RTC_GUARDED_BY(crit_sect_);
std::unique_ptr<int16_t[]> last_audio_buffer_ RTC_GUARDED_BY(crit_sect_);
CallStatistics call_stats_ RTC_GUARDED_BY(crit_sect_);