diff --git a/remux.c b/remux.c index 0eb4c39b58f11f0bfa3ea5406f57874398163762..0c46adf5bb186a2c54ddb3946fd46f620fe83aa3 100644 --- a/remux.c +++ b/remux.c @@ -4,7 +4,7 @@ #include "util.h" #include "config.h" -static AVRational chapter_time_base = {1, 1}; +#define CHAPTER_TIME_BASE (AVRational){1, 1} void parse_dict(AVDictionary **d, char *s) { @@ -30,7 +30,7 @@ void parse_chapters(AVFormatContext *ctx, char *s, int duration) ctx->chapters[i] = malloc(sizeof(AVChapter)); memset(ctx->chapters[i], 0, sizeof(AVChapter)); ctx->chapters[i]->id = i; - ctx->chapters[i]->time_base = chapter_time_base; + ctx->chapters[i]->time_base = CHAPTER_TIME_BASE; ctx->chapters[i]->start = jint(jlookup(p, "time"), 0); av_dict_set(&ctx->chapters[i]->metadata, "title", jstr(jlookup(p, "text"), "EMPTY"), 0); if (i) @@ -67,7 +67,8 @@ int main(int argc, char *argv[]) avformat_alloc_output_context2(&mux, 0, jstr(jlookup(argv[4], "format"), 0), path); av_dict_copy(&mux->metadata, demux->metadata, 0); parse_dict(&mux->metadata, jlookup(argv[4], "metadata")); - parse_chapters(mux, jlookup(argv[4], "chapters"), av_rescale_q(demux->duration, AV_TIME_BASE_Q, chapter_time_base)); + parse_chapters(mux, jlookup(argv[4], "chapters"), + av_rescale_q(demux->duration, AV_TIME_BASE_Q, CHAPTER_TIME_BASE)); idxmap = malloc(sizeof(int)*demux->nb_streams); for (i = 0; i < demux->nb_streams; i ++) {