Re: [Musicpd-dev-team] Tags in OGG httpd stream
On Wed, Dec 05, 2012 at 16:51:54 -0500, Ben Boeckel wrote: @@ -524,31 +532,7 @@ decoder_replay_gain(struct decoder *decoder, float return_db = 0; assert(decoder != NULL); - if (replay_gain_info != NULL) { - static unsigned serial; - if (++serial == 0) - serial = 1; - - if (REPLAY_GAIN_OFF != replay_gain_mode) { - return_db = 20.0 * log10f( - replay_gain_tuple_scale( - replay_gain_info-tuples[replay_gain_get_real_mode()], - replay_gain_preamp, replay_gain_missing_preamp, - replay_gain_limit)); - } - - decoder-replay_gain_info = *replay_gain_info; - decoder-replay_gain_serial = serial; - - if (decoder-chunk != NULL) { - /* flush the current chunk because the new -replay gain values affect the following -samples */ - decoder_flush_chunk(decoder); So this line here was the issue. This flushes the chunk into the stream with just the tag and no data on it. Combined with this code right before the chunk leaves for the sources: static bool play_chunk(player_control pc, Song *song, struct music_chunk *chunk, MusicBuffer buffer, const AudioFormat format, Error error) { assert(chunk-CheckFormat(format)); if (chunk-tag != nullptr) update_song_tag(song, *chunk-tag); if (chunk-length == 0) { buffer.Return(chunk); return true; } pc.Lock(); pc.bit_rate = chunk-bit_rate; pc.Unlock(); /* send the chunk to the audio outputs */ if (!audio_output_all_play(chunk, error)) return false; pc.total_play_time += (double)chunk-length / format.GetTimeToSize(); return true; } the tag chunk is dropped because chunk-length is 0 for it. A patch which fixes the issue is attached. - g_cond_signal(decoder-dc-client_cond); - } - } else - decoder-replay_gain_serial = 0; + replay_gain_state_set_info(decoder-replay_gain, replay_gain_info); --Ben From 9f7690767838052661160de5a30d28acc6ef3473 Mon Sep 17 00:00:00 2001 From: Ben Boeckel maths...@gmail.com Date: Thu, 10 Oct 2013 23:00:52 -0400 Subject: [PATCH] PlayerThread: Only drop 0 length packets without tags Fixes a regression from 752dfb3d95482c562e5d24c6ea839c4815de9a6d which caused the current chunk to be flushed as soon as new replaygain information was found. If this occurs on a tag chunk, it has no data (length 0) and is then skipped before pushing it to all of the outputs. This change allows 0-length chunks through if they contain a tag and they are now appearing in mplayer and mpv properly. --- src/PlayerThread.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx index 9ad37ea..534a24e 100644 --- a/src/PlayerThread.cxx +++ b/src/PlayerThread.cxx @@ -726,7 +726,7 @@ play_chunk(player_control pc, if (chunk-tag != nullptr) update_song_tag(song, *chunk-tag); - if (chunk-length == 0) { + if (chunk-length == 0 chunk-tag == nullptr) { buffer.Return(chunk); return true; } -- 1.8.3.1 -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] Tags in OGG httpd stream
On Thu, Oct 10, 2013 at 23:12:27 -0400, Ben Boeckel wrote: So this line here was the issue. This flushes the chunk into the stream with just the tag and no data on it. Combined with this code right before the chunk leaves for the sources: It seems this fix isn't complete actually. It works properly if I do 'mpd next', but if the song changes as usual, the tags don't show up again. This will have to wait until next week for me to dig in further. --Ben -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] Tags in OGG httpd stream
On Fri, Oct 11, 2013 at 00:14:46 -0400, Ben Boeckel wrote: On Thu, Oct 10, 2013 at 23:12:27 -0400, Ben Boeckel wrote: So this line here was the issue. This flushes the chunk into the stream with just the tag and no data on it. Combined with this code right before the chunk leaves for the sources: It seems this fix isn't complete actually. It works properly if I do 'mpd next', but if the song changes as usual, the tags don't show up again. This will have to wait until next week for me to dig in further. Or this is just me not checking mplayer, which is fine in both cases. mpv/ffmpeg isn't seeing the new tags, which is a separate issue. Time for bed if I'm missing this stuff... --Ben -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
[Musicpd-dev-team] Crash on master on exit/stream disconnect
When disconnecting a stream or stopping (SIGINT) mpd, I'm seeing the following backtrace with master (17c6db6c33b9b14a8627b3f9b3da8580a5f932a2): #0 EventLoop::RemoveFD (this=0x0, _fd=0, m=...) at src/event/Loop.cxx:64 #1 0x0043f0d7 in SocketMonitor::Schedule (this=0x1a74c28, flags=flags@entry=0) at src/event/SocketMonitor.cxx:172 #2 0x0043f13b in Cancel (this=optimized out) at src/event/SocketMonitor.hxx:136 #3 SocketMonitor::Dispatch (this=optimized out, flags=optimized out) at src/event/SocketMonitor.cxx:43 #4 0x0044066b in EventLoop::Run (this=0x14f3c60) at src/event/Loop.cxx:176 #5 0x0041b436 in mpd_main (argc=optimized out, argv=optimized out) at src/Main.cxx:503 #6 0x7fd8cc0d0f75 in __libc_start_main (main=0x409a80 main(int, char**), argc=4, argv=0x7fff4df90918, init=optimized out, fini=optimized out, rtld_fini=optimized out, stack_end=0x7fff4df90908) at libc-start.c:285 #7 0x00409c49 in _start () I can bisect if needed, but it's pretty easy to reproduce here with just connect/disconnecting an mplayer or mpv instance a couple of times. --Ben -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team