Skip to content

Commit

Permalink
[editor] Do not reject the first frame of reference video which start…
Browse files Browse the repository at this point in the history
…s at zero as candidate in getFrameNumFromPtsOrBefore()

This fixes seek to the second keyframe instead of to the first one when dragging the navigation slider fully to the left in a video with the first frame PTS = 0.
  • Loading branch information
eumagga0x2a committed Jul 31, 2019
1 parent 0d9c173 commit f5d6dc9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion avidemux/common/ADM_editor/src/ADM_edSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ using std::string;
#include "ADM_edit.hxx"
#include "ADM_vidMisc.h"

#if 1
#define pivotPrintf(...) {}
#else
#define pivotPrintf printf
#endif

/**
\fn getNKFramePTS
Expand Down Expand Up @@ -355,7 +359,7 @@ bool ADM_Composer::getFrameNumFromPtsOrBefore(_VIDEOS *v,uint64_t refTime,int &f
frameNumber = curFrame;
return true;
}
if(pts >= rangeBegin && pts > last && pts < refTime)
if(pts >= rangeBegin && (last? pts > last : true) && pts < refTime)
{
candidate = curFrame;
last = pts;
Expand Down

0 comments on commit f5d6dc9

Please sign in to comment.