Hi, A lot of people are expecting https://roundup.libav.org/issue2337 while playing webradios, and I'm one of them. But the issue seems not trivial to fix.
To sum up a bit, Icecast and (recent?) MPD make lavf create a new stream when
there is a song switch: indeed, a new "serial" is sent for the new song. So a
new stream is created, and the old one does not get any more data, and the
player (mplayer1, ffplay, …) get no sound. mplayer2 has a hack to force the
switch to the new stream when the input looks like a webradio, but this also
means that's it's likely to fail when MAX_STREAMS is reached.
A quick and dirty hack would be:
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 76ef19a..ab04411 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -241,9 +241,13 @@ ogg_read_page (AVFormatContext * s, int *str)
idx = ogg_find_stream (ogg, serial);
if (idx < 0){
+ if (url_is_streamed(s->pb) && ogg->nstreams == 1) {
+ idx = 0;
+ } else {
idx = ogg_new_stream (s, serial);
if (idx < 0)
return -1;
+ }
}
os = ogg->streams + idx;
But this does not allow multiple audio when streamed (it will work in case of
files).
So how can this could be done nicely? Is there any way to make a clear
distinction between successive streams, and a multiple audio stream?
Luca proposed on IRC to make some kind of timeout on the "dead" stream, but
while it will solve the MAX_STREAMS issue, it won't solve the stream switch
issue: it does not make any sense for the players to switch to the new track.
Any idea?
Regards,
--
Clément B.
pgpfrNgWL4U9n.pgp
Description: PGP signature
_______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
