[NUT-devel] Patch for info packets

Oded Shimon ods15 at ods15.dyndns.org
Tue Feb 21 12:11:30 CET 2006


This is my patch... Comments welcome, I hope this patch will please 
everyone...

- ods15
-------------- next part --------------
Index: DOCS/tech/mpcf.txt
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/tech/mpcf.txt,v
retrieving revision 1.108
diff -u -r1.108 mpcf.txt
--- DOCS/tech/mpcf.txt	20 Feb 2006 04:49:06 -0000	1.108
+++ DOCS/tech/mpcf.txt	21 Feb 2006 11:10:19 -0000
@@ -262,21 +262,33 @@
     checksum                            u(32)
 
 info_frame: (optional)
-    for(;;){
-        id                              v
-        if(id==0) break
-        name= info_table[id][0]
-        type= info_table[id][1]
-        if(type==NULL)
+    stream_id_plus1                     v
+    chapter_id                          v
+    if (chapter_id) {
+        chapter_start                   v
+        if (chapter_id < 0)
+            chapter_len                 v
+    }
+    count                               v
+    for(i=0; i<count; i++){
+        name                            vb
+        value                           s
+        if (value==-1){
+            type= "UTF-8"
+            value                       vb
+        }else if (value==-2){
             type                        vb
-        if(name==NULL)
-            name                        vb
-        if(type=="v")
-            value                       v
-        else if(type=="s")
-            value                       s
-        else
             value                       vb
+        }else if (value==-3){
+            type= "signed integer"
+            value                       s
+        }else if (value<-3){
+            type= "rational"
+            value.den= -value-2
+            value.num                   s
+        }else{
+            type= "unsigned integer"
+        }
     }
     reserved_bytes
     checksum                            u(32)
@@ -609,9 +621,25 @@
 Info tags:
 ----------
 
-id
-    the ID of the type/name pair, so it is more compact
-    0 means end
+stream_id_plus1
+    Stream this info packet applies to. If zero, packet applies to whole
+    file.
+
+chapter_id
+    Id of chapter this packet applies to. If zero, packet applies to whole
+    file. Negative chapter_id indicate a sub region of file and not a real
+    chapter. chapter_id MUST be unique to the region it represents.
+
+chapter_start
+    s= chapter_start % stream_count
+    timestamp= chapter_start / stream_count
+    timestamp of start of chapter in timebase of stream 's'.
+    Positive chapter_id's MUST be in sequential order.
+
+chapter_len
+    Length of chapter in same timebase of chapter_start. For positive
+    chapter_id's, length is implicit from start of this chapter to next
+    chapter.
 
 type
     for example: "UTF8" -> string or "JPEG" -> JPEG image
@@ -620,15 +648,13 @@
 
 info packet types
     the name of the info entry, valid names are
-    "StreamId"
-        the stream(s) to which the info packet applies
     "Author"
     "Description"
     "Copyright"
     "Encoder"
         the name & version of the software used for encoding
     "Title"
-    "Cover"
+    "Cover" (allowed types are "PNG" and "JPEG")
         image of the (CD, DVD, VHS, ..) cover (preferably PNG or JPEG)
     "Source"
         "DVD", "VCD", "CD", "MD", "FM radio", "VHS", "TV", "LD"
@@ -640,8 +666,6 @@
         (ISO 8601 format, see http://www.cl.cam.ac.uk/~mgk25/iso-time.html)
         Note: do not forget the timezone
     "Keywords"
-    "TotalTime"
-        total length of the stream in msecs
     "Language"
         ISO 639 and ISO 3166 for language/country code
         something like "eng" (US english), can be 0 if unknown
@@ -664,24 +688,6 @@
 stuffing
     0x80 can be placed in front of any type v entry for stuffing purposes
 
-info_table[][2]={
-    {NULL            ,  NULL }, // end
-    {NULL            ,  NULL },
-    {NULL            , "UTF8"},
-    {NULL            , "v"},
-    {NULL            , "s"},
-    {"StreamId"      , "v"},
-    {"Author"        , "UTF8"},
-    {"Title"         , "UTF8"},
-    {"Language"      , "UTF8"},
-    {"Description"   , "UTF8"},
-    {"Copyright"     , "UTF8"},
-    {"Encoder"       , "UTF8"},
-    {"Keyword"       , "UTF8"},
-    {"Cover"         , "JPEG"},
-    {"Cover"         , "PNG"},
-    {"Disposition"   , "UTF8"},
-};
 
 
 Structure:


More information about the NUT-devel mailing list