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

[ADTSReader] Return false when id3tagparser fails due to eos #1630

Merged
merged 1 commit into from
Aug 10, 2024

Conversation

CastagnaIT
Copy link
Collaborator

Description

Use case of HLS+AAC audio

CADTSSampleReader::ReadSample call ADTSReader::ReadPacket each time kodi request buffer data but when the stream buffer reach the end the m_id3TagParser.parse cannot read data from m_stream by returning ID3TAG::PARSE_FAIL
this was breaking the while loop and return true

since return true was causing that CADTSSampleReader::ReadSample to return AP4_SUCCESS with bad data
where instead was needed to check for waitingForSegment and mark the m_eos as true, this to allow stop the playback and so avoid flooding kodi demuxer of bad package data

seem weird to me that its needed return true also when the audio data is not parsed
it come from the initial ISA implementation so it could be a very old oversight or a workaround for other problems

Motivation and context

fix #1629

How has this been tested?

Sample stream provided in pvt by user and other 2 hls+aac

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • I have read the Contributing document
  • My code follows the Code Guidelines of this project
  • My change requires a change to the Wiki documentation
  • I have updated the documentation accordingly

CADTSSampleReader::ReadSample call ADTSReader::ReadPacket each time kodi request buffer data
but when the stream buffer reach the end the m_id3TagParser.parse cannot read data from m_stream
by returning ID3TAG::PARSE_FAIL
this was breaking the while loop and return true

since return true was causing that CADTSSampleReader::ReadSample
to return AP4_SUCCESS with bad data
where instead was needed to check for waitingForSegment and mark the m_eos as true,
this to allow stop the playback and so avoid flooding kodi demuxer of bad package data
@CastagnaIT CastagnaIT merged commit b8c7e02 into xbmc:Piers Aug 10, 2024
10 checks passed
@CastagnaIT CastagnaIT deleted the fix_adts branch August 10, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport: Done Type: Fix non-breaking change which fixes an issue v22 Piers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Kodi keeps playing at end of stream
2 participants