Skip to content

Commit

Permalink
replace avio_seek with the higher-level avformat_seek_file
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee committed Dec 11, 2024
1 parent 8553227 commit c84d6cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/replay/framereader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ bool VideoDecoder::decode(FrameReader *reader, int idx, VisionBuf *buf) {
break;
}
}
avio_seek(reader->input_ctx->pb, reader->packets_info[from_idx].pos, SEEK_SET);
avcodec_flush_buffers(decoder_ctx);
auto pos = reader->packets_info[from_idx].pos;
if (avformat_seek_file(reader->input_ctx, 0, pos, pos, pos, AVSEEK_FLAG_BYTE) >= 0) {
avcodec_flush_buffers(decoder_ctx);
}
}
reader->prev_idx = idx;

Expand Down

0 comments on commit c84d6cc

Please sign in to comment.