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
a4b23634
Commit
a4b23634
authored
Feb 07, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.22.x'
parents
aa40aae5
e7da5b10
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
7 deletions
+23
-7
NEWS
NEWS
+4
-0
Iso9660ArchivePlugin.cxx
src/archive/plugins/Iso9660ArchivePlugin.cxx
+3
-3
Id3Scan.cxx
src/tag/Id3Scan.cxx
+1
-1
run_input.cxx
test/run_input.cxx
+15
-3
No files found.
NEWS
View file @
a4b23634
...
@@ -3,6 +3,10 @@ ver 0.23 (not yet released)
...
@@ -3,6 +3,10 @@ ver 0.23 (not yet released)
- new command "getvol"
- new command "getvol"
ver 0.22.5 (not yet released)
ver 0.22.5 (not yet released)
* tags
- id: translate TPE3 to Conductor, not Performer
* archive
- iso9660: another fix for unaligned reads
* output
* output
- httpd: error handling on Windows improved
- httpd: error handling on Windows improved
...
...
src/archive/plugins/Iso9660ArchivePlugin.cxx
View file @
a4b23634
...
@@ -221,8 +221,8 @@ public:
...
@@ -221,8 +221,8 @@ public:
if
(
new_offset
>
size
)
if
(
new_offset
>
size
)
throw
std
::
runtime_error
(
"Invalid seek offset"
);
throw
std
::
runtime_error
(
"Invalid seek offset"
);
offset
=
new_offset
;
skip
=
new_offset
%
ISO_BLOCKSIZE
;
skip
=
new_offset
%
ISO_BLOCKSIZE
;
offset
=
new_offset
-
skip
;
buffer
.
Clear
();
buffer
.
Clear
();
}
}
};
};
...
@@ -260,13 +260,13 @@ Iso9660InputStream::Read(std::unique_lock<Mutex> &,
...
@@ -260,13 +260,13 @@ Iso9660InputStream::Read(std::unique_lock<Mutex> &,
if
(
r
.
empty
())
{
if
(
r
.
empty
())
{
/* the buffer is empty - read more data from the ISO file */
/* the buffer is empty - read more data from the ISO file */
assert
(
offset
%
ISO_BLOCKSIZE
==
0
);
assert
(
(
offset
-
skip
)
%
ISO_BLOCKSIZE
==
0
);
const
ScopeUnlock
unlock
(
mutex
);
const
ScopeUnlock
unlock
(
mutex
);
const
lsn_t
read_lsn
=
lsn
+
offset
/
ISO_BLOCKSIZE
;
const
lsn_t
read_lsn
=
lsn
+
offset
/
ISO_BLOCKSIZE
;
if
(
read_size
>=
ISO_BLOCKSIZE
)
{
if
(
read_size
>=
ISO_BLOCKSIZE
&&
skip
==
0
)
{
/* big read - read right into the caller's buffer */
/* big read - read right into the caller's buffer */
auto
nbytes
=
iso
->
SeekRead
(
ptr
,
read_lsn
,
auto
nbytes
=
iso
->
SeekRead
(
ptr
,
read_lsn
,
...
...
src/tag/Id3Scan.cxx
View file @
a4b23634
...
@@ -352,7 +352,7 @@ scan_id3_tag(const struct id3_tag *tag, TagHandler &handler) noexcept
...
@@ -352,7 +352,7 @@ scan_id3_tag(const struct id3_tag *tag, TagHandler &handler) noexcept
handler
);
handler
);
tag_id3_import_text
(
tag
,
ID3_FRAME_COMPOSER
,
TAG_COMPOSER
,
tag_id3_import_text
(
tag
,
ID3_FRAME_COMPOSER
,
TAG_COMPOSER
,
handler
);
handler
);
tag_id3_import_text
(
tag
,
"TPE3"
,
TAG_
PERFORME
R
,
tag_id3_import_text
(
tag
,
"TPE3"
,
TAG_
CONDUCTO
R
,
handler
);
handler
);
tag_id3_import_text
(
tag
,
"TPE4"
,
TAG_PERFORMER
,
handler
);
tag_id3_import_text
(
tag
,
"TPE4"
,
TAG_PERFORMER
,
handler
);
tag_id3_import_text
(
tag
,
"TIT1"
,
TAG_GROUPING
,
handler
);
tag_id3_import_text
(
tag
,
"TIT1"
,
TAG_GROUPING
,
handler
);
...
...
test/run_input.cxx
View file @
a4b23634
...
@@ -56,6 +56,8 @@ struct CommandLine {
...
@@ -56,6 +56,8 @@ struct CommandLine {
FromNarrowPath
config_path
;
FromNarrowPath
config_path
;
std
::
size_t
seek
=
0
;
std
::
size_t
chunk_size
=
MAX_CHUNK_SIZE
;
std
::
size_t
chunk_size
=
MAX_CHUNK_SIZE
;
bool
verbose
=
false
;
bool
verbose
=
false
;
...
@@ -67,6 +69,7 @@ enum Option {
...
@@ -67,6 +69,7 @@ enum Option {
OPTION_CONFIG
,
OPTION_CONFIG
,
OPTION_VERBOSE
,
OPTION_VERBOSE
,
OPTION_SCAN
,
OPTION_SCAN
,
OPTION_SEEK
,
OPTION_CHUNK_SIZE
,
OPTION_CHUNK_SIZE
,
};
};
...
@@ -74,6 +77,7 @@ static constexpr OptionDef option_defs[] = {
...
@@ -74,6 +77,7 @@ static constexpr OptionDef option_defs[] = {
{
"config"
,
0
,
true
,
"Load a MPD configuration file"
},
{
"config"
,
0
,
true
,
"Load a MPD configuration file"
},
{
"verbose"
,
'v'
,
false
,
"Verbose logging"
},
{
"verbose"
,
'v'
,
false
,
"Verbose logging"
},
{
"scan"
,
0
,
false
,
"Scan tags instead of reading raw data"
},
{
"scan"
,
0
,
false
,
"Scan tags instead of reading raw data"
},
{
"seek"
,
0
,
true
,
"Start reading at this position"
},
{
"chunk-size"
,
0
,
true
,
"Read this number of bytes at a time"
},
{
"chunk-size"
,
0
,
true
,
"Read this number of bytes at a time"
},
};
};
...
@@ -108,6 +112,10 @@ ParseCommandLine(int argc, char **argv)
...
@@ -108,6 +112,10 @@ ParseCommandLine(int argc, char **argv)
c
.
scan
=
true
;
c
.
scan
=
true
;
break
;
break
;
case
OPTION_SEEK
:
c
.
seek
=
ParseSize
(
o
.
value
);
break
;
case
OPTION_CHUNK_SIZE
:
case
OPTION_CHUNK_SIZE
:
c
.
chunk_size
=
ParseSize
(
o
.
value
);
c
.
chunk_size
=
ParseSize
(
o
.
value
);
if
(
c
.
chunk_size
<=
0
||
c
.
chunk_size
>
MAX_CHUNK_SIZE
)
if
(
c
.
chunk_size
<=
0
||
c
.
chunk_size
>
MAX_CHUNK_SIZE
)
...
@@ -118,7 +126,7 @@ ParseCommandLine(int argc, char **argv)
...
@@ -118,7 +126,7 @@ ParseCommandLine(int argc, char **argv)
auto
args
=
option_parser
.
GetRemaining
();
auto
args
=
option_parser
.
GetRemaining
();
if
(
args
.
size
!=
1
)
if
(
args
.
size
!=
1
)
throw
std
::
runtime_error
(
"Usage: run_input [--verbose] [--config=FILE] URI"
);
throw
std
::
runtime_error
(
"Usage: run_input [--verbose] [--config=FILE]
[--scan] [--chunk-size=BYTES]
URI"
);
c
.
uri
=
args
.
front
();
c
.
uri
=
args
.
front
();
return
c
;
return
c
;
...
@@ -153,10 +161,14 @@ tag_save(FILE *file, const Tag &tag)
...
@@ -153,10 +161,14 @@ tag_save(FILE *file, const Tag &tag)
}
}
static
int
static
int
dump_input_stream
(
InputStream
&
is
,
FileDescriptor
out
,
size_t
chunk_size
)
dump_input_stream
(
InputStream
&
is
,
FileDescriptor
out
,
offset_type
seek
,
size_t
chunk_size
)
{
{
std
::
unique_lock
<
Mutex
>
lock
(
is
.
mutex
);
std
::
unique_lock
<
Mutex
>
lock
(
is
.
mutex
);
if
(
seek
>
0
)
is
.
Seek
(
lock
,
seek
);
/* print meta data */
/* print meta data */
if
(
is
.
HasMimeType
())
if
(
is
.
HasMimeType
())
...
@@ -256,7 +268,7 @@ try {
...
@@ -256,7 +268,7 @@ try {
Mutex
mutex
;
Mutex
mutex
;
auto
is
=
InputStream
::
OpenReady
(
c
.
uri
,
mutex
);
auto
is
=
InputStream
::
OpenReady
(
c
.
uri
,
mutex
);
return
dump_input_stream
(
*
is
,
FileDescriptor
(
STDOUT_FILENO
),
return
dump_input_stream
(
*
is
,
FileDescriptor
(
STDOUT_FILENO
),
c
.
chunk_size
);
c
.
seek
,
c
.
chunk_size
);
}
catch
(...)
{
}
catch
(...)
{
PrintException
(
std
::
current_exception
());
PrintException
(
std
::
current_exception
());
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
...
...
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