Browse code

avformat/nut: add minor_version field with version>=4

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2013/12/23 11:25:25
Showing 3 changed files
... ...
@@ -105,6 +105,7 @@ typedef struct NUTContext {
105 105
     int64_t max_pts;
106 106
     AVRational *max_pts_tb;
107 107
     int version;
108
+    int minor_version;
108 109
 } NUTContext;
109 110
 
110 111
 extern const AVCodecTag ff_nut_subtitle_tags[];
... ...
@@ -233,6 +233,8 @@ static int decode_main_header(NUTContext *nut)
233 233
         return AVERROR(ENOSYS);
234 234
     }
235 235
     nut->version = tmp;
236
+    if (nut->version > 3)
237
+        nut->minor_version = ffio_read_varlen(bc);
236 238
 
237 239
     GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS);
238 240
 
... ...
@@ -338,6 +338,8 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc)
338 338
     int64_t tmp_match;
339 339
 
340 340
     ff_put_v(bc, nut->version = NUT_VERSION);
341
+    if (nut->version > 3)
342
+        ff_put_v(bc, nut->minor_version);
341 343
     ff_put_v(bc, nut->avf->nb_streams);
342 344
     ff_put_v(bc, nut->max_distance);
343 345
     ff_put_v(bc, nut->time_base_count);