[FFmpeg-devel] [PATCH 03/10] avformat/mpegtsenc: move around setting m2ts_mode

Marton Balint cus at passwd.hu
Tue Nov 12 23:28:59 EET 2019


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavformat/mpegtsenc.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 46cfc68904..fb2e44ba20 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:
-- 
2.16.4



More information about the ffmpeg-devel mailing list