avformat/utils: do not overwrite already existing program with defaults in av_new_program

av_new_program returns the existing program if that already exists, in that
case it makes no sense to overwrite existing attributes.

Signed-off-by: Marton Balint <cus@passwd.hu>
pull/371/head
Marton Balint 4 years ago
parent 91e1625db1
commit 9298e8eb61
  1. 4
      libavformat/utils.c

@ -4590,14 +4590,12 @@ AVProgram *av_new_program(AVFormatContext *ac, int id)
dynarray_add(&ac->programs, &ac->nb_programs, program); dynarray_add(&ac->programs, &ac->nb_programs, program);
program->discard = AVDISCARD_NONE; program->discard = AVDISCARD_NONE;
program->pmt_version = -1; program->pmt_version = -1;
}
program->id = id; program->id = id;
program->pts_wrap_reference = AV_NOPTS_VALUE; program->pts_wrap_reference = AV_NOPTS_VALUE;
program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE; program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
program->start_time = program->start_time =
program->end_time = AV_NOPTS_VALUE; program->end_time = AV_NOPTS_VALUE;
}
return program; return program;
} }

Loading…
Cancel
Save