OSDN Git Service

avformat/nut: store version in the context
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 23 Dec 2013 02:25:24 +0000 (03:25 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Dec 2013 01:03:08 +0000 (02:03 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/nut.h
libavformat/nutdec.c
libavformat/nutenc.c

index da456ac..88b24e5 100644 (file)
@@ -104,6 +104,7 @@ typedef struct NUTContext {
     int sp_count;
     int64_t max_pts;
     AVRational *max_pts_tb;
+    int version;
 } NUTContext;
 
 extern const AVCodecTag ff_nut_subtitle_tags[];
index aa7ca67..26c6f0d 100644 (file)
@@ -232,6 +232,7 @@ static int decode_main_header(NUTContext *nut)
                tmp);
         return AVERROR(ENOSYS);
     }
+    nut->version = tmp;
 
     GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS);
 
index f2172fb..bee1fbe 100644 (file)
@@ -337,7 +337,7 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc)
         tmp_head_idx;
     int64_t tmp_match;
 
-    ff_put_v(bc, NUT_VERSION);
+    ff_put_v(bc, nut->version = NUT_VERSION);
     ff_put_v(bc, nut->avf->nb_streams);
     ff_put_v(bc, nut->max_distance);
     ff_put_v(bc, nut->time_base_count);