Skip to content

Commit

Permalink
[editor] Get getRefVideo() right
Browse files Browse the repository at this point in the history
This fixes a crash on playback of a video with cuts resulting from a mental snafu in 4341938 to mistake ref videos for segments.
  • Loading branch information
eumagga0x2a committed Mar 12, 2020
1 parent 5c13022 commit 1483e24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions avidemux/common/ADM_editor/src/ADM_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,18 +807,18 @@ uint32_t ADM_Composer::getPARHeight()
*/
uint64_t ADM_Composer::getFrameIncrement(bool copyMode)
{
uint32_t nb = _segments.getNbSegments();
int nb = _segments.getNbRefVideos();
if(!nb) return 0;
uint64_t minIncrement = 0;
for(uint32_t i=0; i<nb; i++)
for(int i=0; i<nb; i++)
{
_VIDEOS *vid = _segments.getRefVideo(i);
ADM_assert(vid);
uint64_t inc = vid->timeIncrementInUs;
if(!inc) continue;
if(!copyMode && vid->fieldEncoded)
{
ADM_info("Doubling frame increment for field-encoded ref video %u\n",i);
ADM_info("Doubling frame increment for field-encoded ref video %d\n",i);
inc *= 2;
}
if(!minIncrement | (inc < minIncrement))
Expand Down

0 comments on commit 1483e24

Please sign in to comment.