Skip to content

Commit

Permalink
Fix #2106, #2011, RTMP/AAC transcode to Opus bug. 4.0.81
Browse files Browse the repository at this point in the history
  • Loading branch information
PieerePi authored and winlinvip committed Mar 3, 2021
1 parent 93c024c commit 4cf1697
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ For previous versions, please read:

## V4 changes

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

[exo #828]: https://github.com/google/ExoPlayer/pull/828
Expand Down
9 changes: 5 additions & 4 deletions trunk/src/app/srs_app_rtc_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ srs_error_t SrsAudioDecoder::decode(SrsSample *pkt, char *buf, int &size)
return srs_error_new(ERROR_RTC_RTP_MUXER, "Failed to calculate data size");
}

for (int i = 0; i < frame_->nb_samples; i++) {
if (size + pcm_size * codec_ctx_->channels <= max) {
memcpy(buf + size,frame_->data[0] + pcm_size*codec_ctx_->channels * i, pcm_size * codec_ctx_->channels);
size += pcm_size * codec_ctx_->channels;
// @see https://github.com/ossrs/srs/pull/2011/files
for (int i = 0; i < codec_ctx_->channels; i++) {
if (size + pcm_size * frame_->nb_samples <= max) {
memcpy(buf + size,frame_->data[i],pcm_size * frame_->nb_samples);
size += pcm_size * frame_->nb_samples;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core_version4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
#ifndef SRS_CORE_VERSION4_HPP
#define SRS_CORE_VERSION4_HPP

#define SRS_VERSION4_REVISION 80
#define SRS_VERSION4_REVISION 81

#endif

0 comments on commit 4cf1697

Please sign in to comment.