Skip to content

Commit

Permalink
Fixed temporal segment alignment of parallel segments while merging.
Browse files Browse the repository at this point in the history
  • Loading branch information
sritterbusch committed Jul 13, 2016
1 parent 21cc049 commit d08f6bf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,15 @@ Channels Merge::parallel(Channels &a, Channels &b)
unifySamplerate(a,b);
Channels target(a);
for(unsigned i=0;i<a.size();i++)
for(unsigned j=0;j<a[i].size();j++)
target[i][j]=a[i][j]+b[i][j];
{
unsigned offset=0;
if(a[i].size()>b[i].size())
offset=a[i].size()-b[i].size();
for(unsigned j=0;j<offset;j++)
target[i][j]=a[i][j];
for(unsigned j=offset;j<a[i].size();j++)
target[i][j]=a[i][j]+b[i][j-offset];
}

return target;
}
Expand Down

0 comments on commit d08f6bf

Please sign in to comment.