[Mplayer-cvslog] CVS: main/libmpdemux demux_mkv.cpp,1.46,1.47

Moritz Bunkus CVS mosu at mplayerhq.hu
Sun Nov 16 13:11:18 CET 2003


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

Modified Files:
	demux_mkv.cpp 
Log Message:
Support for FLAC in Matroska.

Index: demux_mkv.cpp
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- demux_mkv.cpp	5 Nov 2003 15:04:50 -0000	1.46
+++ demux_mkv.cpp	16 Nov 2003 12:10:34 -0000	1.47
@@ -774,7 +774,7 @@
                (zstream.avail_in != 0) && (result != Z_STREAM_END));
 
       mp_msg(MSGT_DEMUX, MSGL_DBG2, "[mkv] zlib decompression: from %d to "
-            "%d \n", new_size, zstream.total_out);
+            "%d \n", (int)new_size, (int)zstream.total_out);
       new_size = zstream.total_out;
       inflateEnd(&zstream);
 
@@ -1030,6 +1030,16 @@
               t->header_sizes[0] - t->header_sizes[1];
 
             t->a_formattag = 0xFFFE;
+          } else if (!strcmp(t->codec_id, MKV_A_QDMC) ||
+                     !strcmp(t->codec_id, MKV_A_QDMC2)) {
+            ;
+          } else if (!strcmp(t->codec_id, MKV_A_FLAC)) {
+            if ((t->private_data == NULL) || (t->private_size == 0)) {
+              mp_msg(MSGT_DEMUX, MSGL_WARN, "[mkv] FLAC track does not "
+                     "contain valid headers.\n");
+              continue;
+            }
+            t->a_formattag = mmioFOURCC('f', 'L', 'a', 'C');
           } else if (t->private_size >= sizeof(real_audio_v4_props_t)) {
             if (!strcmp(t->codec_id, MKV_A_REAL28))
               t->a_formattag = mmioFOURCC('2', '8', '_', '8');
@@ -1041,9 +1051,6 @@
               t->a_formattag = mmioFOURCC('d', 'n', 'e', 't');
             else if (!strcmp(t->codec_id, MKV_A_REALSIPR))
               t->a_formattag = mmioFOURCC('s', 'i', 'p', 'r');
-          } else if (!strcmp(t->codec_id, MKV_A_QDMC) ||
-                     !strcmp(t->codec_id, MKV_A_QDMC2)) {
-            ;
           } else {
             mp_msg(MSGT_DEMUX, MSGL_WARN, "[mkv] Unknown/unsupported audio "
                    "codec ID '%s' for track %u or missing/faulty private "
@@ -2347,6 +2354,21 @@
       memcpy(((char *)(sh_a->wf + 1)) + 10, src, codecdata_length);
 
       track->realmedia = true;
+
+    } else if (!strcmp(track->codec_id, MKV_A_FLAC)) {
+      free(sh_a->wf);
+      sh_a->wf = NULL;
+
+      dp = new_demux_packet(4);
+      memcpy(dp->buffer, "fLaC", 4);
+      dp->pts = 0;
+      dp->flags = 0;
+      ds_add_packet(demuxer->audio, dp);
+      dp = new_demux_packet(track->private_size);
+      memcpy(dp->buffer, track->private_data, track->private_size);
+      dp->pts = 0;
+      dp->flags = 0;
+      ds_add_packet(demuxer->audio, dp);
     }
 
   } else {



More information about the MPlayer-cvslog mailing list