Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ibc opened this issue Mar 7, 2024 · 0 comments
Open

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

ibc opened this issue Mar 7, 2024 · 0 comments
Assignees
Labels
Milestone

Comments

@ibc
Copy link
Member

ibc commented Mar 7, 2024

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/

@ibc ibc added the bug label Mar 7, 2024
@ibc ibc added this to the v3 updates milestone Mar 7, 2024
@ibc ibc mentioned this issue Mar 7, 2024
@ibc ibc assigned ibc and jmillan Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants