|
14 | 14 | #include "File.h"
|
15 | 15 | #if defined(_WIN32) && !defined(__MINGW32__)
|
16 | 16 | #define snprintf _snprintf
|
| 17 | +#define DEVNULL "nul" |
| 18 | +#else |
| 19 | +#define DEVNULL "/dev/null" |
17 | 20 | #endif
|
18 | 21 |
|
19 | 22 | class AudioStreamInput {
|
@@ -59,11 +62,11 @@ class FfmpegStreamInput : public AudioStreamInput {
|
59 | 62 | // TODO: Windows
|
60 | 63 | char message[4096] = {0};
|
61 | 64 | if (_Offset_s == 0 && _Seconds == 0)
|
62 |
| - snprintf(message, NELEM(message), "ffmpeg -i \"%s\" -ac %d -ar %d -f s16le - 2>/dev/null", |
63 |
| - filename, Params::AudioStreamInput::Channels, (uint) Params::AudioStreamInput::SamplingRate); |
| 65 | + snprintf(message, NELEM(message), "ffmpeg -i \"%s\" -ac %d -ar %d -f s16le - 2>%s", |
| 66 | + filename, Params::AudioStreamInput::Channels, (uint) Params::AudioStreamInput::SamplingRate, DEVNULL); |
64 | 67 | else
|
65 |
| - snprintf(message, NELEM(message), "ffmpeg -i \"%s\" -ac %d -ar %d -f s16le -t %d -ss %d - 2>/dev/null", |
66 |
| - filename, Params::AudioStreamInput::Channels, (uint) Params::AudioStreamInput::SamplingRate, _Seconds, _Offset_s); |
| 68 | + snprintf(message, NELEM(message), "ffmpeg -i \"%s\" -ac %d -ar %d -f s16le -t %d -ss %d - 2>%s", |
| 69 | + filename, Params::AudioStreamInput::Channels, (uint) Params::AudioStreamInput::SamplingRate, _Seconds, _Offset_s, DEVNULL); |
67 | 70 |
|
68 | 71 | return std::string(message);
|
69 | 72 | }
|
|
0 commit comments