Media: moves media cover cleanup logic to media detection

This commit is contained in:
李通洲
2025-11-11 14:00:43 +08:00
parent e6b0bd3817
commit df15bbc5f2
2 changed files with 15 additions and 13 deletions
-11
View File
@@ -475,16 +475,6 @@ static bool logoPrintData(bool doColorReplacement, FFstrbuf* source)
return true;
}
static void removeMediaCoverFile(void)
{
const FFMediaResult* media = ffDetectMedia(true);
if (media->cover.length > 0)
{
ffRemoveFile(media->cover.chars);
ffStrbufDestroy((FFstrbuf*) &media->cover);
}
}
static bool updateLogoPath(void)
{
FFOptionsLogo* options = &instance.config.logo;
@@ -501,7 +491,6 @@ static bool updateLogoPath(void)
if (media->cover.length == 0)
return false;
ffStrbufSet(&options->source, &media->cover);
if (media->removeCoverAfterUse) atexit(removeMediaCoverFile);
return true;
}