From 4fb0bd9247b491b8288e351618428aa8c54065ea Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 23 Jan 2020 21:15:51 +0100 Subject: [PATCH] ffmpegdec: try to fix overread on rewind/forward play Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/af8a7e10a535780b1f4e4c134717d9bf59a071c6 Author: Jacek Jendrzej Date: 2020-01-23 (Thu, 23 Jan 2020) --- src/driver/audiodec/ffmpegdec.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index 1d71edbb7..7d065570a 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -326,7 +326,11 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, next_skip_pts = pts + skip/4; seek_flags = 0; } - av_seek_frame(avc, best_stream, pts, seek_flags); + int result = av_seek_frame(avc, best_stream, pts, seek_flags); + if (result < 0) { + fprintf(stderr,"av_seek_frame error\n"); + } + avcodec_flush_buffers(c); // if a custom value was set we only jump once if (actSecsToSkip != 0) { *state=PLAY;