fix cmd stream corruption when cmd stream playing
This commit is contained in:
parent
a2c745cb10
commit
b946f08122
|
@ -644,6 +644,12 @@ bool DivCSPlayer::init() {
|
|||
|
||||
bool DivEngine::playStream(unsigned char* f, size_t length) {
|
||||
BUSY_BEGIN;
|
||||
// kill the previous player
|
||||
if (cmdStreamInt) {
|
||||
cmdStreamInt->cleanup();
|
||||
delete cmdStreamInt;
|
||||
cmdStreamInt=NULL;
|
||||
}
|
||||
cmdStreamInt=new DivCSPlayer(this,f,length);
|
||||
if (!cmdStreamInt->init()) {
|
||||
logE("not a command stream!");
|
||||
|
|
|
@ -206,6 +206,7 @@ void FurnaceGUI::drawCSPlayer() {
|
|||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(_("Burn Current Song"))) {
|
||||
e->killStream();
|
||||
SafeWriter* w=e->saveCommand(NULL,csExportDisablePass);
|
||||
if (w!=NULL) {
|
||||
if (!e->playStream(w->getFinalBuf(),w->size())) {
|
||||
|
|
Loading…
Reference in a new issue