nut: use a define for the nut version
authorLuca Barbato <lu_zero@gentoo.org>
Sat, 4 May 2013 10:47:15 +0000 (12:47 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Mon, 6 May 2013 07:14:43 +0000 (09:14 +0200)
Ease switching version in the future and make evident why that value.

libavformat/nut.h
libavformat/nutdec.c
libavformat/nutenc.c

index 89b0248..8e5767d 100644 (file)
@@ -39,6 +39,8 @@
 
 #define MAX_DISTANCE (1024*32-1)
 
+#define NUT_VERSION 3
+
 typedef enum{
     FLAG_KEY        =   1, ///<if set, frame is keyframe
     FLAG_EOR        =   2, ///<if set, stream has no relevance on presentation. (EOR)
index cee411b..00c9ae3 100644 (file)
@@ -213,7 +213,7 @@ static int decode_main_header(NUTContext *nut)
     end  = get_packetheader(nut, bc, 1, MAIN_STARTCODE);
     end += avio_tell(bc);
 
-    GET_V(tmp, tmp >= 2 && tmp <= 3);
+    GET_V(tmp, tmp >= 2 && tmp <= NUT_VERSION);
     GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS);
 
     nut->max_distance = ffio_read_varlen(bc);
index df70f94..7234cd9 100644 (file)
@@ -323,7 +323,7 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc)
         tmp_head_idx;
     int64_t tmp_match;
 
-    ff_put_v(bc, 3); /* version */
+    ff_put_v(bc, 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);