@@ -72,7 +72,7 @@ EncodeJob::EncodeJob(const QString &name,
72
72
connect (action, SIGNAL (triggered ()), this , SLOT (onSpatialMediaTriggered ()));
73
73
m_successActions << action;
74
74
75
- action = new QAction (tr (" Embed Chapters..." ), this );
75
+ action = new QAction (tr (" Embed Markers as Chapters..." ), this );
76
76
connect (action, SIGNAL (triggered ()), this , SLOT (onEmbedChapters ()));
77
77
m_successActions << action;
78
78
}
@@ -255,22 +255,19 @@ void EncodeJob::onEmbedChapters()
255
255
result = result.call (args);
256
256
if (!result.isError ()) {
257
257
// Save the result with the export file name.
258
- info = QFileInfo (filePath);
259
- auto metadataFilePath
260
- = QDir (info.absolutePath ()).filePath (info.completeBaseName () + " .txt" );
261
- QFile f (metadataFilePath);
262
- f.open (QIODevice::WriteOnly | QIODevice::Text);
263
- f.write (result.toString ().toUtf8 ());
264
- f.close ();
258
+ auto tempFile = Util::writableTemporaryFile (filePath, " shotcut-XXXXXX.txt" );
259
+ tempFile->write (result.toString ().toUtf8 ());
260
+ tempFile->close ();
265
261
266
262
QStringList args;
267
- args << " -i" << objectName () << " -i" << metadataFilePath << " -map_metadata"
263
+ args << " -i" << objectName () << " -i" << tempFile-> fileName () << " -map_metadata"
268
264
<< " 1"
269
265
<< " -c"
270
266
<< " copy"
271
267
<< " -y" << filePath;
272
268
auto job = new FfmpegJob (filePath, args, false );
273
269
job->setLabel (filePath);
270
+ tempFile->setParent (job);
274
271
JOBS.add (job);
275
272
}
276
273
} else {
0 commit comments