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
44bbf42a
Commit
44bbf42a
authored
Sep 19, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.20.x'
parents
030f87c9
75c740fe
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
22 deletions
+83
-22
NEWS
NEWS
+2
-0
user.xml
doc/user.xml
+54
-0
FfmpegDecoderPlugin.cxx
src/decoder/plugins/FfmpegDecoderPlugin.cxx
+7
-1
SndioOutputPlugin.cxx
src/output/plugins/SndioOutputPlugin.cxx
+19
-20
SndioOutputPlugin.hxx
src/output/plugins/SndioOutputPlugin.hxx
+1
-1
No files found.
NEWS
View file @
44bbf42a
...
...
@@ -12,6 +12,8 @@ ver 0.21 (not yet released)
ver 0.20.11 (not yet released)
* storage
- curl: support Content-Type application/xml
* decoder
- ffmpeg: more reliable song duration
ver 0.20.10 (2017/08/24)
* decoder
...
...
doc/user.xml
View file @
44bbf42a
...
...
@@ -2991,6 +2991,60 @@ run</programlisting>
</informaltable>
</section>
<section
id=
"opus_encoder"
>
<title><varname>
opus
</varname></title>
<para>
Encodes into
<ulink
url=
"http://www.opus-codec.org/"
>
Ogg Opus
</ulink>
.
</para>
<informaltable>
<tgroup
cols=
"2"
>
<thead>
<row>
<entry>
Setting
</entry>
<entry>
Description
</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<varname>
bitrate
</varname>
</entry>
<entry>
Sets the data rate in bit per second. The special
value "auto" lets
<application>
libopus
</application>
choose a rate (which is the default), and "max" uses
the maximum possible data rate.
</entry>
</row>
<row>
<entry>
<varname>
complexity
</varname>
</entry>
<entry>
Sets the
<ulink
url=
"https://wiki.xiph.org/OpusFAQ#What_is_the_complexity_of_Opus.3F"
>
Opus
complexity
</ulink>
.
</entry>
</row>
<row>
<entry>
<varname>
signal
</varname>
</entry>
<entry>
Sets the Opus signal type. Valid values are "auto"
(the default), "voice" and "music".
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section
id=
"vorbis_encoder"
>
<title><varname>
vorbis
</varname></title>
...
...
src/decoder/plugins/FfmpegDecoderPlugin.cxx
View file @
44bbf42a
...
...
@@ -712,7 +712,9 @@ FfmpegDecode(DecoderClient &client, InputStream &input,
#endif
const
SignedSongTime
total_time
=
FromFfmpegTimeChecked
(
av_stream
.
duration
,
av_stream
.
time_base
);
av_stream
.
duration
!=
(
int64_t
)
AV_NOPTS_VALUE
?
FromFfmpegTimeChecked
(
av_stream
.
duration
,
av_stream
.
time_base
)
:
FromFfmpegTimeChecked
(
format_context
.
duration
,
AV_TIME_BASE_Q
);
client
.
Ready
(
audio_format
,
input
.
IsSeekable
(),
total_time
);
...
...
@@ -842,6 +844,10 @@ FfmpegScanStream(AVFormatContext &format_context,
tag_handler_invoke_duration
(
handler
,
handler_ctx
,
FromFfmpegTime
(
stream
.
duration
,
stream
.
time_base
));
else
if
(
format_context
.
duration
!=
(
int64_t
)
AV_NOPTS_VALUE
)
tag_handler_invoke_duration
(
handler
,
handler_ctx
,
FromFfmpegTime
(
format_context
.
duration
,
AV_TIME_BASE_Q
));
FfmpegScanMetadata
(
format_context
,
audio_stream
,
handler
,
handler_ctx
);
...
...
src/output/plugins/SndioOutputPlugin.cxx
View file @
44bbf42a
...
...
@@ -66,16 +66,14 @@ SndioOutput::Create(EventLoop &, const ConfigBlock &block) {
static
bool
sndio_test_default_device
()
{
struct
sio_hdl
*
sio_hdl
;
sio_hdl
=
sio_open
(
SIO_DEVANY
,
SIO_PLAY
,
0
);
if
(
!
sio_hdl
)
{
auto
*
hdl
=
sio_open
(
SIO_DEVANY
,
SIO_PLAY
,
0
);
if
(
!
hdl
)
{
FormatError
(
sndio_output_domain
,
"Error opening default sndio device"
);
return
false
;
}
sio_close
(
sio_
hdl
);
sio_close
(
hdl
);
return
true
;
}
...
...
@@ -85,8 +83,8 @@ SndioOutput::Open(AudioFormat &audio_format)
struct
sio_par
par
;
unsigned
bits
,
rate
,
chans
;
sio_
hdl
=
sio_open
(
device
,
SIO_PLAY
,
0
);
if
(
!
sio_
hdl
)
hdl
=
sio_open
(
device
,
SIO_PLAY
,
0
);
if
(
!
hdl
)
throw
std
::
runtime_error
(
"Failed to open default sndio device"
);
switch
(
audio_format
.
format
)
{
...
...
@@ -116,9 +114,9 @@ SndioOutput::Open(AudioFormat &audio_format)
par
.
le
=
SIO_LE_NATIVE
;
par
.
appbufsz
=
rate
*
buffer_time
/
1000
;
if
(
!
sio_setpar
(
sio_
hdl
,
&
par
)
||
!
sio_getpar
(
sio_
hdl
,
&
par
))
{
sio_close
(
sio_
hdl
);
if
(
!
sio_setpar
(
hdl
,
&
par
)
||
!
sio_getpar
(
hdl
,
&
par
))
{
sio_close
(
hdl
);
throw
std
::
runtime_error
(
"Failed to set/get audio params"
);
}
...
...
@@ -128,21 +126,21 @@ SndioOutput::Open(AudioFormat &audio_format)
par
.
pchan
!=
chans
||
par
.
sig
!=
1
||
par
.
le
!=
SIO_LE_NATIVE
)
{
sio_close
(
sio_
hdl
);
sio_close
(
hdl
);
throw
std
::
runtime_error
(
"Requested audio params cannot be satisfied"
);
}
// Set volume after opening fresh audio stream which does
// know nothing about previous audio streams.
sio_setvol
(
sio_
hdl
,
raw_volume
);
sio_setvol
(
hdl
,
raw_volume
);
// sio_onvol returns 0 if no volume knob is available.
// This is the case on raw audio devices rather than
// the sndiod audio server.
if
(
sio_onvol
(
sio_
hdl
,
VolumeCallback
,
this
)
==
0
)
if
(
sio_onvol
(
hdl
,
VolumeCallback
,
this
)
==
0
)
raw_volume
=
-
1
;
if
(
!
sio_start
(
sio_
hdl
))
{
sio_close
(
sio_
hdl
);
if
(
!
sio_start
(
hdl
))
{
sio_close
(
hdl
);
throw
std
::
runtime_error
(
"Failed to start audio device"
);
}
}
...
...
@@ -150,7 +148,7 @@ SndioOutput::Open(AudioFormat &audio_format)
void
SndioOutput
::
Close
()
noexcept
{
sio_close
(
sio_
hdl
);
sio_close
(
hdl
);
}
size_t
...
...
@@ -158,15 +156,16 @@ SndioOutput::Play(const void *chunk, size_t size)
{
size_t
n
;
n
=
sio_write
(
sio_
hdl
,
chunk
,
size
);
if
(
n
==
0
&&
sio_eof
(
sio_
hdl
)
!=
0
)
n
=
sio_write
(
hdl
,
chunk
,
size
);
if
(
n
==
0
&&
sio_eof
(
hdl
)
!=
0
)
throw
std
::
runtime_error
(
"sndio write failed"
);
return
n
;
}
void
SndioOutput
::
SetVolume
(
unsigned
int
volume
)
{
sio_setvol
(
sio_hdl
,
volume
*
SIO_MAXVOL
/
100
);
SndioOutput
::
SetVolume
(
unsigned
int
volume
)
{
sio_setvol
(
hdl
,
volume
*
SIO_MAXVOL
/
100
);
}
static
inline
unsigned
int
...
...
src/output/plugins/SndioOutputPlugin.hxx
View file @
44bbf42a
...
...
@@ -30,7 +30,7 @@ class SndioOutput final : AudioOutput {
MixerListener
*
listener
=
nullptr
;
const
char
*
const
device
;
const
unsigned
buffer_time
;
/* in ms */
struct
sio_hdl
*
sio_
hdl
;
struct
sio_hdl
*
hdl
;
int
raw_volume
;
public
:
...
...
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