From: Steve Kondik Date: Sat, 2 Apr 2016 02:52:04 +0000 (-0700) Subject: stagefright-plugins: Fix timestamp calculation X-Git-Tag: android-x86-7.1-r1~38 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fexternal-stagefright-plugins.git;a=commitdiff_plain;h=a54c041a1755b46843b8dab736eccee5d27602d9 stagefright-plugins: Fix timestamp calculation * The start time should be added to the calculated PTS or we end up with a negative timestamp. Derp? Change-Id: Id24834ff3e7268dacdcd1d44d6335ece3a62b410 --- diff --git a/extractor/FFmpegExtractor.cpp b/extractor/FFmpegExtractor.cpp index 3e150bb..9ab9938 100644 --- a/extractor/FFmpegExtractor.cpp +++ b/extractor/FFmpegExtractor.cpp @@ -1525,7 +1525,7 @@ retry: } if (pktTS != AV_NOPTS_VALUE) - timeUs = av_rescale_q(pktTS, mStream->time_base, AV_TIME_BASE_Q) - startTimeUs; + timeUs = av_rescale_q(pktTS, mStream->time_base, AV_TIME_BASE_Q) + startTimeUs; else timeUs = SF_NOPTS_VALUE; //FIXME AV_NOPTS_VALUE is negative, but stagefright need positive