Merge tracking branch of Big Sur update #58

Merged
kode54 merged 26 commits from ohsir into master 2020-11-26 23:28:49 -03:00
2 changed files with 21 additions and 0 deletions
Showing only changes of commit 4eb7a3eebf - Show all commits

View file

@ -28,6 +28,7 @@
@interface VGMDecoder : NSObject <CogDecoder> {
VGMSTREAM *stream;
BOOL playForever;
int sampleRate;
int channels;
int bitrate;

View file

@ -198,12 +198,27 @@
if ( !stream )
return NO;
vgmstream_mixing_autodownmix(stream, 6);
playForever = IsRepeatOneSet();
sampleRate = stream->sample_rate;
channels = stream->channels;
totalFrames = get_vgmstream_play_samples( 2.0, 10.0, 10.0, stream );
framesFade = stream->loop_flag ? sampleRate * 10 : 0;
framesLength = totalFrames - framesFade;
vgmstream_cfg_t vcfg = {0};
vcfg.allow_play_forever = 1;
vcfg.play_forever = playForever;
vcfg.loop_count = 2;
vcfg.fade_time = 10;
vcfg.fade_delay = 0;
vcfg.ignore_loop = 0;
vgmstream_apply_config(stream, &vcfg);
framesRead = 0;
bitrate = get_vgmstream_average_bitrate(stream);
@ -232,6 +247,11 @@
{
BOOL repeatone = IsRepeatOneSet();
if (repeatone != playForever) {
playForever = repeatone;
vgmstream_set_play_forever(stream, repeatone);
}
BOOL loopokay = repeatone && stream->loop_flag;
if (!loopokay) {