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

refactor:calculate encoder pts based on decoder pts #348

Merged
merged 7 commits into from
Oct 10, 2024

Conversation

yezhan10
Copy link
Contributor

No description provided.

include/AudioBuffer.h Outdated Show resolved Hide resolved
include/AudioBuffer.h Outdated Show resolved Hide resolved
include/AudioPipe.h Outdated Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
Copy link
Member

@murillo128 murillo128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm so far, need to review the RecBuffer() though

include/AudioBufferPool.h Show resolved Hide resolved
src/AudioTransrater.cpp Outdated Show resolved Hide resolved
src/AudioTransrater.cpp Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
src/AudioPipe.cpp Outdated Show resolved Hide resolved
Copy link
Member

@murillo128 murillo128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost lgtm

//Get reference to first buffer in queue
auto& frontAudioBuffer = queue.front();

if (frontAudioBuffer->GetTimestamp() > 2 * samples + prevPTS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't be the timestamp threshold for detecting a discontinuity be a static constant and not depending on the samples?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mathematically, i think it's more accurate to use num of samples for discontinuity detection instead of use constant, for the following reasons:

  1. the discontinuity may happen between rateBlockBuffer and frontAudioBuffer. If constant is used, we allow more tolerance for this case.
  2. Not sure if it's valid case, is it possible that connection exists all the time, and user switch codecs in between? I think use num of samples is more safe for this case as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I meant a timestamp threshold converted to the num samples based on the output clock rate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I meant is that we are detecting the disconituity based on the leftovers of the rateBlockBuffer which is variable

//Get reference to first buffer in queue
auto& frontAudioBuffer = queue.front();

if (frontAudioBuffer->GetTimestamp() > 2 * samples + prevPTS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I meant is that we are detecting the disconituity based on the leftovers of the rateBlockBuffer which is variable

src/AudioTransrater.cpp Show resolved Hide resolved
src/AudioPipe.cpp Show resolved Hide resolved
Copy link
Member

@murillo128 murillo128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@murillo128 murillo128 merged commit b6b2aee into master Oct 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants