[cvs-annodex] commit (/annodex): libannodex/trunk/src/libannodex/anx_private.h libannodex/trunk/src/libannodex/anx_write.c libannodex/trunk/src/libannodex/cmml_header.h

conrad nobody at lists.annodex.net
Fri Jan 28 11:43:59 EST 2005


Update of /annodex (new revision 755)

Modified files:
   libannodex/trunk/src/libannodex/anx_private.h
   libannodex/trunk/src/libannodex/anx_write.c
   libannodex/trunk/src/libannodex/cmml_header.h

Log Message:
always add cmml preamble


Modified: libannodex/trunk/src/libannodex/anx_private.h
===================================================================
--- libannodex/trunk/src/libannodex/anx_private.h	2005-01-27 20:58:59 UTC (rev 754)
+++ libannodex/trunk/src/libannodex/anx_private.h	2005-01-28 00:43:57 UTC (rev 755)
@@ -104,6 +104,7 @@
   int need_fisbone;
   int need_anno_fisbone;
   int need_cmml_bos;
+  int need_cmml_preamble;
   int need_head;
   int need_mapping_eos;
   int secondary_headers_remaining;

Modified: libannodex/trunk/src/libannodex/anx_write.c
===================================================================
--- libannodex/trunk/src/libannodex/anx_write.c	2005-01-27 20:58:59 UTC (rev 754)
+++ libannodex/trunk/src/libannodex/anx_write.c	2005-01-28 00:43:57 UTC (rev 755)
@@ -700,6 +700,16 @@
 }
 
 static long
+anx_init_cmml_preamble_packet (ANNODEX * annodex)
+{
+  return anx_packet_init (annodex, (unsigned char *)CMML_PREAMBLE,
+			  strlen (CMML_PREAMBLE),
+			  annodex->anno_serialno,
+			  0 /* granulepos */, 0 /* bos */, 0 /* eos */,
+			  OGGZ_FLUSH_AFTER);
+}
+
+static long
 anx_init_head_packet (ANNODEX * annodex)
 {
   AnxWriter * writer = &annodex->x.writer;
@@ -1067,6 +1077,13 @@
       if (l == NULL) {
 	writer->need_fisbone = 0;
       }
+    } else if (writer->need_cmml_preamble) {
+#ifdef DEBUG
+      printf ("anx_writer_sync: NEED CMML preamble\n");
+#endif
+      anx_init_cmml_preamble_packet (annodex);
+      writer->need_cmml_preamble = 0;
+      made_packet = 1;
     } else if (writer->need_head) {
 #ifdef DEBUG
       printf ("anx_writer_sync: NEED head\n");
@@ -1275,6 +1292,7 @@
   writer->need_fisbone = 1;
   writer->need_anno_fisbone = 1;
   writer->need_cmml_bos = 1;
+  writer->need_cmml_preamble = 1;
   writer->need_head = 1;
   writer->need_mapping_eos = 1;
   writer->secondary_headers_remaining = 0;
@@ -1302,7 +1320,7 @@
   writer->anno_track.serialno = annodex->anno_serialno;
   writer->anno_track.id = NULL;
   writer->anno_track.content_type = cmml_content_type;
-  writer->anno_track.nr_header_packets = 1;
+  writer->anno_track.nr_header_packets = 2;
   writer->anno_track.granule_rate_n = CMML_GRANULE_RATE_N;
   writer->anno_track.granule_rate_d = CMML_GRANULE_RATE_D;
   writer->anno_track.basegranule = 0;

Modified: libannodex/trunk/src/libannodex/cmml_header.h
===================================================================
--- libannodex/trunk/src/libannodex/cmml_header.h	2005-01-27 20:58:59 UTC (rev 754)
+++ libannodex/trunk/src/libannodex/cmml_header.h	2005-01-28 00:43:57 UTC (rev 755)
@@ -64,4 +64,6 @@
 #define CMML_CONTENT_TYPE "text/x-cmml"
 #define CMML_EMPTY_CLIP "<clip/>"
 
+#define CMML_PREAMBLE "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE cmml SYSTEM \"cmml.dtd\">"
+
 #endif /* __CMML_HEADER_H__ */


-- 
conrad



More information about the cvs-annodex mailing list