VDR-1.3.31: moving cutting marks: cDvbPlayer::SkipFrames() is off by one for I frame only recordings (currently radio recordings)
Commit Message
Hi,
you may have experienced that moving cutting marks in radio recordings
always changes the frame counter by 2. The attached patch fixes this issue.
Bye.
@@ -621,7 +820,10 @@ int cDvbPlayer::SkipFrames(int Frames)
int Current, Total;
GetIndex(Current, Total, true);
int OldCurrent = Current;
- Current = index->GetNextIFrame(Current + Frames, Frames > 0);
+ // As GetNextIFrame() increments/decrements at least once, the
+ // destination frame (= Current + Frames) must be adjusted by
+ // -1/+1 respectively.
+ Current = index->GetNextIFrame(Current + Frames + (Frames > 0 ? -1 : 1), Frames > 0);
return Current >= 0 ? Current : OldCurrent;
}
return -1;