ggerganov / whisper.cpp

Port of OpenAI's Whisper model in C/C++
MIT License
35.38k stars 3.61k forks source link

server: Use OS-generated temp file name for ffmpeg converted files #2419

Closed teejae closed 1 month ago

teejae commented 1 month ago

When doing auto convert of audio files, always generate new temporary filenames, rather than a fixed filename.

ggerganov commented 1 month ago

I'm not super familiar with tmpnam, but I see the compiler giving the following warning:

/usr/bin/ld: examples/server/server.o: in function `main::{lambda(httplib::Request const&, httplib::Response&)#3}::operator()(httplib::Request const&, httplib::Response&) const':
server.cpp:(.text+0x4d39): warning: the use of `tmpnam' is dangerous, better use `mkstemp'

Could you propose a way to fix this warning?