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

[AE/osxsink] - fix wrong samplerate selection #4950

Merged
merged 2 commits into from
Jun 29, 2014

Conversation

Memphiz
Copy link
Member

@Memphiz Memphiz commented Jun 23, 2014

This should improve the selection of streamFormats in the osx sink by taking the samplerate into account.

The problem was brought up from users with optical links to their amps. OSX assumes that each optical amp allows sample rates up to 96000 Hz. As it seems most amps don't support sample rates higher then 48000 Hz. Our current streamFormat scoring algorithm didn't prefer any samplerates if they don't match exactly. In the example the user wanted to play a mono audiostream with 22050Hz. Our scorealgorithm then picked 96000Hz because it was the first format in the list.

With this PR the samplerates are choosen according to this order:

  1. Prefer exact match
  2. Prefer exact multiple of source samplerate and prefer the lowest

Of course those users will have issues when trying to play 96000 Hz content - but there is nothing we can do about it (in that case they need to use the "fixed" preset).

Also added test cases for scoreStream.

@jmarshallnz for review

Jonathan Marshall and others added 2 commits June 23, 2014 09:59
@jmarshallnz
Copy link
Contributor

Looks fine. jenkins build this please

Memphiz added a commit that referenced this pull request Jun 29, 2014
[AE/osxsink] - fix wrong samplerate selection
@Memphiz Memphiz merged commit 25a498d into xbmc:master Jun 29, 2014
@Memphiz Memphiz deleted the osxfixoptical branch June 29, 2014 19:37
@t-nelson t-nelson removed the Gotham label Jul 8, 2014
Memphiz added a commit that referenced this pull request Jul 8, 2014
[AE/osxsink] - fix wrong samplerate selection
@MartijnKaijser MartijnKaijser added this to the Helix 14.0-alpha1 milestone Jul 18, 2014
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.

None yet

5 participants