mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 15:00:11 +01:00
properly check aiff playMode before deciding to use it for loop
this loop support may never be useful, bah git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@269 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
c566ee6f4b
commit
ea9aad22e1
@ -230,24 +230,26 @@ VGMSTREAM * init_vgmstream_aifc(STREAMFILE *streamFile) {
|
|||||||
int start_marker;
|
int start_marker;
|
||||||
int end_marker;
|
int end_marker;
|
||||||
/* use the sustain loop */
|
/* use the sustain loop */
|
||||||
start_marker = read_16bitBE(InstrumentChunkOffset+18,streamFile);
|
/* if playMode=ForwardLooping */
|
||||||
end_marker = read_16bitBE(InstrumentChunkOffset+20,streamFile);
|
if (read_16bitBE(InstrumentChunkOffset+16,streamFile) == 1) {
|
||||||
/* check for sustain markers != 0 (invalid marker no) */
|
start_marker = read_16bitBE(InstrumentChunkOffset+18,streamFile);
|
||||||
/* There is a PlayMode flag, but 3DO games don't seem to use it */
|
end_marker = read_16bitBE(InstrumentChunkOffset+20,streamFile);
|
||||||
if (start_marker && end_marker) {
|
/* check for sustain markers != 0 (invalid marker no) */
|
||||||
/* find start marker */
|
if (start_marker && end_marker) {
|
||||||
loop_start = find_marker(streamFile,MarkerChunkOffset,start_marker);
|
/* find start marker */
|
||||||
loop_end = find_marker(streamFile,MarkerChunkOffset,end_marker);
|
loop_start = find_marker(streamFile,MarkerChunkOffset,start_marker);
|
||||||
|
loop_end = find_marker(streamFile,MarkerChunkOffset,end_marker);
|
||||||
|
|
||||||
/* find_marker is type uint32_t as the spec says that's the type
|
/* find_marker is type uint32_t as the spec says that's the type
|
||||||
* of the position value, but it returns a -1 on error, and the
|
* of the position value, but it returns a -1 on error, and the
|
||||||
* loop_start and loop_end variables are int32_t, so the error
|
* loop_start and loop_end variables are int32_t, so the error
|
||||||
* will become apparent.
|
* will become apparent.
|
||||||
* We shouldn't have a loop point that overflows an int32_t
|
* We shouldn't have a loop point that overflows an int32_t
|
||||||
* anyway. */
|
* anyway. */
|
||||||
printf("%d %d\n",loop_start,loop_end);
|
printf("%d %d\n",loop_start,loop_end);
|
||||||
if (loop_start >= 0 && loop_end >= 0) loop_flag = 1;
|
if (loop_start >= 0 && loop_end >= 0) loop_flag = 1;
|
||||||
if (loop_start==loop_end) loop_flag = 0;
|
if (loop_start==loop_end) loop_flag = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user