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
dc07180e
Commit
dc07180e
authored
Aug 08, 2022
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/CdioParanoia: add options "mode" and "skip"
Closes
https://github.com/MusicPlayerDaemon/MPD/issues/1529
parent
d3b235ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
NEWS
NEWS
+2
-0
plugins.rst
doc/plugins.rst
+5
-0
CdioParanoiaInputPlugin.cxx
src/input/plugins/CdioParanoiaInputPlugin.cxx
+24
-3
No files found.
NEWS
View file @
dc07180e
ver 0.23.9 (not yet released)
* input
- cdio_paranoia: add options "mode" and "skip"
* decoder
- ffmpeg: support FFmpeg 5.1
* output
...
...
doc/plugins.rst
View file @
dc07180e
...
...
@@ -206,6 +206,11 @@ Plays audio CDs using libcdio. The URI has the form: "cdda://[DEVICE][/TRACK]".
- If the CD drive does not specify a byte order, MPD assumes it is the CPU's native byte order. This setting allows overriding this.
* - **speed N**
- Request CDParanoia cap the extraction speed to Nx normal CD audio rotation speed, keeping the drive quiet.
* - **mode disable|overlap|full**
- Set the paranoia mode; ``disable`` means no fixups, ``overlap``
performs overlapped reads, and ``full`` enables all options.
* - **skip yes|no**
- If set to ``no``, then never skip failed reads.
curl
----
...
...
src/input/plugins/CdioParanoiaInputPlugin.cxx
View file @
dc07180e
...
...
@@ -50,6 +50,9 @@ static constexpr Domain cdio_domain("cdio");
static
bool
default_reverse_endian
;
static
unsigned
speed
=
0
;
/* Default to full paranoia, but allow skipping sectors. */
static
int
mode_flags
=
PARANOIA_MODE_FULL
^
PARANOIA_MODE_NEVERSKIP
;
class
CdioParanoiaInputStream
final
:
public
InputStream
{
cdrom_drive_t
*
const
drv
;
CdIo_t
*
const
cdio
;
...
...
@@ -70,9 +73,7 @@ class CdioParanoiaInputStream final : public InputStream {
lsn_from
(
_lsn_from
),
buffer_lsn
(
-
1
)
{
/* Set reading mode for full paranoia, but allow
skipping sectors. */
para
.
SetMode
(
PARANOIA_MODE_FULL
^
PARANOIA_MODE_NEVERSKIP
);
para
.
SetMode
(
mode_flags
);
/* seek to beginning of the track */
para
.
Seek
(
lsn_from
);
...
...
@@ -117,6 +118,26 @@ input_cdio_init(EventLoop &, const ConfigBlock &block)
value
);
}
speed
=
block
.
GetBlockValue
(
"speed"
,
0U
);
if
(
const
auto
*
param
=
block
.
GetBlockParam
(
"mode"
))
{
param
->
With
([](
const
char
*
s
){
if
(
StringIsEqual
(
s
,
"disable"
))
mode_flags
=
PARANOIA_MODE_DISABLE
;
else
if
(
StringIsEqual
(
s
,
"overlap"
))
mode_flags
=
PARANOIA_MODE_OVERLAP
;
else
if
(
StringIsEqual
(
s
,
"full"
))
mode_flags
=
PARANOIA_MODE_FULL
;
else
throw
std
::
invalid_argument
{
"Invalid paranoia mode"
};
});
}
if
(
const
auto
*
param
=
block
.
GetBlockParam
(
"skip"
))
{
if
(
param
->
GetBoolValue
())
mode_flags
&=
~
PARANOIA_MODE_NEVERSKIP
;
else
mode_flags
|=
PARANOIA_MODE_NEVERSKIP
;
}
}
struct
CdioUri
{
...
...
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