projects
/
nihav-player.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e2ca0db
)
sndplay: support playing AAC with SBR
author
Kostya Shishkov
<kostya.shishkov@gmail.com>
Fri, 30 Jun 2023 16:22:40 +0000
(18:22 +0200)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Fri, 30 Jun 2023 16:22:40 +0000
(18:22 +0200)
sndplay/src/main.rs
patch
|
blob
|
blame
|
history
diff --git
a/sndplay/src/main.rs
b/sndplay/src/main.rs
index c368651a6815e68e3e87e8370d9972eabdc4c3c1..4741853702fc81cedb211964d4b4993eade3d25c 100644
(file)
--- a/
sndplay/src/main.rs
+++ b/
sndplay/src/main.rs
@@
-303,8
+303,16
@@
impl Player {
}
let (dsupp, decoder) = dec.unwrap();
}
let (dsupp, decoder) = dec.unwrap();
- let ainfo = ainfo.unwrap().get_properties().get_audio_info().unwrap();
- let arate = if ainfo.sample_rate > 0 { ainfo.sample_rate } else { 44100 };
+ let info = ainfo.unwrap();
+ let ainfo = info.get_properties().get_audio_info().unwrap();
+ let sbr_hack = info.get_name() == "aac" && ainfo.sample_rate < 32000;
+ let arate = if ainfo.sample_rate > 0 {
+ if !sbr_hack {
+ ainfo.sample_rate
+ } else {
+ ainfo.sample_rate * 2
+ }
+ } else { 44100 };
let ch = ainfo.channels;
println!("Playing {} [{}Hz {}ch]", name, arate, ch);
let ch = ainfo.channels;
println!("Playing {} [{}Hz {}ch]", name, arate, ch);