[MPlayer-dev-eng] Patches for NUT

Oded Shimon ods15 at ods15.dyndns.org
Fri Feb 3 08:07:38 CET 2006


On Fri, Feb 03, 2006 at 08:58:51AM +0200, Oded Shimon wrote:
> eor in index, 01-eor-index.patch
> 
> accurate compare_ts, 02-compare_ts.patch
> 
> remove 2^n header restriction, 03-header-repeat.patch .
> 
> index repetition, 04-index-repeat.patch
> 
> 
> Regarding error recovery michael suggested, checksum for frame header etc.
> I dislike it, it complicates binary search when looking for startcodes.
> Rich already proposed a solution to prevent loosing the entire file - if
> you see a frame with abnormally high size immediately after a syncpoint,
> while reading the frame (which you have to anyway), linear search entire
> area for possible syncpoint. The worst that will happen is that you'll skip
> the entire damaged area in that single frame, and that's actually a good
> thing...
> 
> Anything else... can I commit these?
> 
> BTW, when making patch 04, I realized a mistake in the main loop and
> fixed that too... ('if (!eof)')
> 
> - ods15
> 
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
-------------- next part --------------
--- mpcf.txt	2006-02-03 08:22:53.000000000 +0200
+++ mpcf.1.txt	2006-02-03 08:50:02.000000000 +0200
@@ -1,5 +1,5 @@
 ========================================
-NUT Open Container Format DRAFT 20060120
+NUT Open Container Format DRAFT 20060203
 ========================================
 
 
@@ -249,8 +249,14 @@
             for(; j<n && j<syncpoints; j++){
                 if (!has_keyframe[j][i]) continue
                 A                           v
-                last_pts += A
-                keyframe_pts[j][i] = last_pts
+                if(!A){
+                    A                       v
+                    B                       v
+                    eor_pts[j][i] = last_pts + A + B
+                }else
+                    B=0
+                keyframe_pts[j][i] = last_pts + A
+                last_pts += A + B
             }
         }
     }
@@ -557,7 +563,11 @@
 
 keyframe_pts
     The pts of the first keyframe for this stream in the region between the
-    2 syncpoints, in the stream's timebase.
+    2 syncpoints, in the stream's timebase. (EOR frames are also keyframes)
+
+eor_pts
+    Coded only if EOR is set at the position of the syncpoint. The pts of
+    that EOR. EOR is unset by the first keyframe after it.
 
 index_ptr
     Length in bytes from the first byte of the index startcode to the first
-------------- next part --------------
--- mpcf.1.txt	2006-02-03 08:50:02.000000000 +0200
+++ mpcf.2.txt	2006-02-03 08:50:47.000000000 +0200
@@ -413,6 +413,14 @@
     Note: this calculation MUST be done with unsigned 64 bit integers, and
     is equivalent to (ln*sn)/(d1*d2) but this would require a 96bit integer
 
+compare_ts
+    Compares timestamps from 2 different timebases, the following
+    calculation is defined:
+
+    if (convert_ts(a, a_timebase, b_timebase) < b) return -1
+    if (convert_ts(b, b_timebase, a_timebase) < a) return  1
+    return 0
+
 msb_pts_shift
     amount of bits in lsb_pts
     MUST be <16
-------------- next part --------------
--- mpcf.2.txt	2006-02-03 08:50:47.000000000 +0200
+++ mpcf.3.txt	2006-02-03 08:50:53.000000000 +0200
@@ -667,7 +667,7 @@
 
 headers may be repeated, but if they are, then they MUST all be repeated
 together and repeated headers MUST be identical
-headers MAY only repeat at the closest possible positions after 2^x where x is
+headers SHOULD repeat at the closest possible positions after 2^x where x is
 an integer and the file end, so the headers may be repeated at 4102 if that is
 the closest position after 2^12=4096 at which the headers can be placed
 
-------------- next part --------------
--- mpcf.3.txt	2006-02-03 08:50:53.000000000 +0200
+++ mpcf.4.txt	2006-02-03 08:51:33.000000000 +0200
@@ -299,7 +299,7 @@
 
 file:
     file_id_string
-    while(!eof && next_code != index_startcode){
+    while(!eof){
         main_header
         for(i=0; i<stream_count; i++){
             if(next_packet==video_stream_header)
@@ -312,14 +312,16 @@
         while(next_code == info_startcode){
             info_packet
         }
-        while(next_code != main_startcode){
+        if(next_code == index_startcode){
+            index
+        }
+        if (!eof) while(next_code != main_startcode){
             if(next_code == syncpoint_startcode)
                 syncpoint
             frame
         }
     }
-    if (next_code == index_startcode){
-        index
+    if (has_index){
         index_ptr                       u(64)
     }
 
@@ -580,7 +582,8 @@
 index_ptr
     Length in bytes from the first byte of the index startcode to the first
     byte of the index_ptr. If there is no index, index_ptr MUST NOT be
-    written.
+    written. If there are several indexes, index_ptr MUST point to the last
+    index.
 
 id
     the ID of the type/name pair, so it is more compact
@@ -682,8 +685,9 @@
 ------
 
 Note: with realtime streaming, there is no end, so no index there either
-An index SHOULD be written for every stream. Indices MUST be placed at end
-of file. Indices MAY be repeated for a stream.
+Index MAY only be repeated after main headers.
+If an index is written anywhere in the file, it MUST be written at end of
+file as well.
 
 
 Info frames:


More information about the MPlayer-dev-eng mailing list