decoder/Bridge: call UpdateStreamTag() only if there is no pending seek

If UpdateStreamTag() gets called while an initial seek is pending, the
result will never be submitted to a MusicChunk.  By avoiding the
UpdateStreamTag() call in that case (by moving UpdateStreamTag() to
after the PrepareInitialSeek() check), the song_tag is preserved until
UpdateStreamTag() is called again from SubmitData().

This fixes missing tags in the "httpd" output.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1137
This commit is contained in:
Max Kellermann 2021-08-05 17:59:51 +02:00
parent 17b0ac75ca
commit b979245d6c
2 changed files with 5 additions and 4 deletions

1
NEWS
View File

@ -9,6 +9,7 @@ ver 0.22.10 (not yet released)
* tags * tags
- fix crash caused by bug in TagBuilder and a few potential reference leaks - fix crash caused by bug in TagBuilder and a few potential reference leaks
* output * output
- httpd: fix missing tag after seeking into a new song
- oss: fix channel order of multi-channel files - oss: fix channel order of multi-channel files
ver 0.22.9 (2021/06/23) ver 0.22.9 (2021/06/23)

View File

@ -581,10 +581,6 @@ DecoderBridge::SubmitTag(InputStream *is, Tag &&tag) noexcept
decoder_tag = std::make_unique<Tag>(std::move(tag)); decoder_tag = std::make_unique<Tag>(std::move(tag));
/* check for a new stream tag */
UpdateStreamTag(is);
/* check if we're seeking */ /* check if we're seeking */
if (PrepareInitialSeek()) if (PrepareInitialSeek())
@ -593,6 +589,10 @@ DecoderBridge::SubmitTag(InputStream *is, Tag &&tag) noexcept
function here */ function here */
return DecoderCommand::SEEK; return DecoderCommand::SEEK;
/* check for a new stream tag */
UpdateStreamTag(is);
/* send tag to music pipe */ /* send tag to music pipe */
if (stream_tag != nullptr) if (stream_tag != nullptr)