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
35a2a48c
Commit
35a2a48c
authored
Nov 17, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.19.x'
parents
22dcca98
7019f6be
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
15 deletions
+47
-15
NEWS
NEWS
+4
-0
protocol.xml
doc/protocol.xml
+2
-2
PcmDecoderPlugin.cxx
src/decoder/plugins/PcmDecoderPlugin.cxx
+33
-12
AlsaInputPlugin.cxx
src/input/plugins/AlsaInputPlugin.cxx
+4
-0
AlsaOutputPlugin.cxx
src/output/plugins/AlsaOutputPlugin.cxx
+3
-0
WinmmOutputPlugin.cxx
src/output/plugins/WinmmOutputPlugin.cxx
+1
-1
No files found.
NEWS
View file @
35a2a48c
...
...
@@ -57,7 +57,11 @@ ver 0.20 (not yet released)
ver 0.19.20 (not yet released)
* decoder
- ffmpeg: ignore empty packets
- pcm: fix corruption bug with partial frames (after short read)
- sidplay: fix playback speed with libsidplayfp
* output
- winmm: fix 8 bit playback
* fix gcc 7.0 -Wimplicit-fallthrough
ver 0.19.19 (2016/08/23)
* decoder
...
...
doc/protocol.xml
View file @
35a2a48c
...
...
@@ -66,8 +66,8 @@
<function>
strcpy
</function>
just fine with UTF-8 encoded
strings. For example:
<returnvalue>
OK
</returnvalue>
encoded in
UTF-8 is simply
<returnvalue>
OK
</returnvalue>
. For more
information on UTF
=
8:
http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
)
information on UTF
-
8:
<ulink
url=
"http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8"
/>
)
</para>
</section>
...
...
src/decoder/plugins/PcmDecoderPlugin.cxx
View file @
35a2a48c
...
...
@@ -25,16 +25,34 @@
#include "system/ByteOrder.hxx"
#include "util/Domain.hxx"
#include "util/ByteReverse.hxx"
#include "util/StaticFifoBuffer.hxx"
#include "util/NumberParser.hxx"
#include "util/MimeType.hxx"
#include "Log.hxx"
#include <stdexcept>
#include <assert.h>
#include <string.h>
static
constexpr
Domain
pcm_decoder_domain
(
"pcm_decoder"
);
template
<
typename
B
>
static
bool
FillBuffer
(
Decoder
&
decoder
,
InputStream
&
is
,
B
&
buffer
)
{
buffer
.
Shift
();
auto
w
=
buffer
.
Write
();
assert
(
!
w
.
IsEmpty
());
size_t
nbytes
=
decoder_read
(
decoder
,
is
,
w
.
data
,
w
.
size
);
if
(
nbytes
==
0
&&
is
.
LockIsEOF
())
return
false
;
buffer
.
Append
(
nbytes
);
return
true
;
}
static
void
pcm_stream_decode
(
Decoder
&
decoder
,
InputStream
&
is
)
{
...
...
@@ -128,25 +146,27 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
decoder_initialized
(
decoder
,
audio_format
,
is
.
IsSeekable
(),
total_time
);
StaticFifoBuffer
<
uint8_t
,
4096
>
buffer
;
DecoderCommand
cmd
;
do
{
char
buffer
[
4096
];
size_t
nbytes
=
decoder_read
(
decoder
,
is
,
buffer
,
sizeof
(
buffer
));
if
(
nbytes
==
0
&&
is
.
LockIsEOF
())
if
(
!
FillBuffer
(
decoder
,
is
,
buffer
))
break
;
auto
r
=
buffer
.
Read
();
/* round down to the nearest frame size, because we
must not pass partial frames to decoder_data() */
r
.
size
-=
r
.
size
%
frame_size
;
buffer
.
Consume
(
r
.
size
);
if
(
reverse_endian
)
/* make sure we deliver samples in host byte order */
reverse_bytes_16
((
uint16_t
*
)
buffer
,
(
uint16_t
*
)
buffer
,
(
uint16_t
*
)(
buffer
+
nbytes
));
reverse_bytes_16
((
uint16_t
*
)
r
.
data
,
(
uint16_t
*
)
r
.
data
,
(
uint16_t
*
)(
r
.
data
+
r
.
size
));
cmd
=
nbytes
>
0
?
decoder_data
(
decoder
,
is
,
buffer
,
nbytes
,
0
)
cmd
=
!
r
.
IsEmpty
()
?
decoder_data
(
decoder
,
is
,
r
.
data
,
r
.
size
,
0
)
:
decoder_get_command
(
decoder
);
if
(
cmd
==
DecoderCommand
::
SEEK
)
{
uint64_t
frame
=
decoder_seek_where_frame
(
decoder
);
...
...
@@ -154,6 +174,7 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
try
{
is
.
LockSeek
(
offset
);
buffer
.
Clear
();
decoder_command_finished
(
decoder
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
LogError
(
e
);
...
...
src/input/plugins/AlsaInputPlugin.cxx
View file @
35a2a48c
...
...
@@ -223,6 +223,10 @@ AlsaInputStream::Recover(int err)
case
-
EPIPE
:
LogDebug
(
alsa_input_domain
,
"Buffer Overrun"
);
// drop through
#if GCC_CHECK_VERSION(7,0)
[[
fallthrough
]];
#endif
case
-
ESTRPIPE
:
case
-
EINTR
:
err
=
snd_pcm_recover
(
capture_handle
,
err
,
1
);
...
...
src/output/plugins/AlsaOutputPlugin.cxx
View file @
35a2a48c
...
...
@@ -774,6 +774,9 @@ AlsaOutput::Recover(int err)
if
(
err
==
-
EAGAIN
)
return
0
;
/* fall-through to snd_pcm_prepare: */
#if GCC_CHECK_VERSION(7,0)
[[
fallthrough
]];
#endif
case
SND_PCM_STATE_SETUP
:
case
SND_PCM_STATE_XRUN
:
period_position
=
0
;
...
...
src/output/plugins/WinmmOutputPlugin.cxx
View file @
35a2a48c
...
...
@@ -161,10 +161,10 @@ WinmmOutput::Open(AudioFormat &audio_format)
throw
std
::
runtime_error
(
"CreateEvent() failed"
);
switch
(
audio_format
.
format
)
{
case
SampleFormat
:
:
S8
:
case
SampleFormat
:
:
S16
:
break
;
case
SampleFormat
:
:
S8
:
case
SampleFormat
:
:
S24_P32
:
case
SampleFormat
:
:
S32
:
case
SampleFormat
:
:
FLOAT
:
...
...
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