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

fix 96kbps playback issue #1434

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions playback/src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,11 +917,19 @@ impl PlayerTrackLoader {
AudioFileFormat::MP3_160_ENC => 20.,
AudioFileFormat::AAC_24 => 3.,
AudioFileFormat::AAC_48 => 6.,
AudioFileFormat::AAC_160 => 20.,
AudioFileFormat::AAC_320 => 40.,
AudioFileFormat::MP4_128 => 16.,
AudioFileFormat::OTHER5 => 40.,
AudioFileFormat::FLAC_FLAC => 112., // assume 900 kbit/s on average
AudioFileFormat::XHE_AAC_12 => 1.5,
AudioFileFormat::XHE_AAC_16 => 2.,
AudioFileFormat::XHE_AAC_24 => 3.,
AudioFileFormat::FLAC_FLAC_24BIT => 3.,
AudioFileFormat::UNKNOWN_FORMAT => {
error!("Unknown stream data rate");
return None;
}
};
let data_rate: f32 = kbps * 1024.;
Some(data_rate.ceil() as usize)
Expand Down
7 changes: 6 additions & 1 deletion protocol/proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,20 @@ message AudioFile {
MP3_160_ENC = 7;
AAC_24 = 8;
AAC_48 = 9;
AAC_160 = 10;
AAC_320 = 11;
MP4_128 = 12;
OTHER5 = 13;
FLAC_FLAC = 16;
XHE_AAC_24 = 18;
XHE_AAC_16 = 19;
XHE_AAC_12 = 20;
FLAC_FLAC_24BIT = 22;
UNKNOWN_FORMAT = 255;
}

optional bytes file_id = 1;
optional Format format = 2;
optional Format format = 2 [default = UNKNOWN_FORMAT];
}

message Video {
Expand Down
Loading