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
fef6b9df
Commit
fef6b9df
authored
May 30, 2023
by
Shen-Ta Hsieh
Committed by
Max Kellermann
Jun 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flac: Try `InputStream` interface if flac failed to read through a `wchar_t` path
parent
d52eac66
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
NEWS
NEWS
+1
-0
FlacDecoderPlugin.cxx
src/decoder/plugins/FlacDecoderPlugin.cxx
+21
-4
No files found.
NEWS
View file @
fef6b9df
ver 0.23.14 (not yet released)
* decoder
- flac: fix scanning files with non-ASCII names on Windows
- mad: fix calculation of LAME peak values
* mixer
- wasapi: fix problem setting volume
...
...
src/decoder/plugins/FlacDecoderPlugin.cxx
View file @
fef6b9df
...
...
@@ -24,6 +24,7 @@
#include "lib/xiph/FlacMetadataChain.hxx"
#include "OggCodec.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include "fs/Path.hxx"
#include "fs/NarrowPath.hxx"
#include "Log.hxx"
...
...
@@ -71,16 +72,32 @@ flac_write_cb(const FLAC__StreamDecoder *dec, const FLAC__Frame *frame,
}
static
bool
flac_scan_file
(
Path
path_fs
,
TagHandler
&
handler
)
noexcept
{
flac_scan_file
(
Path
path_fs
,
TagHandler
&
handler
)
noexcept
{
FlacMetadataChain
chain
;
if
(
!
chain
.
Read
(
NarrowPath
(
path_fs
)))
{
const
bool
succeed
=
[
&
chain
,
&
path_fs
]()
noexcept
{
// read by NarrowPath
if
(
chain
.
Read
(
NarrowPath
(
path_fs
)))
{
return
true
;
}
if
(
std
::
is_same_v
<
Path
::
value_type
,
char
>
||
chain
.
GetStatus
()
!=
FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE
)
{
return
false
;
}
// read by InputStream
Mutex
mutex
;
auto
is
=
OpenLocalInputStream
(
path_fs
,
mutex
);
if
(
is
&&
chain
.
Read
(
*
is
))
{
return
true
;
}
return
false
;
}();
if
(
!
succeed
)
{
FmtDebug
(
flac_domain
,
"Failed to read FLAC tags: {}"
,
chain
.
GetStatusString
());
return
false
;
}
chain
.
Scan
(
handler
);
return
true
;
}
...
...
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