Skip to content

Commit

Permalink
These are not needed because of initial memset
Browse files Browse the repository at this point in the history
  • Loading branch information
CookiePLMonster committed Feb 5, 2017
1 parent 1878f0e commit 7ba7096
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions vagdec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,29 +190,18 @@ HASISTREAM AILCALL FAR ASI_stream_open(U32 user, AILASIFETCHCB fetch_CB, U32 tot
return 0;
}

memset(STR, 0, sizeof(ASISTREAM));
memset(STR, 0, sizeof(*STR));

STR->user = user;
STR->fetch_CB = fetch_CB;
STR->size = total_size;

STR->cursor = 0;
STR->loop = false;

fetch_CB(user, &STR->VAGheader, sizeof(STR->VAGheader), -1);
STR->VAGheader.version = _byteswap_ulong(STR->VAGheader.version);
STR->VAGheader.sample_rate = _byteswap_ulong(STR->VAGheader.sample_rate);
STR->VAGheader.size = _byteswap_ulong(STR->VAGheader.size);
STR->num_of_channels = (STR->VAGheader.stereo != 0) ? 2 : 1;

for (int i = 0; i < STR->num_of_channels; i++)
{
STR->channels[i].s_1 = 0.0;
STR->channels[i].s_2 = 0.0;
memset(STR->channels[i].samples, 0, sizeof(STR->channels[i].samples));
memset(STR->channels[i].decoded_samples, 0, sizeof(STR->channels[i].decoded_samples));
}

FetchStr(STR, sizeof(STR->VAGheader));
return (HASISTREAM)STR;
}
Expand Down

0 comments on commit 7ba7096

Please sign in to comment.