Merge branch 'v0.21.x'

This commit is contained in:
Max Kellermann 2020-02-04 16:49:18 +01:00
commit 3fc859c42d
11 changed files with 39 additions and 16 deletions

6
NEWS
View File

@ -35,6 +35,12 @@ ver 0.22 (not yet released)
* switch to C++17 * switch to C++17
- GCC 7 or clang 4 (or newer) recommended - 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) ver 0.21.19 (2020/01/17)
* configuration * configuration
- allow overriding top-level settings in includes - allow overriding top-level settings in includes

View File

@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.musicpd" package="org.musicpd"
android:installLocation="auto" android:installLocation="auto"
android:versionCode="42" android:versionCode="43"
android:versionName="0.21.19"> android:versionName="0.21.20">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28"/> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28"/>

View File

@ -269,6 +269,8 @@ static const char *const audiofile_suffixes[] = {
}; };
static const char *const audiofile_mime_types[] = { static const char *const audiofile_mime_types[] = {
"audio/wav",
"audio/aiff",
"audio/x-wav", "audio/x-wav",
"audio/x-aiff", "audio/x-aiff",
nullptr nullptr

View File

@ -698,7 +698,7 @@ static const char *const ffmpeg_mime_types[] = {
"audio/aac", "audio/aac",
"audio/aacp", "audio/aacp",
"audio/ac3", "audio/ac3",
"audio/aiff" "audio/aiff",
"audio/amr", "audio/amr",
"audio/basic", "audio/basic",
"audio/flac", "audio/flac",
@ -711,12 +711,13 @@ static const char *const ffmpeg_mime_types[] = {
"audio/qcelp", "audio/qcelp",
"audio/vorbis", "audio/vorbis",
"audio/vorbis+ogg", "audio/vorbis+ogg",
"audio/wav",
"audio/x-8svx", "audio/x-8svx",
"audio/x-16sv", "audio/x-16sv",
"audio/x-aac", "audio/x-aac",
"audio/x-ac3", "audio/x-ac3",
"audio/x-adx", "audio/x-adx",
"audio/x-aiff" "audio/x-aiff",
"audio/x-alaw", "audio/x-alaw",
"audio/x-au", "audio/x-au",
"audio/x-dca", "audio/x-dca",
@ -736,7 +737,7 @@ static const char *const ffmpeg_mime_types[] = {
"audio/x-pn-realaudio", "audio/x-pn-realaudio",
"audio/x-pn-multirate-realaudio", "audio/x-pn-multirate-realaudio",
"audio/x-speex", "audio/x-speex",
"audio/x-tta" "audio/x-tta",
"audio/x-voc", "audio/x-voc",
"audio/x-wav", "audio/x-wav",
"audio/x-wma", "audio/x-wma",

View File

@ -760,7 +760,7 @@ MadDecoder::DecodeFirstFrame(Tag *tag) noexcept
if (max_frames > 8 * 1024 * 1024) { if (max_frames > 8 * 1024 * 1024) {
FormatWarning(mad_domain, FormatWarning(mad_domain,
"mp3 file header indicates too many frames: %lu", "mp3 file header indicates too many frames: %zu",
max_frames); max_frames);
return false; return false;
} }

View File

@ -45,8 +45,12 @@ OggDecoder::LoadEndPacket(ogg_packet &packet) const
DecoderReader reader(client, input_stream); DecoderReader reader(client, input_stream);
OggSyncState sync2(reader); OggSyncState sync2(reader);
OggStreamState stream2(GetSerialNo()); 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, result = OggSeekFindEOS(sync2, stream2, packet,
input_stream); input_stream, false);
} }
/* restore the previous file position */ /* restore the previous file position */

View File

@ -323,6 +323,8 @@ static const char *const sndfile_suffixes[] = {
}; };
static const char *const sndfile_mime_types[] = { static const char *const sndfile_mime_types[] = {
"audio/wav",
"audio/aiff",
"audio/x-wav", "audio/x-wav",
"audio/x-aiff", "audio/x-aiff",

View File

@ -57,13 +57,14 @@ OggSeekPageAtOffset(OggSyncState &oy, ogg_stream_state &os, InputStream &is,
bool bool
OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet, OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet,
InputStream &is) InputStream &is, bool synced)
{ {
if (!is.KnownSize()) if (!is.KnownSize())
return false; return false;
if (is.GetRest() < 65536) if (is.GetRest() < 65536)
return OggFindEOS(oy, os, packet); return (synced || oy.ExpectPageSeekIn(os)) &&
OggFindEOS(oy, os, packet);
if (!is.CheapSeeking()) if (!is.CheapSeeking())
return false; return false;

View File

@ -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 * Try to find the end-of-stream (EOS) packet. Seek to the end of the
* file if necessary. * 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 * @return true if the EOS packet was found
*/ */
bool bool
OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet, OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet,
InputStream &is); InputStream &is, bool synced=true);
#endif #endif

View File

@ -28,15 +28,15 @@
void void
DumpDecoderClient::Ready(const AudioFormat audio_format, DumpDecoderClient::Ready(const AudioFormat audio_format,
gcc_unused bool seekable, bool seekable,
SignedSongTime duration) noexcept SignedSongTime duration) noexcept
{ {
assert(!initialized); assert(!initialized);
assert(audio_format.IsValid()); 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(), ToString(audio_format).c_str(),
duration.ToDoubleS()); duration.ToDoubleS(), seekable);
initialized = true; initialized = true;
} }

View File

@ -6,10 +6,14 @@ if compiler.get_id() == 'gcc'
gtest_compile_args += [ gtest_compile_args += [
'-Wno-suggest-attribute=format', '-Wno-suggest-attribute=format',
'-Wno-suggest-attribute=noreturn', '-Wno-suggest-attribute=noreturn',
'-Wno-missing-declarations', ]
endif
# needed on Jessie for gtest's IsNullLiteralHelper if compiler.get_id() == 'clang' and compiler.version().version_compare('>=9')
'-Wno-conversion-null', gtest_compile_args += [
# work around clang warning caused by GTest's wrong "-lpthread"
# compiler flag
'-Wno-unused-command-line-argument',
] ]
endif endif