TagHandler: pass SongTime to duration()

This commit is contained in:
Max Kellermann
2014-08-29 22:43:36 +02:00
parent d9d97bd17b
commit 3158955198
23 changed files with 83 additions and 68 deletions

View File

@@ -474,8 +474,9 @@ dsdiff_scan_stream(InputStream &is,
return false;
/* calculate song time and add as tag */
unsigned songtime = ((metadata.chunk_size / metadata.channels) * 8) /
metadata.sample_rate;
uint64_t n_frames = metadata.chunk_size / audio_format.channels;
auto songtime = SongTime::FromScale<uint64_t>(n_frames,
audio_format.sample_rate);
tag_handler_invoke_duration(handler, handler_ctx, songtime);
/* Read additional metadata and created tags if available */