Skip to content

Instantly share code, notes, and snippets.

@tmm1
Created March 24, 2019 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmm1/002096d61886fb7f58830455870104ad to your computer and use it in GitHub Desktop.
Save tmm1/002096d61886fb7f58830455870104ad to your computer and use it in GitHub Desktop.
From db6f249e3d95b124c388f26e39f95b855b15dcdf Mon Sep 17 00:00:00 2001
From: Aman Gupta <aman@tmm1.net>
Date: Fri, 22 Mar 2019 17:54:38 -0700
Subject: [PATCH] avformat/utils: add hack to allow read seeks via io context
Signed-off-by: Aman Gupta <aman@tmm1.net>
---
libavformat/utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index e5b85a31d9..05dc75c4ec 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2486,6 +2486,9 @@ static int seek_frame_internal(AVFormatContext *s, int stream_index,
if (s->iformat->read_seek) {
ff_read_frame_flush(s);
ret = s->iformat->read_seek(s, stream_index, timestamp, flags);
+ } else if (s->pb->read_seek) {
+ ff_read_frame_flush(s);
+ ret = s->pb->read_seek(s->pb->opaque, stream_index, timestamp, flags);
} else
ret = -1;
if (ret >= 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment