Skip to content

Commit 4cf1697

Browse files
PieerePiwinlinvip
authored andcommitted
Fix #2106, #2011, RTMP/AAC transcode to Opus bug. 4.0.81
1 parent 93c024c commit 4cf1697

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ For previous versions, please read:
157157

158158
## V4 changes
159159

160+
* v4.0, 2021-03-03, Fix [#2106][bug #2106], [#2011][bug #2011], RTMP/AAC transcode to Opus bug. 4.0.81
160161
* v4.0, 2021-03-02, Refine build script for FFmpeg and SRTP. 4.0.80
161162
* v4.0, 2021-03-02, Upgrade libsrtp from 2.0.0 to 2.3.0, with source code. 4.0.79
162163
* v4.0, 2021-03-01, Upgrade openssl from 1.1.0e to 1.1.1b, with source code. 4.0.78
@@ -1824,6 +1825,8 @@ Winlin
18241825
[bug #1657-2]: https://github.com/ossrs/srs/issues/1657#issuecomment-722904004
18251826
[bug #1657-3]: https://github.com/ossrs/srs/issues/1657#issuecomment-722971676
18261827
[bug #1998]: https://github.com/ossrs/srs/issues/1998
1828+
[bug #2106]: https://github.com/ossrs/srs/issues/2106
1829+
[bug #2011]: https://github.com/ossrs/srs/issues/2011
18271830
[bug #zzzzzzzzzzzzz]: https://github.com/ossrs/srs/issues/zzzzzzzzzzzzz
18281831

18291832
[exo #828]: https://github.com/google/ExoPlayer/pull/828

trunk/src/app/srs_app_rtc_codec.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,11 @@ srs_error_t SrsAudioDecoder::decode(SrsSample *pkt, char *buf, int &size)
130130
return srs_error_new(ERROR_RTC_RTP_MUXER, "Failed to calculate data size");
131131
}
132132

133-
for (int i = 0; i < frame_->nb_samples; i++) {
134-
if (size + pcm_size * codec_ctx_->channels <= max) {
135-
memcpy(buf + size,frame_->data[0] + pcm_size*codec_ctx_->channels * i, pcm_size * codec_ctx_->channels);
136-
size += pcm_size * codec_ctx_->channels;
133+
// @see https://github.com/ossrs/srs/pull/2011/files
134+
for (int i = 0; i < codec_ctx_->channels; i++) {
135+
if (size + pcm_size * frame_->nb_samples <= max) {
136+
memcpy(buf + size,frame_->data[i],pcm_size * frame_->nb_samples);
137+
size += pcm_size * frame_->nb_samples;
137138
}
138139
}
139140
}

trunk/src/core/srs_core_version4.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
#ifndef SRS_CORE_VERSION4_HPP
2525
#define SRS_CORE_VERSION4_HPP
2626

27-
#define SRS_VERSION4_REVISION 80
27+
#define SRS_VERSION4_REVISION 81
2828

2929
#endif

0 commit comments

Comments
 (0)