Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
9bcd02d1
Commit
9bcd02d1
authored
Aug 10, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.21.x'
parents
cf9ee339
2d61e526
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
18 deletions
+80
-18
NEWS
NEWS
+6
-0
AndroidManifest.xml
android/AndroidManifest.xml
+2
-2
SidplayDecoderPlugin.cxx
src/decoder/plugins/SidplayDecoderPlugin.cxx
+72
-16
No files found.
NEWS
View file @
9bcd02d1
...
...
@@ -22,6 +22,12 @@ ver 0.22 (not yet released)
* switch to C++17
- GCC 7 or clang 4 (or newer) recommended
ver 0.21.14 (not yet released)
* decoder
- sidplay: show track durations in database
- sidplay: convert tag values from Windows-1252 charset
- sidplay: strip text from "Date" tag
ver 0.21.13 (2019/08/06)
* input
- cdio_paranoia: require libcdio-paranoia 10.2+0.93+1
...
...
android/AndroidManifest.xml
View file @
9bcd02d1
...
...
@@ -2,8 +2,8 @@
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"org.musicpd"
android:installLocation=
"auto"
android:versionCode=
"3
6
"
android:versionName=
"0.21.1
3
"
>
android:versionCode=
"3
7
"
android:versionName=
"0.21.1
4
"
>
<uses-sdk
android:minSdkVersion=
"21"
android:targetSdkVersion=
"26"
/>
...
...
src/decoder/plugins/SidplayDecoderPlugin.cxx
View file @
9bcd02d1
...
...
@@ -25,6 +25,7 @@
#include "song/DetachedSong.hxx"
#include "fs/Path.hxx"
#include "fs/AllocatedPath.hxx"
#include "lib/icu/Converter.hxx"
#ifdef HAVE_SIDPLAYFP
#include "fs/io/FileReader.hxx"
#include "util/RuntimeError.hxx"
...
...
@@ -32,6 +33,8 @@
#include "util/StringFormat.hxx"
#include "util/StringView.hxx"
#include "util/Domain.hxx"
#include "util/AllocatedString.hxx"
#include "util/CharUtil.hxx"
#include "util/ByteOrder.hxx"
#include "Log.hxx"
...
...
@@ -437,19 +440,70 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
}
while
(
cmd
!=
DecoderCommand
::
STOP
);
}
static
AllocatedString
<
char
>
Windows1252ToUTF8
(
const
char
*
s
)
noexcept
{
#ifdef HAVE_ICU_CONVERTER
try
{
std
::
unique_ptr
<
IcuConverter
>
converter
(
IcuConverter
::
Create
(
"windows-1252"
));
return
converter
->
ToUTF8
(
s
);
}
catch
(...)
{
}
#endif
/*
* Fallback to not transcoding windows-1252 to utf-8, that may result
* in invalid utf-8 unless nonprintable characters are replaced.
*/
auto
t
=
AllocatedString
<
char
>::
Duplicate
(
s
);
for
(
size_t
i
=
0
;
t
[
i
]
!=
AllocatedString
<
char
>::
SENTINEL
;
i
++
)
if
(
!
IsPrintableASCII
(
t
[
i
]))
t
[
i
]
=
'?'
;
return
t
;
}
gcc_pure
static
const
char
*
static
AllocatedString
<
char
>
GetInfoString
(
const
SidTuneInfo
&
info
,
unsigned
i
)
noexcept
{
#ifdef HAVE_SIDPLAYFP
return
info
.
numberOfInfoStrings
()
>
i
const
char
*
s
=
info
.
numberOfInfoStrings
()
>
i
?
info
.
infoString
(
i
)
:
nullptr
;
:
""
;
#else
return
info
.
numberOfInfoStrings
>
i
const
char
*
s
=
info
.
numberOfInfoStrings
>
i
?
info
.
infoString
[
i
]
:
nullptr
;
:
""
;
#endif
return
Windows1252ToUTF8
(
s
);
}
gcc_pure
static
AllocatedString
<
char
>
GetDateString
(
const
SidTuneInfo
&
info
)
noexcept
{
/*
* Field 2 is called <released>, previously used as <copyright>.
* It is formatted <year><space><company or author or group>,
* where <year> may be <YYYY>, <YYY?>, <YY??> or <YYYY-YY>, for
* example "1987", "199?", "19??" or "1985-87". The <company or
* author or group> may be for example Rob Hubbard. A full field
* may be for example "1987 Rob Hubbard".
*/
AllocatedString
<
char
>
release
=
GetInfoString
(
info
,
2
);
/* Keep the <year> part only for the date. */
for
(
size_t
i
=
0
;
release
[
i
]
!=
AllocatedString
<
char
>::
SENTINEL
;
i
++
)
if
(
std
::
isspace
(
release
[
i
]))
{
release
[
i
]
=
AllocatedString
<
char
>::
SENTINEL
;
break
;
}
return
release
;
}
static
void
...
...
@@ -457,31 +511,29 @@ ScanSidTuneInfo(const SidTuneInfo &info, unsigned track, unsigned n_tracks,
TagHandler
&
handler
)
noexcept
{
/* title */
const
char
*
title
=
GetInfoString
(
info
,
0
);
if
(
title
==
nullptr
)
title
=
""
;
const
auto
title
=
GetInfoString
(
info
,
0
);
if
(
n_tracks
>
1
)
{
const
auto
tag_title
=
StringFormat
<
1024
>
(
"%s (%u/%u)"
,
title
,
track
,
n_tracks
);
title
.
c_str
()
,
track
,
n_tracks
);
handler
.
OnTag
(
TAG_TITLE
,
tag_title
.
c_str
());
}
else
handler
.
OnTag
(
TAG_TITLE
,
title
);
handler
.
OnTag
(
TAG_TITLE
,
title
.
c_str
()
);
/* artist */
const
char
*
artist
=
GetInfoString
(
info
,
1
);
if
(
artist
!=
nullptr
)
handler
.
OnTag
(
TAG_ARTIST
,
artist
);
const
auto
artist
=
GetInfoString
(
info
,
1
);
if
(
!
artist
.
empty
()
)
handler
.
OnTag
(
TAG_ARTIST
,
artist
.
c_str
()
);
/* genre */
if
(
!
default_genre
.
empty
())
handler
.
OnTag
(
TAG_GENRE
,
default_genre
.
c_str
());
/* date */
const
char
*
date
=
GetInfoString
(
info
,
2
);
if
(
date
!=
nullptr
)
handler
.
OnTag
(
TAG_DATE
,
date
);
const
auto
date
=
GetDateString
(
info
);
if
(
!
date
.
empty
()
)
handler
.
OnTag
(
TAG_DATE
,
date
.
c_str
()
);
/* track */
handler
.
OnTag
(
TAG_TRACK
,
StringFormat
<
16
>
(
"%u"
,
track
).
c_str
());
...
...
@@ -556,6 +608,10 @@ sidplay_container_scan(Path path_fs)
AddTagHandler
h
(
tag_builder
);
ScanSidTuneInfo
(
info
,
i
,
n_tracks
,
h
);
const
SignedSongTime
duration
=
get_song_length
(
tune
);
if
(
!
duration
.
IsNegative
())
h
.
OnDuration
(
SongTime
(
duration
));
char
track_name
[
32
];
/* Construct container/tune path names, eg.
Delta.sid/tune_001.sid */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment