Skip to content

Commit 0079740

Browse files
committed
Remove possible leftover ffmpeg temp file from a previous failed conversion
1 parent 69339af commit 0079740

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/server/server.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ void check_ffmpeg_availibility() {
219219
bool convert_to_wav(const std::string & temp_filename, std::string & error_resp) {
220220
std::ostringstream cmd_stream;
221221
std::string converted_filename_temp = temp_filename + "_temp.wav";
222+
// Remove possible leftover ffmpeg temp file from a previous failed conversion
223+
remove(converted_filename_temp.c_str());
222224
cmd_stream << "ffmpeg -i \"" << temp_filename << "\" -ar 16000 -ac 1 -c:a pcm_s16le \"" << converted_filename_temp << "\" 2>&1";
223225
std::string cmd = cmd_stream.str();
224226

0 commit comments

Comments
 (0)