diff --git a/tagutils/tagutils-aac.c b/tagutils/tagutils-aac.c index 1107454..bf5fddd 100644 --- a/tagutils/tagutils-aac.c +++ b/tagutils/tagutils-aac.c @@ -253,6 +253,7 @@ _get_aacfileinfo(char *file, struct song_metadata *psong) aac_object_type_t profile_id = 0; psong->vbr_scale = -1; + psong->channels = 2; // A "normal" default in case we can't find this information if(!(infile = fopen(file, "rb"))) { @@ -334,6 +335,11 @@ _get_aacfileinfo(char *file, struct song_metadata *psong) { psong->bitrate = atom_length * 1000 / psong->song_length / 128; } + /* If this is an obviously wrong bitrate, try something different */ + if((psong->bitrate < 16000) && (psong->song_length)) + { + psong->bitrate = (file_size * 8) / (psong->song_length / 1000); + } } //DPRINTF(E_DEBUG, L_METADATA, "Profile ID: %u\n", profile_id);