aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2020-12-27 20:32:54 +0100
committerMarton Balint <cus@passwd.hu>2021-01-09 22:38:12 +0100
commit9298e8eb61f6c796aaf7c6e14e59f345318d2753 (patch)
tree6f558bf2d6e5d8a0c48b24a052be24d40174610e
parent91e1625db15fe8853ceedca9eed14307aaa514c7 (diff)
downloadffmpeg-9298e8eb61f6c796aaf7c6e14e59f345318d2753.tar.gz
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>
-rw-r--r--libavformat/utils.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3ba4ae4123..c52f39e1b7 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4590,14 +4590,12 @@ AVProgram *av_new_program(AVFormatContext *ac, int id)
dynarray_add(&ac->programs, &ac->nb_programs, program);
program->discard = AVDISCARD_NONE;
program->pmt_version = -1;
+ program->id = id;
+ program->pts_wrap_reference = AV_NOPTS_VALUE;
+ program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
+ program->start_time =
+ program->end_time = AV_NOPTS_VALUE;
}
- program->id = id;
- program->pts_wrap_reference = AV_NOPTS_VALUE;
- program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
-
- program->start_time =
- program->end_time = AV_NOPTS_VALUE;
-
return program;
}