Bug fix. Incorrect width and height for specific mpegts 41/320741/5 accepted/tizen/unified/20250310.131217 accepted/tizen/unified/x/20250311.125540
authorJiyong <jiyong.min@samsung.com>
Tue, 4 Mar 2025 23:45:33 +0000 (08:45 +0900)
committerJiyong <jiyong.min@samsung.com>
Fri, 7 Mar 2025 02:24:13 +0000 (11:24 +0900)
[Cause]
 - Side effect of reducing the probesize for mpegts
[Solution]
 - Adjust the probesize for mpegts

Change-Id: I3b1090b5eee9426ba0119d553e33549a755de9a2

formats/ffmpeg/mm_file_format_ffmpeg.c
mm_file_config.ini
packaging/libmm-fileinfo.spec
utils/include/mm_file_utils.h

index c3e01e94624cac0abf4e6466cd16b71f78589a51..a6f7165c17cfc08f541de3d77899e50d80f2f4dd 100644 (file)
@@ -36,6 +36,7 @@
 
 static int g_max_analyze_duration = 0;
 static int g_probesize = 0;
+static int g_probesize_mpegts = 0;
 
 #ifdef __MMFILE_TEST_MODE__
 static void _dump_av_packet(AVPacket *pkt)
@@ -474,10 +475,17 @@ int mmfile_format_read_stream_ffmpg(MMFileFormatContext *formatContext)
                g_max_analyze_duration = mmfile_get_int_from_ini(MMFILE_INI_MAXANLDURATION, MMFILE_DEFAULT_MAXANLDURATION);
        if (g_probesize == 0)
                g_probesize = mmfile_get_int_from_ini(MMFILE_INI_PROBESIZE, MMFILE_DEFAULT_PROBESIZE);
-
-       if (formatContext->formatType == MM_FILE_FORMAT_M2TS)
-               pFormatCtx->max_analyze_duration = g_max_analyze_duration;      // MPEGTS file timeout set
-       pFormatCtx->probesize = g_probesize;    // the size of the data(packet) to probe stream information
+       if (g_probesize_mpegts == 0)
+               g_probesize_mpegts = mmfile_get_int_from_ini(MMFILE_INI_PROBESIZE_MPEGTS, MMFILE_DEFAULT_PROBESIZE_MPEGTS);
+
+       if (formatContext->formatType == MM_FILE_FORMAT_M2TS) {
+               // set the duration of the data to read
+               pFormatCtx->max_analyze_duration = g_max_analyze_duration;
+               // set the number of the bytes to probe stream information
+               pFormatCtx->probesize = g_probesize_mpegts;
+       } else {
+               pFormatCtx->probesize = g_probesize;
+       }
 
        debug_msg(RELEASE, "max_analyze_duration: %"PRId64", probesize: %"PRId64"", pFormatCtx->max_analyze_duration, pFormatCtx->probesize);
 
index 5906563d41d8938186f359caa9ef52f767509051..3608cd43ce3df631cf5d49f1a03d6aad669904eb 100644 (file)
@@ -8,3 +8,4 @@
 junk_counter_limit=1000
 max_analyze_duration=100000
 probesize=50000
+probesize_for_mpegts=265000
index 0e3143099bb260cc27655945d04901f589d7cf53..79dbee8800c06ed63fb2daa0b8b2ad6dd20198fc 100644 (file)
@@ -1,6 +1,6 @@
 Name:      libmm-fileinfo
 Summary:    Media Fileinfo
-Version:    1.1.2
+Version:    1.1.3
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 1bd7fba1c8db4c36889455cf4b7fee873eff20d5..3c3e0ac5aff2c448482c7a19d9b7187d04b5c1af 100755 (executable)
@@ -147,14 +147,16 @@ int                       mmfile_close(MMFileIOHandle *h);
 /*////////////////////////////////////////////////////////////////////// */
 /*                            INI  API                               // */
 /*////////////////////////////////////////////////////////////////////// */
-#define MMFILE_INI_PATH                "/etc/multimedia/mm_file_config.ini"
-#define MMFILE_INI_JUNKCNTLIMIT                "mm-file-config:junk_counter_limit"
-#define MMFILE_INI_MAXANLDURATION      "mm-file-config:max_analyze_duration"
-#define MMFILE_INI_PROBESIZE           "mm-file-config:probesize"
-
-#define MMFILE_DEFAULT_JUNKCNTLIMIT            1000
-#define MMFILE_DEFAULT_MAXANLDURATION  100000
-#define MMFILE_DEFAULT_PROBESIZE               1000
+#define MMFILE_INI_PATH              "/etc/multimedia/mm_file_config.ini"
+#define MMFILE_INI_JUNKCNTLIMIT      "mm-file-config:junk_counter_limit"
+#define MMFILE_INI_MAXANLDURATION    "mm-file-config:max_analyze_duration"
+#define MMFILE_INI_PROBESIZE         "mm-file-config:probesize"
+#define MMFILE_INI_PROBESIZE_MPEGTS  "mm-file-config:probesize_for_mpegts"
+
+#define MMFILE_DEFAULT_JUNKCNTLIMIT      1000
+#define MMFILE_DEFAULT_MAXANLDURATION    100000
+#define MMFILE_DEFAULT_PROBESIZE         50000
+#define MMFILE_DEFAULT_PROBESIZE_MPEGTS  300000
 
 int mmfile_get_int_from_ini(const char *key, int notfound);