changeset 478:ac85aafd0971 libavformat

file id string max short startcode distance
author michael
date Mon, 14 Jun 2004 21:30:36 +0000
parents 3fc285cdb791
children d84d9d8bb0a4
files nut.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nut.c	Fri Jun 11 22:03:16 2004 +0000
+++ b/nut.c	Mon Jun 14 21:30:36 2004 +0000
@@ -49,6 +49,8 @@
 #define    INDEX_STARTCODE (0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48)) 
 #define     INFO_STARTCODE (0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48)) 
 
+#define ID_STRING "nut/multimedia container\0"
+
 #define MAX_DISTANCE (1024*16-1)
 #define MAX_SHORT_DISTANCE (1024*4-1)
 
@@ -84,6 +86,7 @@
     uint64_t next_startcode;     ///< stores the next startcode if it has alraedy been parsed but the stream isnt seekable
     StreamContext *stream;
     int max_distance;
+    int max_short_distance;
     int rate_num;
     int rate_den;
     int short_startcode;
@@ -510,6 +513,11 @@
     
     nut->stream =	
 	av_mallocz(sizeof(StreamContext)*s->nb_streams);
+        
+
+    put_buffer(bc, ID_STRING, strlen(ID_STRING));
+    put_byte(bc, 0);
+    nut->packet_start[2]= url_ftell(bc);
     
     /* main header */
     put_be64(bc, MAIN_STARTCODE);
@@ -517,6 +525,7 @@
     put_v(bc, 2); /* version */
     put_v(bc, s->nb_streams);
     put_v(bc, MAX_DISTANCE);
+    put_v(bc, MAX_SHORT_DISTANCE);
     
     put_v(bc, nut->rate_num=1);
     put_v(bc, nut->rate_den=2);
@@ -869,6 +878,7 @@
     
     nut->stream_count = get_v(bc);
     nut->max_distance = get_v(bc);
+    nut->max_short_distance = get_v(bc);
     nut->rate_num= get_v(bc);
     nut->rate_den= get_v(bc);
     nut->short_startcode= get_v(bc);