[Mplayer-cvslog] CVS: main/libmpdemux demux_ogg.c,1.27,1.28

Alban Bedel CVS albeu at mplayerhq.hu
Wed Jul 2 22:43:30 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv8763/libmpdemux

Modified Files:
	demux_ogg.c 
Log Message:
A little hack to be able to play ogg radio stream


Index: demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- demux_ogg.c	11 May 2003 16:39:16 -0000	1.27
+++ demux_ogg.c	2 Jul 2003 20:43:07 -0000	1.28
@@ -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;



More information about the MPlayer-cvslog mailing list