Skip to content

Commit

Permalink
- Fixed bug where gif/palettegen would trip the error detection
Browse files Browse the repository at this point in the history
- Removed proc->waitForBytesWritten() due to a Qt error
  • Loading branch information
p-yukusai committed Jan 16, 2024
1 parent 54f862b commit 7cb6ad2
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/ctrl/ExportParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,19 @@ class Exporter {
if (mSaveAsImage) {
rString = sCenterL + tr("Current frame: ") + QString::number(tick) + "/" + QString::number(mFrameCount) +
sCenterR;
} else {
rString = sCenterL + tr("Frame rendered: ") + QString::number(mIndex) + "/" + QString::number(mFrameCount) +
" | " + tr("Frame encoded: ") + QString::number(*encodedFrame) + "/" + QString::number(mFrameCount) +
sCenterR;
}
else {
if(mParam.exportType == exportTarget::video && (mParam.videoParams.format == availableVideoFormats::gif
|| mParam.generalParams.useCustomPalette)){
rString = sCenterL + tr("Frame rendered: ") + QString::number(mIndex) + "/" + QString::number(mFrameCount) +
" | " + tr("Frame encoded: ") + tr(" Unable to get encoder data when generating / using palettes") +
sCenterR;
}
else {
rString = sCenterL + tr("Frame rendered: ") + QString::number(mIndex) + "/" + QString::number(mFrameCount) +
" | " + tr("Frame encoded: ") + QString::number(*encodedFrame) + "/" + QString::number(mFrameCount) +
sCenterR;
}
}
return rString;
}
Expand All @@ -1054,8 +1063,9 @@ class Exporter {
}
void write(const QByteArray& bytes) const {
XC_ASSERT(mProcess);
mProcess->write(bytes);
mProcess->waitForBytesWritten();
if(!bytes.isEmpty()) {
mProcess->write(bytes);
}
}
// framebuffer management
void exportImage(const QImage& aFboImage, int aIndex) {
Expand Down Expand Up @@ -1323,7 +1333,12 @@ class Exporter {
export_obj.errorLog.append("The argument given to FFmpeg is invalid, conversion failed.");
mCancelled = true;
}
if(lastLog == export_obj.latestLog && lastWriteLog == export_obj.latestWriteLog) {

if ((mParam.exportType == exportTarget::video &&
mParam.videoParams.format == availableVideoFormats::gif) || mParam.generalParams.useCustomPalette) {
export_obj.procWaitTick = 0;
}
else if(lastLog == export_obj.latestLog && lastWriteLog == export_obj.latestWriteLog) {
export_obj.procWaitTick += 1;
}
else {
Expand Down

0 comments on commit 7cb6ad2

Please sign in to comment.