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
b504d631
Commit
b504d631
authored
Aug 08, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ProxyDatabasePlugin: use an artificial "root" directory
Fixes assertion failures in the Directory library.
parent
b4b1728b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
ProxyDatabasePlugin.cxx
src/db/ProxyDatabasePlugin.cxx
+8
-1
No files found.
src/db/ProxyDatabasePlugin.cxx
View file @
b504d631
...
...
@@ -49,6 +49,7 @@ class ProxyDatabase : public Database {
unsigned
port
;
struct
mpd_connection
*
connection
;
struct
directory
*
root
;
public
:
static
Database
*
Create
(
const
struct
config_param
*
param
,
...
...
@@ -124,6 +125,8 @@ ProxyDatabase::Open(GError **error_r)
return
false
;
}
root
=
directory_new_root
();
return
true
;
}
...
...
@@ -132,6 +135,7 @@ ProxyDatabase::Close()
{
assert
(
connection
!=
nullptr
);
directory_free
(
root
);
mpd_connection_free
(
connection
);
}
...
...
@@ -331,10 +335,13 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
// TODO: match
// TODO: auto-reconnect
struct
directory
*
parent
=
directory_new
(
selection
.
uri
,
nullptr
);
struct
directory
*
parent
=
*
selection
.
uri
==
0
?
root
:
directory_new
(
selection
.
uri
,
root
);
bool
success
=
::
Visit
(
connection
,
*
parent
,
selection
.
recursive
,
visit_directory
,
visit_song
,
visit_playlist
,
error_r
);
if
(
parent
!=
root
)
directory_free
(
parent
);
return
success
;
}
...
...
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