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)
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);
/*////////////////////////////////////////////////////////////////////// */
/* 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);