Fixed vgmstream bitrate calculator for formats that leave some channels' streamfile pointers empty

CQTexperiment
Chris Moeller 2015-02-12 14:23:13 -08:00
parent b50ed67591
commit 739af5e36a
1 changed files with 4 additions and 0 deletions

View File

@ -3329,10 +3329,14 @@ int get_vgmstream_average_bitrate(VGMSTREAM * vgmstream)
for (i = 1; i < vgmstream->channels; ++i)
{
VGMSTREAMCHANNEL * ch = &vgmstream->ch[i];
if (!ch->streamfile)
continue;
ch->streamfile->get_name(ch->streamfile, path_current, sizeof(path_current));
for (j = 0; j < i; ++j)
{
VGMSTREAMCHANNEL * chc = &vgmstream->ch[j];
if (!chc->streamfile)
continue;
chc->streamfile->get_name(chc->streamfile, path_compare, sizeof(path_compare));
if (!strcmp(path_current, path_compare))
break;