mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-17 19:19:16 +01:00
better streamfile profile reporting for test
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@188 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
110938668a
commit
7f33ba0d23
16
test/test.c
16
test/test.c
@ -239,13 +239,27 @@ int main(int argc, char ** argv) {
|
||||
|
||||
#ifdef PROFILE_STREAMFILE
|
||||
{
|
||||
int i;
|
||||
int i,j;
|
||||
size_t total_bytes_read = 0;
|
||||
for (i=0;i<s->channels;i++) {
|
||||
size_t bytes_read = get_streamfile_bytes_read(s->ch[i].streamfile);
|
||||
size_t file_size = get_streamfile_size(s->ch[i].streamfile);
|
||||
int already_reported = 0;
|
||||
|
||||
/* see if we've reported this STREAMFILE already */
|
||||
for (j=i-1;!already_reported && j>=0;j--) {
|
||||
if (s->ch[j].streamfile == s->ch[i].streamfile) {
|
||||
already_reported=1;
|
||||
}
|
||||
}
|
||||
|
||||
if (already_reported) continue;
|
||||
|
||||
total_bytes_read += bytes_read;
|
||||
fprintf(stderr,"ch%d: %lf%% (%d bytes read, file is %d bytes)\n",i,
|
||||
bytes_read*100.0/file_size,bytes_read,file_size);
|
||||
}
|
||||
fprintf(stderr,"total bytes read: %d\n",total_bytes_read);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user