Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@padenot
Copy link
Collaborator

@padenot padenot commented Aug 29, 2019

No description provided.

Copy link
Contributor

@achronop achronop left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

uint32_t stream_latency_frames =
(stm->user_output_rate * stm->output_latency_ms) / 1000;

if (stm->resampler) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The resampler is always there, look at [1], better assert if you want to verify.

[1] https://github.com/kinetiknz/cubeb/blob/master/src/cubeb_opensl.c#L1379

static int
opensl_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
{
assert(stm && latency);
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer to break that kind of asserts into 2 separate individual asserts since it is easier to find out which one has been hit. Not a strong comment.

assert(stm && latency);

uint32_t stream_latency_frames =
(stm->user_output_rate * stm->output_latency_ms) / 1000;
Copy link
Contributor

Choose a reason for hiding this comment

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

It does not change anything but since the user_output_rate is samples per seconds and the output_latency_ms is in ms I would prefer different parenthesis:
stm->user_output_rate * (stm->output_latency_ms / 1000)

@padenot padenot merged commit 8143207 into mozilla:master Nov 4, 2019
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