replay_gain: fall back to track gain if album gain is unavailable
This commit is contained in:
parent
752dfb3d95
commit
48b49e2303
1
NEWS
1
NEWS
|
@ -72,6 +72,7 @@ ver 0.16 (20??/??/??)
|
|||
- automatically convert to 16 bit samples
|
||||
* replay gain:
|
||||
- reimplemented as a filter plugin
|
||||
- fall back to track gain if album gain is unavailable
|
||||
* log unused/unknown block parameters
|
||||
* removed the deprecated "error_file" option
|
||||
* save state when stopped
|
||||
|
|
|
@ -184,9 +184,10 @@ replay_gain_filter_set_info(struct filter *_filter,
|
|||
struct replay_gain_filter *filter =
|
||||
(struct replay_gain_filter *)_filter;
|
||||
|
||||
if (info != NULL)
|
||||
if (info != NULL) {
|
||||
filter->info = *info;
|
||||
else
|
||||
replay_gain_info_complete(&filter->info);
|
||||
} else
|
||||
replay_gain_info_init(&filter->info);
|
||||
|
||||
replay_gain_filter_update(filter);
|
||||
|
|
|
@ -35,3 +35,11 @@ replay_gain_tuple_scale(const struct replay_gain_tuple *tuple, float preamp)
|
|||
|
||||
return scale;
|
||||
}
|
||||
|
||||
void
|
||||
replay_gain_info_complete(struct replay_gain_info *info)
|
||||
{
|
||||
if (!replay_gain_tuple_defined(&info->tuples[REPLAY_GAIN_ALBUM]))
|
||||
info->tuples[REPLAY_GAIN_ALBUM] =
|
||||
info->tuples[REPLAY_GAIN_TRACK];
|
||||
}
|
||||
|
|
|
@ -63,4 +63,11 @@ replay_gain_tuple_defined(const struct replay_gain_tuple *tuple)
|
|||
float
|
||||
replay_gain_tuple_scale(const struct replay_gain_tuple *tuple, float preamp);
|
||||
|
||||
/**
|
||||
* Attempt to auto-complete missing data. In particular, if album
|
||||
* information is missing, track gain is used.
|
||||
*/
|
||||
void
|
||||
replay_gain_info_complete(struct replay_gain_info *info);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue