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
8fef4af7
Commit
8fef4af7
authored
May 30, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Bridge: add method OpenLocal()
parent
cfb678d6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
Bridge.cxx
src/decoder/Bridge.cxx
+8
-0
Bridge.hxx
src/decoder/Bridge.hxx
+7
-1
Thread.cxx
src/decoder/Thread.cxx
+1
-2
No files found.
src/decoder/Bridge.cxx
View file @
8fef4af7
...
...
@@ -30,6 +30,8 @@
#include "tag/Tag.hxx"
#include "Log.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include "fs/Path.hxx"
#include "util/ConstBuffer.hxx"
#include "util/StringBuffer.hxx"
...
...
@@ -49,6 +51,12 @@ DecoderBridge::~DecoderBridge() noexcept
assert
(
current_chunk
==
nullptr
);
}
InputStreamPtr
DecoderBridge
::
OpenLocal
(
Path
path_fs
)
{
return
OpenLocalInputStream
(
path_fs
,
dc
.
mutex
);
}
bool
DecoderBridge
::
CheckCancelRead
()
const
noexcept
{
...
...
src/decoder/Bridge.hxx
View file @
8fef4af7
/*
* Copyright 2003-201
8
The Music Player Daemon Project
* Copyright 2003-201
9
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -30,6 +30,7 @@
class
PcmConvert
;
struct
MusicChunk
;
class
DecoderControl
;
class
Path
;
struct
Tag
;
/**
...
...
@@ -153,6 +154,11 @@ public:
std
::
rethrow_exception
(
error
);
}
/**
* Open a local file.
*/
InputStreamPtr
OpenLocal
(
Path
path_fs
);
/* virtual methods from DecoderClient */
void
Ready
(
AudioFormat
audio_format
,
bool
seekable
,
SignedSongTime
duration
)
override
;
...
...
src/decoder/Thread.cxx
View file @
8fef4af7
...
...
@@ -27,7 +27,6 @@
#include "fs/AllocatedPath.hxx"
#include "DecoderAPI.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include "input/Registry.hxx"
#include "DecoderList.hxx"
#include "system/Error.hxx"
...
...
@@ -347,7 +346,7 @@ decoder_run_file(DecoderBridge &bridge, const char *uri_utf8, Path path_fs)
InputStreamPtr
input_stream
;
try
{
input_stream
=
OpenLocalInputStream
(
path_fs
,
bridge
.
dc
.
mutex
);
input_stream
=
bridge
.
OpenLocal
(
path_fs
);
}
catch
(
const
std
::
system_error
&
e
)
{
if
(
IsPathNotFound
(
e
)
&&
/* ENOTDIR means this may be a path inside a
...
...
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