# HG changeset patch # User albeu # Date 1057178587 0 # Node ID 3c7db8070985b405351051a4d4fd03586dbe0233 # Parent 8e3e884ec8a495fb6e45152d2d53d152a7a69fac A little hack to be able to play ogg radio stream diff -r 8e3e884ec8a4 -r 3c7db8070985 libmpdemux/demux_ogg.c --- a/libmpdemux/demux_ogg.c Tue Jul 01 22:05:46 2003 +0000 +++ b/libmpdemux/demux_ogg.c Wed Jul 02 20:43:07 2003 +0000 @@ -287,8 +287,18 @@ break; } - if(id == ogg_d->num_sub) - return -1; + if(id == ogg_d->num_sub) { + // If we have only one vorbis stream allow the stream id to change + // it's normal on radio stream (each song have an different id). + // But we (or the codec?) should check that the samplerate, etc + // doesn't change (for radio stream it's ok) + if(ogg_d->num_sub == 1 && ogg_d->subs[0].vorbis) { + ogg_stream_reset(&ogg_d->subs[0].stream); + ogg_stream_init(&ogg_d->subs[0].stream,s_no); + id = 0; + } else + return -1; + } if(os) *os = &ogg_d->subs[id].stream;