mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-17 02:19:06 -05:00
* 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.
19 lines
417 B
C++
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
|