Changeset 222:3975f41364fa in roaraudio
- Timestamp:
- 07/22/08 20:34:11 (16 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/codecfilter_vorbis.c
r207 r222 94 94 int type; 95 95 int j, h = 0; 96 float rpg_track = 0, rpg_album = 0; 96 97 97 98 s->info.channels = vi->channels; … … 116 117 117 118 ROAR_DBG("cf_vorbis_update_stream(*): Meta %-16s: %s", key, value); 119 120 if ( strcmp(key, "REPLAYGAIN_TRACK_PEAK") == 0 ) { 121 rpg_track = 1/atof(value); 122 /* 123 } else if ( strcmp(key, "REPLAYGAIN_TRACK_GAIN") == 0 ) { 124 rpg_track = powf(10, atof(value)/20); 125 */ 126 } else if ( strcmp(key, "REPLAYGAIN_ALBUM_PEAK") == 0 ) { 127 rpg_album = 1/atof(value); 128 /* 129 } else if ( strcmp(key, "REPLAYGAIN_ALBUM_GAIN") == 0 ) { 130 rpg_album = powf(10, atof(value)/20); 131 */ 132 } 133 118 134 ++ptr; 119 135 } 120 136 137 if ( rpg_album ) { 138 self->stream->mixer.rpg_div = 2718; // = int(exp(1)*1000) 139 self->stream->mixer.rpg_mul = (float)rpg_album*2718; 140 } else if ( rpg_track ) { 141 self->stream->mixer.rpg_div = 2718; 142 self->stream->mixer.rpg_mul = (float)rpg_track*2718; 143 } 144 145 printf("RPG: mul=%i, div=%i\n", self->stream->mixer.rpg_mul, self->stream->mixer.rpg_div); 121 146 return 0; 122 147 } -
roard/include/codecfilter_vorbis.h
r207 r222 7 7 #include <vorbis/codec.h> 8 8 #include <vorbis/vorbisfile.h> 9 #include <math.h> 9 10 10 11 struct codecfilter_vorbis_inst {
Note: See TracChangeset
for help on using the changeset viewer.