Files
MuditaOS/module-audio/Audio/decoder/DecoderCommon.hpp
Lefucjusz 9a8ffff654 [BH-1863] Fix deleted file popup showing in Relaxation
* Fix of the issue that 'File has been
deleted' popup would show in Relaxation
app at the end of playback if the
playback was paused at least once,
even though the file wasn't actually
deleted.
* Added very basic audio decoder error
handling and propagation mechanism.
* Minor refactor around several
audio-related parts.
2024-02-01 12:09:32 +01:00

19 lines
417 B
C++

// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include <sys/stat.h>
#include <cstdio>
namespace audio
{
inline bool fileExists(FILE *fd)
{
struct stat fdStat
{};
constexpr auto statFailed = -1;
return (fstat(fileno(fd), &fdStat) != statFailed);
}
} // namespace audio