mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-11 16:37:45 -04:00
playback: support non-builtin sinks in audio_guess_frequency
Change-Id: I87b1b489ffc5b9ae05c3233bc091cd7be3da406e
This commit is contained in:
parent
76d63246c5
commit
f87ff3a9b2
1 changed files with 5 additions and 21 deletions
|
|
@ -4236,29 +4236,13 @@ void audio_set_crossfade(int enable)
|
|||
#ifdef HAVE_PLAY_FREQ
|
||||
static unsigned long audio_guess_frequency(struct mp3entry *id3)
|
||||
{
|
||||
switch (id3->frequency)
|
||||
const struct pcm_sink_caps* caps = pcm_sink_caps(pcm_current_sink());
|
||||
for (size_t i = 0; i < caps->num_samprs; i += 1)
|
||||
{
|
||||
#if HAVE_PLAY_FREQ >= 48
|
||||
case 44100:
|
||||
return SAMPR_44;
|
||||
case 48000:
|
||||
return SAMPR_48;
|
||||
#endif
|
||||
#if HAVE_PLAY_FREQ >= 96
|
||||
case 88200:
|
||||
return SAMPR_88;
|
||||
case 96000:
|
||||
return SAMPR_96;
|
||||
#endif
|
||||
#if HAVE_PLAY_FREQ >= 192
|
||||
case 176400:
|
||||
return SAMPR_176;
|
||||
case 192000:
|
||||
return SAMPR_192;
|
||||
#endif
|
||||
default:
|
||||
return (id3->frequency % 4000) ? SAMPR_44 : SAMPR_48;
|
||||
if (id3->frequency == caps->samprs[i])
|
||||
return id3->frequency;
|
||||
}
|
||||
return (id3->frequency % 4000) ? SAMPR_44 : SAMPR_48;
|
||||
}
|
||||
|
||||
static bool audio_auto_change_frequency(struct mp3entry *id3, bool play)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue