mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge from SRS2.
This commit is contained in:
commit
d6e28bde69
3 changed files with 13 additions and 1 deletions
|
@ -214,6 +214,8 @@ Please select your language:
|
|||
|
||||
### V2 changes
|
||||
|
||||
* v2.0, 2017-04-15, Merge [#846][bug #846], fix fd leak for FLV stream caster. 2.0.237
|
||||
* v2.0, 2017-04-15, Merge [#841][bug #841], avoid the duplicated sps/pps in ts. 2.0.236
|
||||
* v2.0, 2017-04-09, Fix [#834][bug #834], crash for TS context corrupt. 2.0.235
|
||||
* <strong>v2.0, 2017-03-03, [2.0 release0(2.0.234)][r2.0r0] released. 86373 lines.</strong>
|
||||
* v2.0, 2017-02-25, for [#730][bug #730], remove the test code. 2.0.234
|
||||
|
@ -1387,6 +1389,8 @@ Winlin
|
|||
[bug #752]: https://github.com/ossrs/srs/issues/752
|
||||
[bug #503]: https://github.com/ossrs/srs/issues/503
|
||||
[bug #834]: https://github.com/ossrs/srs/issues/834
|
||||
[bug #841]: https://github.com/ossrs/srs/issues/841
|
||||
[bug #846]: https://github.com/ossrs/srs/issues/846
|
||||
[bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx
|
||||
|
||||
[bug #735]: https://github.com/ossrs/srs/issues/735
|
||||
|
|
|
@ -91,6 +91,11 @@ void SrsAppCasterFlv::remove(ISrsConnection* c)
|
|||
if ((it = std::find(conns.begin(), conns.end(), conn)) != conns.end()) {
|
||||
conns.erase(it);
|
||||
}
|
||||
|
||||
// fixbug: SrsHttpConn for CasterFlv is not freed, which could cause memory leak
|
||||
// so, free conn which is not managed by SrsServer->conns;
|
||||
// @see: https://github.com/ossrs/srs/issues/826
|
||||
srs_freep(c);
|
||||
}
|
||||
|
||||
int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
||||
|
|
|
@ -3048,6 +3048,8 @@ int SrsTsMessageCache::do_cache_avc(SrsVideoFrame* frame)
|
|||
SrsVideoCodecConfig* codec = frame->vcodec();
|
||||
srs_assert(codec);
|
||||
|
||||
bool is_sps_pps_appended = false;
|
||||
|
||||
// all sample use cont nalu header, except the sps-pps before IDR frame.
|
||||
for (int i = 0; i < frame->nb_samples; i++) {
|
||||
SrsSample* sample = &frame->samples[i];
|
||||
|
@ -3065,7 +3067,7 @@ int SrsTsMessageCache::do_cache_avc(SrsVideoFrame* frame)
|
|||
|
||||
// Insert sps/pps before IDR when there is no sps/pps in samples.
|
||||
// The sps/pps is parsed from sequence header(generally the first flv packet).
|
||||
if (nal_unit_type == SrsAvcNaluTypeIDR && !frame->has_sps_pps) {
|
||||
if (nal_unit_type == SrsAvcNaluTypeIDR && !frame->has_sps_pps && !is_sps_pps_appended) {
|
||||
if (codec->sequenceParameterSetLength > 0) {
|
||||
srs_avc_insert_aud(video->payload, aud_inserted);
|
||||
video->payload->append(codec->sequenceParameterSetNALUnit, codec->sequenceParameterSetLength);
|
||||
|
@ -3074,6 +3076,7 @@ int SrsTsMessageCache::do_cache_avc(SrsVideoFrame* frame)
|
|||
srs_avc_insert_aud(video->payload, aud_inserted);
|
||||
video->payload->append(codec->pictureParameterSetNALUnit, codec->pictureParameterSetLength);
|
||||
}
|
||||
is_sps_pps_appended = true;
|
||||
}
|
||||
|
||||
// Insert the NALU to video in annexb.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue