mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-02-26 05:40:49 +00:00
Remove unnecessary conversion of sample pointers to offsets
SFSample should provide the sample pointers as specified in the Soundfont file. If any mangling of the pointers is required, it should happen in the defsfont loader.
This commit is contained in:
parent
9341059b24
commit
0a664e0797
2 changed files with 7 additions and 12 deletions
|
@ -1848,9 +1848,9 @@ fluid_sample_import_sfont(fluid_sample_t* sample, SFSample* sfsample, fluid_defs
|
|||
sample->data = sfont->sampledata;
|
||||
sample->data24 = sfont->sample24data;
|
||||
sample->start = sfsample->start;
|
||||
sample->end = sfsample->start + sfsample->end;
|
||||
sample->loopstart = sfsample->start + sfsample->loopstart;
|
||||
sample->loopend = sfsample->start + sfsample->loopend;
|
||||
sample->end = (sfsample->end > 0) ? sfsample->end - 1 : 0; /* marks last sample, contrary to SF spec. */
|
||||
sample->loopstart = sfsample->loopstart;
|
||||
sample->loopend = sfsample->loopend;
|
||||
sample->samplerate = sfsample->samplerate;
|
||||
sample->origpitch = sfsample->origpitch;
|
||||
sample->pitchadj = sfsample->pitchadj;
|
||||
|
|
|
@ -1595,9 +1595,9 @@ static int load_shdr(SFData *sf, unsigned int size)
|
|||
sf->sample = fluid_list_append(sf->sample, p);
|
||||
READSTR(sf, &p->name);
|
||||
READD(sf, p->start);
|
||||
READD(sf, p->end); /* - end, loopstart and loopend */
|
||||
READD(sf, p->loopstart); /* - will be checked and turned into */
|
||||
READD(sf, p->loopend); /* - offsets in fixup_sample() */
|
||||
READD(sf, p->end);
|
||||
READD(sf, p->loopstart);
|
||||
READD(sf, p->loopend);
|
||||
READD(sf, p->samplerate);
|
||||
READB(sf, p->origpitch);
|
||||
READB(sf, p->pitchadj);
|
||||
|
@ -1679,7 +1679,7 @@ static int fixup_igen(SFData *sf)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* convert sample end, loopstart and loopend to offsets and check if valid */
|
||||
/* Make sure sample start/end and loopstart/loopend pointers are valid */
|
||||
static int fixup_sample(SFData *sf)
|
||||
{
|
||||
fluid_list_t *p;
|
||||
|
@ -1780,11 +1780,6 @@ static int fixup_sample(SFData *sf)
|
|||
}
|
||||
}
|
||||
|
||||
/* convert sample end, loopstart, loopend to offsets from sam->start */
|
||||
sam->end -= sam->start + 1; /* marks last sample, contrary to SF spec. */
|
||||
sam->loopstart -= sam->start;
|
||||
sam->loopend -= sam->start;
|
||||
|
||||
next_sample:
|
||||
p = fluid_list_next(p);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue