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
52305113
Commit
52305113
authored
Nov 05, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.20.x'
parents
55e6629f
b111a8fe
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
5 deletions
+56
-5
NEWS
NEWS
+10
-0
VorbisDecoderPlugin.cxx
src/decoder/plugins/VorbisDecoderPlugin.cxx
+15
-1
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+20
-1
Thread.cxx
src/output/Thread.cxx
+2
-3
Thread.cxx
src/player/Thread.cxx
+9
-0
No files found.
NEWS
View file @
52305113
...
...
@@ -14,6 +14,16 @@ ver 0.21 (not yet released)
* mixer
- sndio: new mixer plugin
ver 0.20.12 (not yet released)
* input
- curl: fix seeking
* decoder
- vorbis: fix Tremor support
* player
- log message when decoder is too slow
* output
- fix hanging playback with soxr resampler
ver 0.20.11 (2017/10/18)
* storage
- curl: support Content-Type application/xml
...
...
src/decoder/plugins/VorbisDecoderPlugin.cxx
View file @
52305113
...
...
@@ -178,6 +178,20 @@ VorbisDecoder::SubmitInit()
client
.
Ready
(
audio_format
,
eos_granulepos
>
0
,
duration
);
}
#ifdef HAVE_TREMOR
static
inline
int16_t
tremor_clip_sample
(
int32_t
x
)
{
x
>>=
9
;
if
(
x
<
INT16_MIN
)
return
INT16_MIN
;
if
(
x
>
INT16_MAX
)
return
INT16_MAX
;
return
x
;
}
#endif
bool
VorbisDecoder
::
SubmitSomePcm
()
{
...
...
@@ -197,7 +211,7 @@ VorbisDecoder::SubmitSomePcm()
auto
*
dest
=
&
buffer
[
c
];
for
(
size_t
i
=
0
;
i
<
n_frames
;
++
i
)
{
*
dest
=
*
src
++
;
*
dest
=
tremor_clip_sample
(
*
src
++
)
;
dest
+=
channels
;
}
}
...
...
src/input/plugins/CurlInputPlugin.cxx
View file @
52305113
...
...
@@ -66,7 +66,6 @@ static const size_t CURL_RESUME_AT = 384 * 1024;
struct
CurlInputStream
final
:
public
AsyncInputStream
,
CurlResponseHandler
{
/* some buffers which were passed to libcurl, which we have
too free */
char
range
[
32
];
CurlSlist
request_headers
;
CurlRequest
*
request
=
nullptr
;
...
...
@@ -89,9 +88,20 @@ struct CurlInputStream final : public AsyncInputStream, CurlResponseHandler {
static
InputStream
*
Open
(
const
char
*
url
,
Mutex
&
mutex
,
Cond
&
cond
);
/**
* Create and initialize a new #CurlRequest instance. After
* this, you may add more request headers and set options. To
* actually start the request, call StartRequest().
*/
void
InitEasy
();
/**
* Start the request after having called InitEasy(). After
* this, you must not set any CURL options.
*/
void
StartRequest
();
/**
* Frees the current "libcurl easy" handle, and everything
* associated with it.
*
...
...
@@ -365,6 +375,11 @@ CurlInputStream::InitEasy()
request_headers
.
Clear
();
request_headers
.
Append
(
"Icy-Metadata: 1"
);
}
void
CurlInputStream
::
StartRequest
()
{
request
->
SetOption
(
CURLOPT_HTTPHEADER
,
request_headers
.
Get
());
request
->
Start
();
...
...
@@ -391,6 +406,7 @@ CurlInputStream::SeekInternal(offset_type new_offset)
/* send the "Range" header */
if
(
offset
>
0
)
{
char
range
[
32
];
#ifdef WIN32
// TODO: what can we use on Windows to format 64 bit?
sprintf
(
range
,
"%lu-"
,
(
long
)
offset
);
...
...
@@ -399,6 +415,8 @@ CurlInputStream::SeekInternal(offset_type new_offset)
#endif
request
->
SetOption
(
CURLOPT_RANGE
,
range
);
}
StartRequest
();
}
void
...
...
@@ -422,6 +440,7 @@ CurlInputStream::Open(const char *url, Mutex &mutex, Cond &cond)
try
{
BlockingCall
(
c
->
GetEventLoop
(),
[
c
](){
c
->
InitEasy
();
c
->
StartRequest
();
});
}
catch
(...)
{
delete
c
;
...
...
src/output/Thread.cxx
View file @
52305113
...
...
@@ -245,9 +245,9 @@ try {
inline
bool
AudioOutputControl
::
PlayChunk
()
noexcept
{
if
(
tags
)
{
// ensure pending tags are flushed in all cases
const
auto
*
tag
=
source
.
ReadTag
();
if
(
tag
!=
nullptr
)
{
if
(
tags
&&
tag
!=
nullptr
)
{
const
ScopeUnlock
unlock
(
mutex
);
try
{
output
->
SendTag
(
*
tag
);
...
...
@@ -256,7 +256,6 @@ AudioOutputControl::PlayChunk() noexcept
GetLogName
());
}
}
}
while
(
command
==
Command
::
NONE
)
{
const
auto
data
=
source
.
PeekData
();
...
...
src/player/Thread.cxx
View file @
52305113
...
...
@@ -32,6 +32,7 @@
#include "output/MultipleOutputs.hxx"
#include "tag/Tag.hxx"
#include "Idle.hxx"
#include "system/PeriodClock.hxx"
#include "util/Domain.hxx"
#include "thread/Name.hxx"
#include "Log.hxx"
...
...
@@ -146,6 +147,8 @@ class Player {
*/
SongTime
elapsed_time
;
PeriodClock
throttle_silence_log
;
public
:
Player
(
PlayerControl
&
_pc
,
DecoderControl
&
_dc
,
MusicBuffer
&
_buffer
)
...
...
@@ -934,6 +937,8 @@ Player::SongBorder()
{
FormatDefault
(
player_domain
,
"played
\"
%s
\"
"
,
song
->
GetURI
());
throttle_silence_log
.
Reset
();
ReplacePipe
(
dc
.
pipe
);
pc
.
outputs
.
SongBorder
();
...
...
@@ -1095,6 +1100,10 @@ Player::Run()
/* the decoder is too busy and hasn't provided
new PCM data in time: send silence (if the
output pipe is empty) */
if
(
throttle_silence_log
.
CheckUpdate
(
std
::
chrono
::
seconds
(
5
)))
FormatWarning
(
player_domain
,
"Decoder is too slow; playing silence to avoid xrun"
);
if
(
!
SendSilence
())
break
;
}
...
...
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