mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-25 22:55:56 -05:00
Better estimate of bitrate on mp3 files
This commit is contained in:
parent
998fdcc9d0
commit
d2bb534ddd
@ -942,6 +942,7 @@ int scan_mp3_get_mp3fileinfo(char *file, MP3FILE *pmp3) {
|
||||
buffer[index+fi.xing_offset+4+10] << 8 |
|
||||
buffer[index+fi.xing_offset+4+11];
|
||||
}
|
||||
fi.bitrate = 0;
|
||||
}
|
||||
|
||||
if((conf_get_int("general","scan_type",0) != 0) &&
|
||||
@ -975,6 +976,10 @@ int scan_mp3_get_mp3fileinfo(char *file, MP3FILE *pmp3) {
|
||||
(double) fi.samplerate);
|
||||
}
|
||||
|
||||
/* back-calculate bitrate from duration */
|
||||
pmp3->bitrate = ((pmp3->file_size / 1000) * 8) /
|
||||
(pmp3->song_length / 1000);
|
||||
|
||||
}
|
||||
DPRINTF(E_DBG,L_SCAN," Song Length: %d\n",pmp3->song_length);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user