Skip to content

Commit

Permalink
fix export bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KinoMyu committed Nov 14, 2018
1 parent d2f0cce commit 10da461
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion FastHCADecoder
Submodule FastHCADecoder updated 1 files
+16 −16 clHCA.cpp
2 changes: 1 addition & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ std::string MainWindow::filterCommand(const std::string &command)
{
while(idolnum >= 0 && idolnum < unit_size)
{
if(singing_set.find(idolnum) == singing_set.end() && idol_to_type[current_idols[idolnum]] & ALL)
if(singing_set.find(idolnum) == singing_set.end() && !(idols[idolnum]->get_decode_channel() == 0 && idols_oneshot[idolnum]->get_decode_channel() == 0))
{
singing_set.insert(idolnum);
filtered += (char)(idolnum + 48);
Expand Down
16 changes: 12 additions & 4 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,22 @@ void export_to_wav(HSTREAM mix_stream, const std::string& filename, const std::m
// Get number of samples until next sync event
int numsamples_to_read = 50000;
auto it = event_list.upper_bound(p);
if(it != event_list.end() && it->first - p < numsamples_to_read)
if(it != event_list.end())
{
numsamples_to_read = it->first - p;
int samples_to_next = it->first - p;
if(samples_to_next > 0 && samples_to_next < numsamples_to_read)
{
numsamples_to_read = it->first - p;
}
}
it = oneshot_event_list.upper_bound(p);
if(it != event_list.end() && it->first - p < numsamples_to_read)
if(it != event_list.end())
{
numsamples_to_read = it->first - p;
int samples_to_next = it->first - p;
if(samples_to_next > 0 && samples_to_next < numsamples_to_read)
{
numsamples_to_read = it->first - p;
}
}
c = BASS_ChannelGetData(mix_stream, buf, numsamples_to_read * 4);
p += numsamples_to_read;
Expand Down

0 comments on commit 10da461

Please sign in to comment.