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
44d2d9b1
Commit
44d2d9b1
authored
Oct 02, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PlaylistStream: pass Path instance to playlist_open_path()
Convert filesystem charset to UTF-8 for playlist_list_open_uri(). This fixes one of many remaining charset bugs.
parent
8302ed44
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
PlaylistMapper.cxx
src/playlist/PlaylistMapper.cxx
+2
-2
PlaylistStream.cxx
src/playlist/PlaylistStream.cxx
+14
-7
PlaylistStream.hxx
src/playlist/PlaylistStream.hxx
+3
-2
No files found.
src/playlist/PlaylistMapper.cxx
View file @
44d2d9b1
...
...
@@ -41,7 +41,7 @@ playlist_open_in_playlist_dir(const char *uri, Mutex &mutex, Cond &cond)
if
(
path_fs
.
IsNull
())
return
nullptr
;
return
playlist_open_path
(
path_fs
.
c_str
()
,
mutex
,
cond
);
return
playlist_open_path
(
path_fs
,
mutex
,
cond
);
}
#ifdef ENABLE_DATABASE
...
...
@@ -61,7 +61,7 @@ playlist_open_in_storage(const char *uri, const Storage *storage,
{
const
auto
path
=
storage
->
MapFS
(
uri
);
if
(
!
path
.
IsNull
())
return
playlist_open_path
(
path
.
c_str
()
,
mutex
,
cond
);
return
playlist_open_path
(
path
,
mutex
,
cond
);
}
const
auto
uri2
=
storage
->
MapUTF8
(
uri
);
...
...
src/playlist/PlaylistStream.cxx
View file @
44d2d9b1
...
...
@@ -24,21 +24,23 @@
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "input/InputStream.hxx"
#include "fs/Path.hxx"
#include "Log.hxx"
#include <assert.h>
static
SongEnumerator
*
playlist_open_path_suffix
(
const
char
*
path_fs
,
Mutex
&
mutex
,
Cond
&
cond
)
playlist_open_path_suffix
(
Path
path
,
Mutex
&
mutex
,
Cond
&
cond
)
{
assert
(
path_fs
!=
nullptr
);
assert
(
!
path
.
IsNull
()
);
const
char
*
suffix
=
uri_get_suffix
(
path
_fs
);
const
char
*
suffix
=
uri_get_suffix
(
path
.
c_str
()
);
if
(
suffix
==
nullptr
||
!
playlist_suffix_supported
(
suffix
))
return
nullptr
;
Error
error
;
InputStream
*
is
=
InputStream
::
OpenReady
(
path_fs
,
mutex
,
cond
,
error
);
InputStream
*
is
=
InputStream
::
OpenReady
(
path
.
c_str
(),
mutex
,
cond
,
error
);
if
(
is
==
nullptr
)
{
if
(
error
.
IsDefined
())
LogError
(
error
);
...
...
@@ -56,11 +58,16 @@ playlist_open_path_suffix(const char *path_fs, Mutex &mutex, Cond &cond)
}
SongEnumerator
*
playlist_open_path
(
const
char
*
path_fs
,
Mutex
&
mutex
,
Cond
&
cond
)
playlist_open_path
(
Path
path
,
Mutex
&
mutex
,
Cond
&
cond
)
{
auto
playlist
=
playlist_list_open_uri
(
path_fs
,
mutex
,
cond
);
assert
(
!
path
.
IsNull
());
const
std
::
string
uri_utf8
=
path
.
ToUTF8
();
auto
playlist
=
!
uri_utf8
.
empty
()
?
playlist_list_open_uri
(
uri_utf8
.
c_str
(),
mutex
,
cond
)
:
nullptr
;
if
(
playlist
==
nullptr
)
playlist
=
playlist_open_path_suffix
(
path
_fs
,
mutex
,
cond
);
playlist
=
playlist_open_path_suffix
(
path
,
mutex
,
cond
);
return
playlist
;
}
...
...
src/playlist/PlaylistStream.hxx
View file @
44d2d9b1
...
...
@@ -25,18 +25,19 @@
class
Mutex
;
class
Cond
;
class
SongEnumerator
;
class
Path
;
/**
* Opens a playlist from a local file.
*
* @param path
_fs
the path of the playlist file
* @param path the path of the playlist file
* @param is_r on success, an input_stream object is returned here,
* which must be closed after the playlist_provider object is freed
* @return a playlist, or nullptr on error
*/
gcc_nonnull_all
SongEnumerator
*
playlist_open_path
(
const
char
*
path_fs
,
Mutex
&
mutex
,
Cond
&
cond
);
playlist_open_path
(
Path
path
,
Mutex
&
mutex
,
Cond
&
cond
);
gcc_nonnull_all
SongEnumerator
*
...
...
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