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

Refactor code, add comment when string.assign(xx, 0)

This commit is contained in:
winlin 2020-04-11 09:00:50 +08:00
parent 162055f6d0
commit fca81f02f5
3 changed files with 35 additions and 20 deletions

View file

@ -105,8 +105,10 @@ srs_error_t SrsRtpH264Muxer::frame_to_packet(SrsSharedPtrMessage* shared_frame,
srs_error_t err = srs_success;
if (format->is_avc_sequence_header()) {
// It is ok when size is 0, @see http://www.cplusplus.com/reference/string/string/assign/
sps.assign(format->vcodec->sequenceParameterSetNALUnit.data(), format->vcodec->sequenceParameterSetNALUnit.size());
pps.assign(format->vcodec->pictureParameterSetNALUnit.data(), format->vcodec->pictureParameterSetNALUnit.size());
// only collect SPS/PPS.
return err;
}