Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opus icecast stream metadata is appended to instead of replaced #12559

Closed
claudeha opened this issue Oct 4, 2023 · 0 comments · Fixed by #12560
Closed

opus icecast stream metadata is appended to instead of replaced #12559

claudeha opened this issue Oct 4, 2023 · 0 comments · Fixed by #12560

Comments

@claudeha
Copy link
Contributor

claudeha commented Oct 4, 2023

Important Information

  • mpv version

first noticed with 0.35.1-4 (Debian Bookworm)
still occurs with 0.36.0-1 (Debian unstable, rebuilt for Debian Bookworm)

$ mpv -version
mpv 0.36.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
libplacebo version: v4.208.0
FFmpeg version: 5.1.3-1
FFmpeg library versions:
   libavutil       57.28.100
   libavcodec      59.37.100
   libavformat     59.27.100
   libswscale      6.7.100
   libavfilter     8.44.100
   libswresample   4.7.100
  • Platform and Version

Debian 12.1 Bookworm x86_64

  • Source of the mpv binary
apt source mpv/unstable
cd mpv*/
debuild -i -us -uc -b
sudo dpkg -i ../*.deb

Reproduction steps

mpv http://echo.lurk.org:999/radio-looptober.opus
mpv radio-looptober.opus  # sample linked below

Expected behavior

Icecast stream titles are displayed for each individual track in succession.

Actual behavior

Stream titles are displayed, but concatenated with the stream titles for each previously played track since mpv started playing the stream.

$ mpv radio-looptober.opus --log-file=mpv.txt
[ffmpeg/demuxer] ogg: failed to create or replace stream
 (+) Audio --aid=1 'https://ausglam.space/@hugh/111163456844080760' (opus 2ch 48000Hz)
File tags:
 Artist: hugh
 Title: https://ausglam.space/@hugh/111163456844080760
AO: [pipewire] 48000Hz stereo 2ch floatp
A: 00:00:46 / 00:00:48 (97%)
[lavf] Linearizing discontinuity: -0.006500 -> 86.153500
A: 00:00:48 / 00:00:49 (98%)
File tags:
 Artist: hugh;fkfd
 Title: https://ausglam.space/@hugh/111163456844080760;https://eattherich.club/@fkfd/111157655143610187
A: 00:01:23 / 00:01:24 (99%)
[lavf] Linearizing discontinuity: 86.153500 -> 122.493500
A: 00:01:24 / 00:01:25 (99%)
File tags:
 Artist: hugh;fkfd;hecks
 Title: https://ausglam.space/@hugh/111163456844080760;https://eattherich.club/@fkfd/111157655143610187;https://slime.computer/@hecks/111163081105200244
A: 00:02:01 / 00:02:01 (100%)

Exiting... (End of file)

Log file

mpv.txt

Sample files

radio-looptober.opus

this file was generate by downloading from an icecast server (whose live playback with mpv first exhibited the bug):

timeout 120 wget http://echo.lurk.org:999/radio-looptober.opus

Possible fix

In demux/demux_lavf.c, after each call to mp_tags_copy_from_av_dictionary(..., metadata) add a call to av_dict_free(&metadata) (5 occurrences total). This ensures the metadata is moved instead of copied, as ffmpeg appends to any existing metadata the next time metadata appears in the opus stream.

sfan5 pushed a commit that referenced this issue Oct 18, 2023
Use mp_tags_move_from_av_dictionary() in place of
mp_tags_copy_from_av_dictionary().

This ensures that when lavf appends metadata
that occurs later in the stream,
it starts from empty each time.

Fixes: <#12559>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant