diff options
author | Max Kellermann <max@duempel.org> | 2014-12-17 19:27:59 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-12-17 19:27:59 +0100 |
commit | 8400da9934df3e61f0dc792c7f9ce311b0103b39 (patch) | |
tree | 0e769e89fed8f2e3c1bd80e9623d6bad8aa82dc6 /src | |
parent | ae8bdd473c0481d2685dbdee4bd2df73c4199250 (diff) | |
parent | 6d89020f80290b3eec97abbe25cc5d52fbd7b5cf (diff) | |
download | mpd-8400da9934df3e61f0dc792c7f9ce311b0103b39.tar.gz mpd-8400da9934df3e61f0dc792c7f9ce311b0103b39.tar.xz mpd-8400da9934df3e61f0dc792c7f9ce311b0103b39.zip |
Merge tag 'v0.19.7'
Diffstat (limited to 'src')
-rw-r--r-- | src/LogBackend.cxx | 6 | ||||
-rw-r--r-- | src/LogInit.cxx | 3 | ||||
-rw-r--r-- | src/decoder/plugins/FfmpegDecoderPlugin.cxx | 11 | ||||
-rw-r--r-- | src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx | 2 | ||||
-rw-r--r-- | src/util/HugeAllocator.hxx | 4 |
5 files changed, 20 insertions, 6 deletions
diff --git a/src/LogBackend.cxx b/src/LogBackend.cxx index 6591fef2d..04c2e6324 100644 --- a/src/LogBackend.cxx +++ b/src/LogBackend.cxx @@ -194,6 +194,12 @@ FileLog(const Domain &domain, const char *message) domain.GetName(), chomp_length(message), message); +#ifdef WIN32 + /* force-flush the log file, because setvbuf() does not seem + to have an effect on WIN32 */ + fflush(stderr); +#endif + #ifdef HAVE_GLIB g_free(converted); #endif diff --git a/src/LogInit.cxx b/src/LogInit.cxx index accd1d4d8..117c6d8dc 100644 --- a/src/LogInit.cxx +++ b/src/LogInit.cxx @@ -111,6 +111,9 @@ log_early_init(bool verbose) #ifdef ANDROID (void)verbose; #else + /* force stderr to be line-buffered */ + setvbuf(stderr, nullptr, _IOLBF, 0); + if (verbose) SetLogThreshold(LogLevel::DEBUG); #endif diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 7e164e5bd..0afdea6e4 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -316,10 +316,13 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is, AVFrame *frame, uint8_t **buffer, int *buffer_size) { - if (packet->pts >= 0 && packet->pts != (int64_t)AV_NOPTS_VALUE) - decoder_timestamp(decoder, - time_from_ffmpeg(packet->pts - start_time_fallback(*stream), - stream->time_base)); + if (packet->pts >= 0 && packet->pts != (int64_t)AV_NOPTS_VALUE) { + auto start = start_time_fallback(*stream); + if (packet->pts >= start) + decoder_timestamp(decoder, + time_from_ffmpeg(packet->pts - start, + stream->time_base)); + } AVPacket packet2 = *packet; diff --git a/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx b/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx index 9e8f91e05..8baa11c03 100644 --- a/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx +++ b/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx @@ -178,7 +178,7 @@ const struct playlist_plugin embcue_playlist_plugin = { embcue_playlist_open_uri, nullptr, - embcue_playlist_suffixes, nullptr, + embcue_playlist_suffixes, nullptr, }; diff --git a/src/util/HugeAllocator.hxx b/src/util/HugeAllocator.hxx index e02e69f10..fa45e5610 100644 --- a/src/util/HugeAllocator.hxx +++ b/src/util/HugeAllocator.hxx @@ -71,7 +71,9 @@ static inline void * HugeAllocate(size_t size) { // TODO: use MEM_LARGE_PAGES - return VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_READWRITE); + return VirtualAlloc(nullptr, size, + MEM_COMMIT|MEM_RESERVE, + PAGE_READWRITE); } static inline void |