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

HLS: Ignore empty NALU to avoid error. v5.0.170

This commit is contained in:
winlin 2023-08-02 09:03:52 +08:00
parent 08147f81bf
commit 939f6b484b
8 changed files with 116 additions and 3 deletions

View file

@ -599,6 +599,8 @@ srs_error_t SrsVideoFrame::add_sample(char* bytes, int size)
if ((err = SrsFrame::add_sample(bytes, size)) != srs_success) {
return srs_error_wrap(err, "add frame");
}
if (!bytes || size <= 0) return err;
// for video, parse the nalu type, set the IDR flag.
SrsAvcNaluType nal_unit_type = (SrsAvcNaluType)(bytes[0] & 0x1f);