mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge branch '2.0release' into develop
This commit is contained in:
commit
bf22acd689
2 changed files with 15 additions and 0 deletions
|
@ -403,6 +403,7 @@ Remark:
|
|||
=======
|
||||
## History
|
||||
|
||||
* v2.0, 2016-08-18, fix [srs-librtmp#4](https://github.com/ossrs/srs-librtmp/issues/4) filter frame.
|
||||
* v2.0, 2016-08-10, fix socket timeout for librtmp.
|
||||
* v2.0, 2016-08-08, fix the crash by srs_info log.
|
||||
* <strong>v2.0, 2016-08-06, [2.0 beta0(2.0.210)][r2.0b0] released. 89704 lines.</strong>
|
||||
|
|
|
@ -1392,6 +1392,11 @@ int srs_write_h264_raw_frame(Context* context,
|
|||
char* frame, int frame_size, u_int32_t dts, u_int32_t pts
|
||||
) {
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
// empty frame.
|
||||
if (frame_size <= 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// for sps
|
||||
if (context->avc_raw.is_sps(frame, frame_size)) {
|
||||
|
@ -1425,6 +1430,15 @@ int srs_write_h264_raw_frame(Context* context,
|
|||
return ret;
|
||||
}
|
||||
|
||||
// ignore others.
|
||||
// 5bits, 7.3.1 NAL unit syntax,
|
||||
// H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
|
||||
// 7: SPS, 8: PPS, 5: I Frame, 1: P Frame
|
||||
SrsAvcNaluType nut = (SrsAvcNaluType)(frame[0] & 0x1f);
|
||||
if (nut != SrsAvcNaluTypeSPS && nut != SrsAvcNaluTypePPS && nut != SrsAvcNaluTypeIDR && nut != SrsAvcNaluTypeNonIDR) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// send pps+sps before ipb frames when sps/pps changed.
|
||||
if ((ret = srs_write_h264_sps_pps(context, dts, pts)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue