Skip to content

Commit

Permalink
RTC: Ignore empty audio packet when transcoding (#2757). v4.0.202
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Dec 4, 2021
1 parent 2c0cd9b commit 4e64c66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions trunk/doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The changelog for SRS.

## SRS 4.0 Changelog

* v4.0, 2021-12-04, Merge [#2757](https://github.com/ossrs/srs/pull/2757): RTC: Ignore empty audio packet when transcoding (#2757). v4.0.202
* v4.0, 2021-12-01, Fix [#2762](https://github.com/ossrs/srs/pull/2762): RTC: Refine publish security error message (#2762). v4.0.200
* v4.0, 2021-11-25, Merge [#2751](https://github.com/ossrs/srs/pull/2751): RTC: Fix crash when pkt->payload() if pkt is nullptr (#2751). v4.0.199
* v4.0, 2021-11-15, For [#1708](https://github.com/ossrs/srs/pull/1708): ST: Print log when multiple thread stop one coroutine. (#1708). v4.0.198
Expand Down
12 changes: 4 additions & 8 deletions trunk/src/app/srs_app_rtc_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,12 @@ srs_error_t SrsAudioTranscoder::decode_and_resample(SrsAudioFrame *pkt)
dec_packet_->data = (uint8_t *)pkt->samples[0].bytes;
dec_packet_->size = pkt->samples[0].size;

char err_buf[AV_ERROR_MAX_STRING_SIZE] = {0};


if (dec_packet_->data == NULL || dec_packet_->size == 0){
return srs_error_new(ERROR_RTC_INVALID_PARAMS,
"dec_pakcet is invalide(dec_packet_->data: %p, dec_packet_->size: %d)",
dec_packet_->data, (int) dec_packet_->size);
// Ignore empty packet, see https://github.com/ossrs/srs/pull/2757#discussion_r759797651
if (!dec_packet_->data || !dec_packet_->size){
return err;
}


char err_buf[AV_ERROR_MAX_STRING_SIZE] = {0};
int error = avcodec_send_packet(dec_, dec_packet_);
if (error < 0) {
return srs_error_new(ERROR_RTC_RTP_MUXER, "submit to dec(%d,%s)", error,
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 @@ -9,6 +9,6 @@

#define VERSION_MAJOR 4
#define VERSION_MINOR 0
#define VERSION_REVISION 201
#define VERSION_REVISION 202

#endif

0 comments on commit 4e64c66

Please sign in to comment.