summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-22 08:27:01 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-23 07:05:28 +0200
commit4d200342a7d512dbe91c1820ee82fc3aaf4b644d (patch)
treeee00a643e28181481a808006cbf3e873e427f750 /libavformat
parent5a3385d49a765a9cf6d55ecc0826e48d2bf082de (diff)
avformat/utils: Also set io_repositioned for generic seeking
It allows demuxers to perform certain tasks after a successful generic seek. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5754fc1537..39f082d98d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2354,10 +2354,12 @@ static int seek_frame_generic(AVFormatContext *s, int stream_index,
ie = &st->internal->index_entries[st->internal->nb_index_entries - 1];
if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0)
return ret;
+ s->io_repositioned = 1;
avpriv_update_cur_dts(s, st, ie->timestamp);
} else {
if ((ret = avio_seek(s->pb, s->internal->data_offset, SEEK_SET)) < 0)
return ret;
+ s->io_repositioned = 1;
}
av_packet_unref(pkt);
for (;;) {
@@ -2392,6 +2394,7 @@ static int seek_frame_generic(AVFormatContext *s, int stream_index,
ie = &st->internal->index_entries[index];
if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0)
return ret;
+ s->io_repositioned = 1;
avpriv_update_cur_dts(s, st, ie->timestamp);
return 0;