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
10a6c5c5
Commit
10a6c5c5
authored
Jan 20, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/CdioParanoia: make variables more local
parent
2cc2bab3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
CdioParanoiaInputPlugin.cxx
src/input/plugins/CdioParanoiaInputPlugin.cxx
+6
-11
No files found.
src/input/plugins/CdioParanoiaInputPlugin.cxx
View file @
10a6c5c5
...
@@ -285,32 +285,27 @@ size_t
...
@@ -285,32 +285,27 @@ size_t
CdioParanoiaInputStream
::
Read
(
void
*
ptr
,
size_t
length
)
CdioParanoiaInputStream
::
Read
(
void
*
ptr
,
size_t
length
)
{
{
size_t
nbytes
=
0
;
size_t
nbytes
=
0
;
int
diff
;
size_t
len
,
maxwrite
;
int16_t
*
rbuf
;
char
*
s_err
,
*
s_mess
;
char
*
wptr
=
(
char
*
)
ptr
;
char
*
wptr
=
(
char
*
)
ptr
;
while
(
length
>
0
)
{
while
(
length
>
0
)
{
/* end of track ? */
/* end of track ? */
if
(
lsn_from
+
lsn_relofs
>
lsn_to
)
if
(
lsn_from
+
lsn_relofs
>
lsn_to
)
break
;
break
;
//current sector was changed ?
//current sector was changed ?
int16_t
*
rbuf
;
if
(
lsn_relofs
!=
buffer_lsn
)
{
if
(
lsn_relofs
!=
buffer_lsn
)
{
const
ScopeUnlock
unlock
(
mutex
);
const
ScopeUnlock
unlock
(
mutex
);
rbuf
=
cdio_paranoia_read
(
para
,
nullptr
);
rbuf
=
cdio_paranoia_read
(
para
,
nullptr
);
s_err
=
cdda_errors
(
drv
);
char
*
s_err
=
cdda_errors
(
drv
);
if
(
s_err
)
{
if
(
s_err
)
{
FormatError
(
cdio_domain
,
FormatError
(
cdio_domain
,
"paranoia_read: %s"
,
s_err
);
"paranoia_read: %s"
,
s_err
);
free
(
s_err
);
free
(
s_err
);
}
}
s_mess
=
cdda_messages
(
drv
);
char
*
s_mess
=
cdda_messages
(
drv
);
if
(
s_mess
)
{
if
(
s_mess
)
{
free
(
s_mess
);
free
(
s_mess
);
}
}
...
@@ -326,12 +321,12 @@ CdioParanoiaInputStream::Read(void *ptr, size_t length)
...
@@ -326,12 +321,12 @@ CdioParanoiaInputStream::Read(void *ptr, size_t length)
}
}
//correct offset
//correct offset
diff
=
offset
-
lsn_relofs
*
CDIO_CD_FRAMESIZE_RAW
;
const
int
diff
=
offset
-
lsn_relofs
*
CDIO_CD_FRAMESIZE_RAW
;
assert
(
diff
>=
0
&&
diff
<
CDIO_CD_FRAMESIZE_RAW
);
assert
(
diff
>=
0
&&
diff
<
CDIO_CD_FRAMESIZE_RAW
);
maxwrite
=
CDIO_CD_FRAMESIZE_RAW
-
diff
;
//# of bytes pending in current buffer
const
size_t
maxwrite
=
CDIO_CD_FRAMESIZE_RAW
-
diff
;
//# of bytes pending in current buffer
len
=
(
length
<
maxwrite
?
length
:
maxwrite
);
const
size_t
len
=
(
length
<
maxwrite
?
length
:
maxwrite
);
//skip diff bytes from this lsn
//skip diff bytes from this lsn
memcpy
(
wptr
,
((
char
*
)
rbuf
)
+
diff
,
len
);
memcpy
(
wptr
,
((
char
*
)
rbuf
)
+
diff
,
len
);
...
...
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