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
a0d43dd8
Commit
a0d43dd8
authored
Oct 16, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/opus: submit output_gain even if there is no OpusTags packet
parent
1db533c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
NEWS
NEWS
+2
-0
OpusDecoderPlugin.cxx
src/decoder/plugins/OpusDecoderPlugin.cxx
+21
-0
No files found.
NEWS
View file @
a0d43dd8
ver 0.22.1 (not yet released)
* decoder
- opus: apply the OpusHead output gain even if there is no EBU R128 tag
* output
- alsa: don't deadlock when the ALSA driver is buggy
- jack, pulse: reduce the delay when stopping or pausing playback
...
...
src/decoder/plugins/OpusDecoderPlugin.cxx
View file @
a0d43dd8
...
...
@@ -123,6 +123,14 @@ class MPDOpusDecoder final : public OggDecoder {
*/
ogg_int64_t
granulepos
;
/**
* Was DecoderClient::SubmitReplayGain() called? We need to
* keep track of this, because it will usually be called by
* HandleTags(), but if there is no OpusTags packet, we need
* to submit our #output_gain value from the OpusHead.
*/
bool
submitted_replay_gain
=
false
;
public
:
explicit
MPDOpusDecoder
(
DecoderReader
&
reader
)
:
OggDecoder
(
reader
)
{}
...
...
@@ -269,6 +277,7 @@ MPDOpusDecoder::HandleTags(const ogg_packet &packet)
return
;
client
.
SubmitReplayGain
(
&
rgi
);
submitted_replay_gain
=
true
;
if
(
!
tag_builder
.
empty
())
{
Tag
tag
=
tag_builder
.
Commit
();
...
...
@@ -283,6 +292,18 @@ MPDOpusDecoder::HandleAudio(const ogg_packet &packet)
{
assert
(
opus_decoder
!=
nullptr
);
if
(
!
submitted_replay_gain
)
{
/* if we didn't see an OpusTags packet with EBU R128
values, we still need to apply the output gain
value from the OpusHead packet; submit it as "track
gain" value */
ReplayGainInfo
rgi
;
rgi
.
Clear
();
rgi
.
track
.
gain
=
EbuR128ToReplayGain
(
output_gain
);
client
.
SubmitReplayGain
(
&
rgi
);
submitted_replay_gain
=
true
;
}
int
nframes
=
opus_decode
(
opus_decoder
,
(
const
unsigned
char
*
)
packet
.
packet
,
packet
.
bytes
,
...
...
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