diff --git a/NEWS b/NEWS index 8f3901e00..1e69582bf 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,12 @@ ver 0.22 (not yet released) * switch to C++17 - GCC 7 or clang 4 (or newer) recommended +ver 0.21.20 (not yet released) +* decoder + - audiofile, ffmpeg, sndfile: handle MIME type "audio/wav" + - ffmpeg: fix playback of AIFF and TTA + - vorbis, opus: fix seeking in small files + ver 0.21.19 (2020/01/17) * configuration - allow overriding top-level settings in includes diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 25c755885..a7ea8a550 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="43" + android:versionName="0.21.20"> diff --git a/src/decoder/plugins/AudiofileDecoderPlugin.cxx b/src/decoder/plugins/AudiofileDecoderPlugin.cxx index 63ecff3ca..7ed51a7d8 100644 --- a/src/decoder/plugins/AudiofileDecoderPlugin.cxx +++ b/src/decoder/plugins/AudiofileDecoderPlugin.cxx @@ -269,6 +269,8 @@ static const char *const audiofile_suffixes[] = { }; static const char *const audiofile_mime_types[] = { + "audio/wav", + "audio/aiff", "audio/x-wav", "audio/x-aiff", nullptr diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 6be0448b9..58795e3ea 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -698,7 +698,7 @@ static const char *const ffmpeg_mime_types[] = { "audio/aac", "audio/aacp", "audio/ac3", - "audio/aiff" + "audio/aiff", "audio/amr", "audio/basic", "audio/flac", @@ -711,12 +711,13 @@ static const char *const ffmpeg_mime_types[] = { "audio/qcelp", "audio/vorbis", "audio/vorbis+ogg", + "audio/wav", "audio/x-8svx", "audio/x-16sv", "audio/x-aac", "audio/x-ac3", "audio/x-adx", - "audio/x-aiff" + "audio/x-aiff", "audio/x-alaw", "audio/x-au", "audio/x-dca", @@ -736,7 +737,7 @@ static const char *const ffmpeg_mime_types[] = { "audio/x-pn-realaudio", "audio/x-pn-multirate-realaudio", "audio/x-speex", - "audio/x-tta" + "audio/x-tta", "audio/x-voc", "audio/x-wav", "audio/x-wma", diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index e72841155..18b937aac 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -760,7 +760,7 @@ MadDecoder::DecodeFirstFrame(Tag *tag) noexcept if (max_frames > 8 * 1024 * 1024) { FormatWarning(mad_domain, - "mp3 file header indicates too many frames: %lu", + "mp3 file header indicates too many frames: %zu", max_frames); return false; } diff --git a/src/decoder/plugins/OggDecoder.cxx b/src/decoder/plugins/OggDecoder.cxx index 10f935743..da9bad2b9 100644 --- a/src/decoder/plugins/OggDecoder.cxx +++ b/src/decoder/plugins/OggDecoder.cxx @@ -45,8 +45,12 @@ OggDecoder::LoadEndPacket(ogg_packet &packet) const DecoderReader reader(client, input_stream); OggSyncState sync2(reader); OggStreamState stream2(GetSerialNo()); + + /* passing synced=false because we're inside an + OggVisitor callback, and our InputStream may be in + the middle of an Ogg packet */ result = OggSeekFindEOS(sync2, stream2, packet, - input_stream); + input_stream, false); } /* restore the previous file position */ diff --git a/src/decoder/plugins/SndfileDecoderPlugin.cxx b/src/decoder/plugins/SndfileDecoderPlugin.cxx index 412ec2dfc..91baf1275 100644 --- a/src/decoder/plugins/SndfileDecoderPlugin.cxx +++ b/src/decoder/plugins/SndfileDecoderPlugin.cxx @@ -323,6 +323,8 @@ static const char *const sndfile_suffixes[] = { }; static const char *const sndfile_mime_types[] = { + "audio/wav", + "audio/aiff", "audio/x-wav", "audio/x-aiff", diff --git a/src/lib/xiph/OggFind.cxx b/src/lib/xiph/OggFind.cxx index 88ed42cc5..bd6299df5 100644 --- a/src/lib/xiph/OggFind.cxx +++ b/src/lib/xiph/OggFind.cxx @@ -57,13 +57,14 @@ OggSeekPageAtOffset(OggSyncState &oy, ogg_stream_state &os, InputStream &is, bool OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet, - InputStream &is) + InputStream &is, bool synced) { if (!is.KnownSize()) return false; if (is.GetRest() < 65536) - return OggFindEOS(oy, os, packet); + return (synced || oy.ExpectPageSeekIn(os)) && + OggFindEOS(oy, os, packet); if (!is.CheapSeeking()) return false; diff --git a/src/lib/xiph/OggFind.hxx b/src/lib/xiph/OggFind.hxx index d04b0b3b3..f2050118d 100644 --- a/src/lib/xiph/OggFind.hxx +++ b/src/lib/xiph/OggFind.hxx @@ -47,10 +47,13 @@ OggSeekPageAtOffset(OggSyncState &oy, ogg_stream_state &os, InputStream &is, * Try to find the end-of-stream (EOS) packet. Seek to the end of the * file if necessary. * + * @param synced is the #OggSyncState currently synced? If not, then + * we need to use ogg_sync_pageseek() instead of ogg_sync_pageout(), + * which is more expensive * @return true if the EOS packet was found */ bool OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet, - InputStream &is); + InputStream &is, bool synced=true); #endif diff --git a/test/DumpDecoderClient.cxx b/test/DumpDecoderClient.cxx index c71d27717..35c787b45 100644 --- a/test/DumpDecoderClient.cxx +++ b/test/DumpDecoderClient.cxx @@ -28,15 +28,15 @@ void DumpDecoderClient::Ready(const AudioFormat audio_format, - gcc_unused bool seekable, + bool seekable, SignedSongTime duration) noexcept { assert(!initialized); assert(audio_format.IsValid()); - fprintf(stderr, "audio_format=%s duration=%f\n", + fprintf(stderr, "audio_format=%s duration=%f seekable=%d\n", ToString(audio_format).c_str(), - duration.ToDoubleS()); + duration.ToDoubleS(), seekable); initialized = true; } diff --git a/test/meson.build b/test/meson.build index 7fcf4c822..71dacd67c 100644 --- a/test/meson.build +++ b/test/meson.build @@ -6,10 +6,14 @@ if compiler.get_id() == 'gcc' gtest_compile_args += [ '-Wno-suggest-attribute=format', '-Wno-suggest-attribute=noreturn', - '-Wno-missing-declarations', + ] +endif - # needed on Jessie for gtest's IsNullLiteralHelper - '-Wno-conversion-null', +if compiler.get_id() == 'clang' and compiler.version().version_compare('>=9') + gtest_compile_args += [ + # work around clang warning caused by GTest's wrong "-lpthread" + # compiler flag + '-Wno-unused-command-line-argument', ] endif