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
8a136b79
Commit
8a136b79
authored
6 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/opus: pass StringView to ScanOneOpusTag()
parent
dffa25c5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
OpusTags.cxx
src/decoder/plugins/OpusTags.cxx
+10
-11
No files found.
src/decoder/plugins/OpusTags.cxx
View file @
8a136b79
...
...
@@ -23,11 +23,12 @@
#include "tag/Handler.hxx"
#include "tag/ParseName.hxx"
#include "ReplayGainInfo.hxx"
#include "util/NumberParser.hxx"
#include "util/StringView.hxx"
#include <string>
#include <stdint.h>
#include <stdlib.h>
gcc_pure
static
TagType
...
...
@@ -41,7 +42,7 @@ ParseOpusTagName(StringView name) noexcept
}
static
void
ScanOneOpusTag
(
StringView
name
,
const
char
*
value
,
ScanOneOpusTag
(
StringView
name
,
StringView
value
,
ReplayGainInfo
*
rgi
,
TagHandler
&
handler
)
noexcept
{
...
...
@@ -49,17 +50,17 @@ ScanOneOpusTag(StringView name, const char *value,
/* R128_TRACK_GAIN is a Q7.8 fixed point number in
dB */
char
*
endptr
;
long
l
=
strtol
(
value
,
&
endptr
,
10
);
if
(
endptr
>
value
&&
*
endptr
==
0
)
c
onst
c
har
*
endptr
;
const
auto
l
=
ParseInt64
(
value
,
&
endptr
,
10
);
if
(
endptr
>
value
.
begin
()
&&
endptr
==
value
.
end
()
)
rgi
->
track
.
gain
=
double
(
l
)
/
256.
;
}
else
if
(
rgi
!=
nullptr
&&
name
.
Equals
(
"R128_ALBUM_GAIN"
))
{
/* R128_ALBUM_GAIN is a Q7.8 fixed point number in
dB */
char
*
endptr
;
long
l
=
strtol
(
value
,
&
endptr
,
10
);
if
(
endptr
>
value
&&
*
endptr
==
0
)
c
onst
c
har
*
endptr
;
const
auto
l
=
ParseInt64
(
value
,
&
endptr
,
10
);
if
(
endptr
>
value
.
begin
()
&&
endptr
==
value
.
end
()
)
rgi
->
album
.
gain
=
double
(
l
)
/
256.
;
}
...
...
@@ -103,9 +104,7 @@ ScanOpusTags(const void *data, size_t size,
if
(
split
.
first
.
empty
()
||
split
.
second
.
IsNull
())
continue
;
const
std
::
string
value2
(
split
.
second
.
data
,
split
.
second
.
size
);
ScanOneOpusTag
(
split
.
first
,
value2
.
c_str
(),
rgi
,
handler
);
ScanOneOpusTag
(
split
.
first
,
split
.
second
,
rgi
,
handler
);
}
return
true
;
...
...
This diff is collapsed.
Click to expand it.
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