summaryrefslogtreecommitdiff
path: root/libavformat/mpegtsenc.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2019-11-10 22:14:30 +0100
committerMarton Balint <cus@passwd.hu>2019-12-03 11:00:11 +0100
commitdb63db3977bb49c8d8f389b31db96253fa9e9a46 (patch)
tree759713f741f183bd6f278ef678b9b2f1d8669fcc /libavformat/mpegtsenc.c
parent565dc3e451c73a011e37a5faf022f67b8b5c1f9c (diff)
avformat/mpegtsenc: move around setting m2ts_mode
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r--libavformat/mpegtsenc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 92c7820236..b9768803c0 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -850,6 +850,14 @@ static int mpegts_init(AVFormatContext *s)
int *pids;
int ret;
+ if (ts->m2ts_mode == -1) {
+ if (av_match_ext(s->url, "m2ts")) {
+ ts->m2ts_mode = 1;
+ } else {
+ ts->m2ts_mode = 0;
+ }
+ }
+
if (s->max_delay < 0) /* Not set by the caller */
s->max_delay = 0;
@@ -1002,14 +1010,6 @@ static int mpegts_init(AVFormatContext *s)
av_rescale(ts->sdt_period, 1000, PCR_TIME_BASE),
av_rescale(ts->pat_period, 1000, PCR_TIME_BASE));
- if (ts->m2ts_mode == -1) {
- if (av_match_ext(s->url, "m2ts")) {
- ts->m2ts_mode = 1;
- } else {
- ts->m2ts_mode = 0;
- }
- }
-
return 0;
fail: