Skip to content

Commit

Permalink
* Decode audio frames on FFmpegFrameGrabber.setTimestamp() to avoi…
Browse files Browse the repository at this point in the history
…d sync issues (pull #871)
  • Loading branch information
egorapolonov authored and saudet committed Jan 4, 2018
1 parent 0986f0e commit 7e73a24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,11 @@ static class SeekCallback extends Seek_Pointer_long_int {
(or vice versa)
*/
int count = 0; // prevent infinite loops with corrupted files
while (this.timestamp > timestamp + 1 && grabFrame(false, true, false, false) != null && count++ < 1000) {
while (this.timestamp > timestamp + 1 && grabFrame(true, true, false, false) != null && count++ < 1000) {
// flush frames if seeking backwards
}
count = 0;
while (this.timestamp < timestamp - 1 && grabFrame(false, true, false, false) != null && count++ < 1000) {
while (this.timestamp < timestamp - 1 && grabFrame(true, true, false, false) != null && count++ < 1000) {
// decode up to the desired frame
}
if (video_c != null) {
Expand Down

0 comments on commit 7e73a24

Please sign in to comment.