Skip to content

Commit

Permalink
[stillimage] Remove faulty and pointless sanity check, fix mixup of r…
Browse files Browse the repository at this point in the history
…elative and absolute time values
  • Loading branch information
eumagga0x2a committed Jan 29, 2024
1 parent 2bf37c0 commit 2fd1354
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions avidemux_plugins/ADM_videoFilters6/stillimage/stillimage.cpp
Expand Up @@ -317,19 +317,11 @@ bool stillimage::getNextFrame(uint32_t *fn, ADMImage *image)

/**
\fn updateTimingInfo
\brief perform a sanity check and update info with the new totalDuration
\brief Update total duration and markers.
*/
bool stillimage::updateTimingInfo(void)
{
uint64_t old=previousFilter->getInfo()->totalDuration;
if(1000LL*params.start + timeIncrement > old)
{
if(old > timeIncrement)
params.start=(uint32_t)((old-timeIncrement)/1000);
else
params.start=0;
}

begin=1000LL*params.start;
end=begin+1000LL*params.duration;
if(from < begin)
Expand All @@ -347,12 +339,12 @@ bool stillimage::updateTimingInfo(void)
freezeDuration = end - begin;
aprintf("[stillimage::updateTimingInfo] Freeze duration set to %s\n", ADM_us2plain(freezeDuration));

info.totalDuration=old+end-begin;
info.totalDuration = old + freezeDuration;
info.markerA = previousFilter->getInfo()->markerA;
info.markerB = previousFilter->getInfo()->markerB;
if (info.markerA > begin)
if (info.markerA > from + begin)
info.markerA += freezeDuration;
if (info.markerB > begin)
if (info.markerB > from + begin)
info.markerB += freezeDuration;

return true;
Expand Down

0 comments on commit 2fd1354

Please sign in to comment.