Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-03-24 14:00:41 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2017-08-04 20:18:07 +0300
commite6283dc52b78f1a4091da13da039a1f0a4db9101 (patch)
treea3c3e836c54e3980022d8bebdfe8c1499150f988
parent6d2429f7fb5a1399e1ff405358116962dfb7db50 (diff)
HACK flic: Support seeking to pts = 0 for looped playback
-rw-r--r--libavformat/flic.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/flic.c b/libavformat/flic.c
index 7c62cb423c..2e78241a37 100644
--- a/libavformat/flic.c
+++ b/libavformat/flic.c
@@ -259,6 +259,20 @@ static int flic_read_packet(AVFormatContext *s,
return avio_feof(pb) ? AVERROR_EOF : ret;
}
+static int flic_read_seek(AVFormatContext *s, int stream_index,
+ int64_t pts, int flags)
+{
+ FlicDemuxContext *flic = s->priv_data;
+ if (pts == 0) {
+ flic->frame_number = 0;
+ avio_seek(s->pb, s->streams[flic->video_stream_index]->codecpar->extradata_size, SEEK_SET);
+
+ return 0;
+ }
+
+ return -1;
+}
+
AVInputFormat ff_flic_demuxer = {
.name = "flic",
.long_name = NULL_IF_CONFIG_SMALL("FLI/FLC/FLX animation"),
@@ -266,4 +280,5 @@ AVInputFormat ff_flic_demuxer = {
.read_probe = flic_probe,
.read_header = flic_read_header,
.read_packet = flic_read_packet,
+ .read_seek = flic_read_seek,
};