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
054e9eca
Commit
054e9eca
authored
Feb 21, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag/Id3Load: split tag_id3_read()
parent
84fe3bfa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
Id3Load.cxx
src/tag/Id3Load.cxx
+14
-6
No files found.
src/tag/Id3Load.cxx
View file @
054e9eca
...
...
@@ -60,13 +60,12 @@ get_id3v2_footer_size(FILE *stream, long offset, int whence)
}
static
UniqueId3Tag
tag_id3_read
(
FILE
*
stream
,
long
offset
,
int
whenc
e
)
ReadId3Tag
(
FILE
*
fil
e
)
{
/* It's ok if we get less than we asked for */
id3_byte_t
query_buffer
[
ID3_TAG_QUERYSIZE
];
size_t
query_buffer_size
=
f
ill_buffer
(
query_buffer
,
ID3_TAG_QUERYSIZE
,
stream
,
offset
,
whenc
e
);
if
(
query_buffer_size
<
=
0
)
size_t
query_buffer_size
=
f
read
(
query_buffer
,
1
,
sizeof
(
query_buffer
)
,
fil
e
);
if
(
query_buffer_size
=
=
0
)
return
nullptr
;
/* Look for a tag header */
...
...
@@ -87,7 +86,7 @@ tag_id3_read(FILE *stream, long offset, int whence)
/* now read the remaining bytes */
const
size_t
remaining
=
tag_size
-
query_buffer_size
;
const
size_t
nbytes
=
fread
(
end
,
1
,
remaining
,
stream
);
const
size_t
nbytes
=
fread
(
end
,
1
,
remaining
,
file
);
if
(
nbytes
!=
remaining
)
return
nullptr
;
...
...
@@ -95,6 +94,15 @@ tag_id3_read(FILE *stream, long offset, int whence)
}
static
UniqueId3Tag
tag_id3_read
(
FILE
*
file
,
long
offset
,
int
whence
)
{
if
(
fseek
(
file
,
offset
,
whence
)
!=
0
)
return
0
;
return
ReadId3Tag
(
file
);
}
static
UniqueId3Tag
tag_id3_find_from_beginning
(
FILE
*
stream
)
{
auto
tag
=
tag_id3_read
(
stream
,
0
,
SEEK_SET
);
...
...
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