OpenMPT: Change decode call slightly
This commit is contained in:
parent
73a356ad1d
commit
27dbd609c9
2 changed files with 1 additions and 11 deletions
|
@ -16,8 +16,6 @@
|
||||||
|
|
||||||
@interface OMPTDecoder : NSObject <CogDecoder> {
|
@interface OMPTDecoder : NSObject <CogDecoder> {
|
||||||
openmpt::module *mod;
|
openmpt::module *mod;
|
||||||
std::vector<float> left;
|
|
||||||
std::vector<float> right;
|
|
||||||
|
|
||||||
id<CogSource> source;
|
id<CogSource> source;
|
||||||
long length;
|
long length;
|
||||||
|
|
|
@ -82,9 +82,6 @@ static void g_push_archive_extensions(std::vector<std::string> & list)
|
||||||
mod->set_render_param( openmpt::module::RENDER_INTERPOLATIONFILTER_LENGTH, interp );
|
mod->set_render_param( openmpt::module::RENDER_INTERPOLATIONFILTER_LENGTH, interp );
|
||||||
mod->set_render_param( openmpt::module::RENDER_VOLUMERAMPING_STRENGTH, -1 );
|
mod->set_render_param( openmpt::module::RENDER_VOLUMERAMPING_STRENGTH, -1 );
|
||||||
mod->ctl_set_boolean("render.resampler.emulate_amiga", true);
|
mod->ctl_set_boolean("render.resampler.emulate_amiga", true);
|
||||||
|
|
||||||
left.resize( 1024 );
|
|
||||||
right.resize( 1024 );
|
|
||||||
} catch (std::exception & /*e*/) {
|
} catch (std::exception & /*e*/) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
@ -119,15 +116,10 @@ static void g_push_archive_extensions(std::vector<std::string> & list)
|
||||||
if ( framesToRender > frames )
|
if ( framesToRender > frames )
|
||||||
framesToRender = frames;
|
framesToRender = frames;
|
||||||
|
|
||||||
std::size_t count = mod->read(44100, framesToRender, left.data(), right.data());
|
std::size_t count = mod->read_interleaved_stereo(44100, framesToRender, ((float *)buf) + total * 2);
|
||||||
if ( count == 0 )
|
if ( count == 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
for ( std::size_t frame = 0; frame < count; frame++ ) {
|
|
||||||
((float *)buf)[(total + frame) * 2 + 0] = left[frame];
|
|
||||||
((float *)buf)[(total + frame) * 2 + 1] = right[frame];
|
|
||||||
}
|
|
||||||
|
|
||||||
total += count;
|
total += count;
|
||||||
|
|
||||||
if ( count < framesToRender )
|
if ( count < framesToRender )
|
||||||
|
|
Loading…
Reference in a new issue