versatica / mediasoup

Cutting Edge WebRTC Video Conferencing
https://mediasoup.org
ISC License
6.27k stars 1.13k forks source link

Possible missing break in H264_SVC::ParseSingleNalu() #1356

Open ibc opened 8 months ago

ibc commented 8 months ago

In H264_SVC::ParseSingleNalu() in worker/src/RTC/Codecs/H264_SVC.cpp:

std::unique_ptr<H264_SVC::PayloadDescriptor> H264_SVC::ParseSingleNalu(
  const uint8_t* data,
  size_t len,
  std::unique_ptr<H264_SVC::PayloadDescriptor> payloadDescriptor,
  bool isStartBit)
{
    const uint8_t nal = *data & 0x1F;

    switch (nal)
    {
        // Single NAL unit packet.
        // IDR (instantaneous decoding picture).
        case 5:
        {
            payloadDescriptor->isKeyFrame = true;
        }

        case 1:
        {
            payloadDescriptor->slIndex = 0;
            payloadDescriptor->tlIndex = 0;

            payloadDescriptor->hasSlIndex = false;
            payloadDescriptor->hasTlIndex = false;

            break;
        }

        // etc

In case 5 block there is no break. Is it on purpose?

@prtmD, as author of this code, maybe you know?

Some library that may help: https://github.com/chemag/h264nal/