1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #2516, fix codec issue for G.711 or H.263. 4.0.152

This commit is contained in:
Haibo Chen 2021-08-13 12:05:28 +08:00 committed by winlin
parent 452ca7e88f
commit ab988abc59
5 changed files with 28 additions and 5 deletions

View file

@ -6,6 +6,7 @@ The changelog for SRS.
## SRS 4.0 Changelog ## SRS 4.0 Changelog
* v4.0, 2021-08-13, RTC: Merge [#2526](https://github.com/ossrs/srs/pull/2526), fix codec issue for G.711 or H.263. 4.0.152
* v4.0, 2021-08-10, RTC: Merge [#2509](https://github.com/ossrs/srs/pull/2514), support http hooks n_play/stop/publish/unpublish. 4.0.151 * v4.0, 2021-08-10, RTC: Merge [#2509](https://github.com/ossrs/srs/pull/2514), support http hooks n_play/stop/publish/unpublish. 4.0.151
* v4.0, 2021-08-07, Merge [#2514](https://github.com/ossrs/srs/pull/2514), Get original client ip instead of proxy ip, for rtc api #2514. 4.0.150 * v4.0, 2021-08-07, Merge [#2514](https://github.com/ossrs/srs/pull/2514), Get original client ip instead of proxy ip, for rtc api #2514. 4.0.150
* v4.0, 2021-08-07, Fix [#2508](https://github.com/ossrs/srs/pull/2508), Support features query by API. 4.0.149 * v4.0, 2021-08-07, Fix [#2508](https://github.com/ossrs/srs/pull/2508), Support features query by API. 4.0.149

View file

@ -540,7 +540,11 @@ srs_error_t SrsDash::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* form
if (!enabled) { if (!enabled) {
return err; return err;
} }
if (!format->acodec) {
return err;
}
if ((err = controller->on_audio(shared_audio, format)) != srs_success) { if ((err = controller->on_audio(shared_audio, format)) != srs_success) {
return srs_error_wrap(err, "Consume audio failed"); return srs_error_wrap(err, "Consume audio failed");
} }
@ -555,7 +559,11 @@ srs_error_t SrsDash::on_video(SrsSharedPtrMessage* shared_video, SrsFormat* form
if (!enabled) { if (!enabled) {
return err; return err;
} }
if (!format->vcodec) {
return err;
}
if ((err = controller->on_video(shared_video, format)) != srs_success) { if ((err = controller->on_video(shared_video, format)) != srs_success) {
return srs_error_wrap(err, "Consume video failed"); return srs_error_wrap(err, "Consume video failed");
} }

View file

@ -931,6 +931,12 @@ srs_error_t SrsOriginHub::on_audio(SrsSharedPtrMessage* shared_audio)
if ((err = format->on_audio(msg)) != srs_success) { if ((err = format->on_audio(msg)) != srs_success) {
return srs_error_wrap(err, "format consume audio"); return srs_error_wrap(err, "format consume audio");
} }
// Ignore if no format->acodec, it means the codec is not parsed, or unsupport/unknown codec
// such as G.711 codec
if (!format->acodec) {
return err;
}
// cache the sequence header if aac // cache the sequence header if aac
// donot cache the sequence header to gop_cache, return here. // donot cache the sequence header to gop_cache, return here.

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 4 #define VERSION_MAJOR 4
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 151 #define VERSION_REVISION 152
#endif #endif

View file

@ -3064,7 +3064,11 @@ srs_error_t SrsTsTransmuxer::write_audio(int64_t timestamp, char* data, int size
if ((err = format->on_audio(timestamp, data, size)) != srs_success) { if ((err = format->on_audio(timestamp, data, size)) != srs_success) {
return srs_error_wrap(err, "ts: format on audio"); return srs_error_wrap(err, "ts: format on audio");
} }
if (!format->acodec) {
return err;
}
// ts support audio codec: aac/mp3 // ts support audio codec: aac/mp3
srs_assert(format->acodec && format->audio); srs_assert(format->acodec && format->audio);
if (format->acodec->id != SrsAudioCodecIdAAC && format->acodec->id != SrsAudioCodecIdMP3) { if (format->acodec->id != SrsAudioCodecIdAAC && format->acodec->id != SrsAudioCodecIdMP3) {
@ -3100,7 +3104,11 @@ srs_error_t SrsTsTransmuxer::write_video(int64_t timestamp, char* data, int size
if ((err = format->on_video(timestamp, data, size)) != srs_success) { if ((err = format->on_video(timestamp, data, size)) != srs_success) {
return srs_error_wrap(err, "ts: on video"); return srs_error_wrap(err, "ts: on video");
} }
if (!format->vcodec) {
return err;
}
// ignore info frame, // ignore info frame,
// @see https://github.com/ossrs/srs/issues/288#issuecomment-69863909 // @see https://github.com/ossrs/srs/issues/288#issuecomment-69863909
srs_assert(format->video && format->vcodec); srs_assert(format->video && format->vcodec);