avformat/nut: store version in the context

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-12-23 03:25:24 +01:00
parent 3cfa310c5d
commit 6aa50374bf
3 changed files with 3 additions and 1 deletions

View File

@ -104,6 +104,7 @@ typedef struct NUTContext {
int sp_count; int sp_count;
int64_t max_pts; int64_t max_pts;
AVRational *max_pts_tb; AVRational *max_pts_tb;
int version;
} NUTContext; } NUTContext;
extern const AVCodecTag ff_nut_subtitle_tags[]; extern const AVCodecTag ff_nut_subtitle_tags[];

View File

@ -232,6 +232,7 @@ static int decode_main_header(NUTContext *nut)
tmp); tmp);
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
} }
nut->version = tmp;
GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS); GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS);

View File

@ -337,7 +337,7 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc)
tmp_head_idx; tmp_head_idx;
int64_t tmp_match; 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->avf->nb_streams);
ff_put_v(bc, nut->max_distance); ff_put_v(bc, nut->max_distance);
ff_put_v(bc, nut->time_base_count); ff_put_v(bc, nut->time_base_count);