From 845548ccba5882b2f8af593512633662032392d0 Mon Sep 17 00:00:00 2001 From: "jiyong.min" Date: Thu, 2 Jan 2020 14:25:20 +0900 Subject: [PATCH] Fix wrong duration for mpeg-ts 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 | 3 ++- packaging/libmm-fileinfo.spec | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/formats/ffmpeg/mm_file_format_ffmpeg.c b/formats/ffmpeg/mm_file_format_ffmpeg.c index cd6d40b..74479c9 100644 --- a/formats/ffmpeg/mm_file_format_ffmpeg.c +++ b/formats/ffmpeg/mm_file_format_ffmpeg.c @@ -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 { diff --git a/packaging/libmm-fileinfo.spec b/packaging/libmm-fileinfo.spec index 16d030a..5a3b9c1 100644 --- a/packaging/libmm-fileinfo.spec +++ b/packaging/libmm-fileinfo.spec @@ -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 -- 2.7.4