[MPlayer-G2-dev] CVS: g2/demux demux_ogg.c,1.1.1.1,1.2

Alex Beregszaszi syncmail at mplayerhq.hu
Sat Jan 31 23:27:14 CET 2004


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/g2/demux
In directory mail:/var2/tmp/cvs-serv28713

Modified Files:
	demux_ogg.c 
Log Message:
flac support

Index: demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/g2/demux/demux_ogg.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- demux_ogg.c	31 Jan 2004 20:16:18 -0000	1.1.1.1
+++ demux_ogg.c	31 Jan 2004 22:27:11 -0000	1.2
@@ -66,6 +66,7 @@
 #define OGGS_FORMAT_THEORA 2
 #define OGGS_FORMAT_DSHOW_OLD 3
 #define OGGS_FORMAT_DSHOW_NEW 4
+#define OGGS_FORMAT_FLAC 5
 
 // return value:  1 = packet should be queued  0 = packet should be dropped
 static int ogg_parse_header(demux_stream_t* ds, unsigned char* buffer, int len){
@@ -90,6 +91,14 @@
 	ds->format=mmioFOURCC('T','h','r','a');
 	return 0;
     }
+    /* first ogg packet contains ONLY the fLaC signature */
+    if(len>=4 && !strncmp(&buffer[0],"fLaC", 4)){
+	mp_msg(MSGT_DEMUX,MSGL_INFO,"demux_ogg: stream #%d: FLAC audio\n",ds->id);
+	ds->type=DEMUX_STREAM_TYPE_AUDIO; ds->priv->format=OGGS_FORMAT_FLAC;
+//	ds->format=0x43614c66;
+	ds->format=mmioFOURCC('f','L','a','C');
+	return 1;
+    }
     if(len>=142 && !strncmp(&buffer[1],"Direct Show Samples embedded in Ogg",35)){
 	ds->priv->format=OGGS_FORMAT_DSHOW_OLD;
 	switch(*((uint32_t*)(buffer+96))){
@@ -337,7 +346,7 @@
     NULL, // url
     "ogg",
     "Xiph.org OGG Stream (OggS) format",
-    "A'rpi",
+    "A'rpi, Alex",
     ext_list,
     driver_open
 };




More information about the MPlayer-G2-dev mailing list