OSDN Git Service

avformat/nut: add minor_version field with version>=4
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 23 Dec 2013 02:25:25 +0000 (03:25 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Dec 2013 01:03:19 +0000 (02:03 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/nut.h
libavformat/nutdec.c
libavformat/nutenc.c

index 88b24e5..18b688a 100644 (file)
@@ -105,6 +105,7 @@ typedef struct NUTContext {
     int64_t max_pts;
     AVRational *max_pts_tb;
     int version;
+    int minor_version;
 } NUTContext;
 
 extern const AVCodecTag ff_nut_subtitle_tags[];
index 26c6f0d..4ee5f4d 100644 (file)
@@ -233,6 +233,8 @@ static int decode_main_header(NUTContext *nut)
         return AVERROR(ENOSYS);
     }
     nut->version = tmp;
+    if (nut->version > 3)
+        nut->minor_version = ffio_read_varlen(bc);
 
     GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS);
 
index bee1fbe..107e57b 100644 (file)
@@ -338,6 +338,8 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc)
     int64_t tmp_match;
 
     ff_put_v(bc, nut->version = NUT_VERSION);
+    if (nut->version > 3)
+        ff_put_v(bc, nut->minor_version);
     ff_put_v(bc, nut->avf->nb_streams);
     ff_put_v(bc, nut->max_distance);
     ff_put_v(bc, nut->time_base_count);