Mercurial > audlegacy-plugins
comparison src/madplug/replaygain.c @ 2392:4ad6e7dfb389
imported 5298b10777b3 by Eugene Zagidullin.
- peak == 0 mean absence of gain/peak pair
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Fri, 15 Feb 2008 19:15:29 +0900 |
parents | 7d1411f80023 |
children | 809736eb47d9 |
comparison
equal
deleted
inserted
replaced
2391:7d1411f80023 | 2392:4ad6e7dfb389 |
---|---|
245 | 245 |
246 free(key); | 246 free(key); |
247 free(value); | 247 free(value); |
248 } | 248 } |
249 | 249 |
250 if (file_info->replaygain_track_scale != -1 || file_info->replaygain_album_scale != -1) | |
251 { | |
252 file_info->has_replaygain = TRUE; | |
253 return 1; | |
254 } | |
255 | |
256 return 0; | 250 return 0; |
257 } | 251 } |
258 | 252 |
259 void | 253 void |
260 read_replaygain(struct mad_info_t *file_info) | 254 read_replaygain(struct mad_info_t *file_info) |
262 VFSFile *fp; | 256 VFSFile *fp; |
263 glong curpos = 0; | 257 glong curpos = 0; |
264 | 258 |
265 AUDDBG("f: read_replaygain\n"); | 259 AUDDBG("f: read_replaygain\n"); |
266 | 260 |
267 file_info->has_replaygain = FALSE; | 261 file_info->replaygain_track_peak = 0.0; |
268 file_info->replaygain_album_scale = -1; | 262 file_info->replaygain_track_scale = 0.0; |
269 file_info->replaygain_track_scale = -1; | 263 file_info->replaygain_album_peak = 0.0; |
264 file_info->replaygain_album_scale = 0.0; | |
270 file_info->mp3gain_undo = -77; | 265 file_info->mp3gain_undo = -77; |
271 file_info->mp3gain_minmax = -77; | 266 file_info->mp3gain_minmax = -77; |
272 | 267 |
273 if (ReadId3v2TXXX(file_info)) { | 268 if (ReadId3v2TXXX(file_info)) { |
274 AUDDBG("found ReplayGain info in id3v2 tag\n"); | 269 AUDDBG("found ReplayGain info in id3v2 tag\n"); |
334 file_info->replaygain_track_scale, tmp); | 329 file_info->replaygain_track_scale, tmp); |
335 g_free(tmp); | 330 g_free(tmp); |
336 } | 331 } |
337 #endif | 332 #endif |
338 | 333 |
339 if (file_info->replaygain_album_scale != -1 | |
340 || file_info->replaygain_track_scale != -1) | |
341 file_info->has_replaygain = TRUE; | |
342 | |
343 if (file_info->infile) | 334 if (file_info->infile) |
344 aud_vfs_fseek(fp, curpos, SEEK_SET); | 335 aud_vfs_fseek(fp, curpos, SEEK_SET); |
345 | 336 |
346 aud_vfs_fclose(fp); | 337 aud_vfs_fclose(fp); |
347 | 338 |