Fix wrong duration for mpeg-ts 02/221402/3
authorjiyong.min <jiyong.min@samsung.com>
Thu, 2 Jan 2020 05:25:20 +0000 (14:25 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Thu, 2 Jan 2020 05:52:53 +0000 (14:52 +0900)
 Generally, mpegts has wrong start time(positive large value).
 So duration do not use start time for mpeg-ts.

Change-Id: I97ddc31860bdeb489abe41f4fbc7e9b61d2572d5

formats/ffmpeg/mm_file_format_ffmpeg.c
packaging/libmm-fileinfo.spec

index cd6d40b..74479c9 100644 (file)
@@ -420,8 +420,9 @@ int mmfile_format_read_stream_ffmpg(MMFileFormatContext *formatContext)
 
        /**
         *@note asf has long duration bug. and Some content's start time is wrong(negative number).
+        * Generally, mpegts has wrong start time(positive large value). So skip start time for mpegts format.
         */
-       if (pFormatCtx->start_time < 0) {
+       if (pFormatCtx->start_time < 0 || formatContext->formatType == MM_FILE_FORMAT_M2TS) {
                debug_warning(DEBUG, "Wrong Start time = %"PRId64"\n", pFormatCtx->start_time);
                formatContext->duration = (long long)(pFormatCtx->duration) * 1000 / AV_TIME_BASE;
        } else {
index 16d030a..5a3b9c1 100644 (file)
@@ -1,6 +1,6 @@
 Name:      libmm-fileinfo
 Summary:    Media Fileinfo
-Version:    0.6.82
+Version:    0.6.83
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0