summaryrefslogtreecommitdiff
path: root/libavformat/segafilm.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-11-10 18:16:11 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-11-10 18:16:11 +0100
commitb3453f44edae9160439f8cd8580d151554c87e5f (patch)
treed74713813121d21874f2e8b55b6322755bd0cf9f /libavformat/segafilm.c
parent43266457b4f96e5f8becedf71971e4bb149afca3 (diff)
parentc012c6f1a8b34828a7870dc1854422934f14b79a (diff)
Merge commit 'c012c6f1a8b34828a7870dc1854422934f14b79a'
* commit 'c012c6f1a8b34828a7870dc1854422934f14b79a': segafilm: implement seeking Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat/segafilm.c')
-rw-r--r--libavformat/segafilm.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c
index f59b45f6f9..5e408db696 100644
--- a/libavformat/segafilm.c
+++ b/libavformat/segafilm.c
@@ -297,13 +297,15 @@ static int film_read_seek(AVFormatContext *s, int stream_index, int64_t timestam
{
FilmDemuxContext *film = s->priv_data;
AVStream *st = s->streams[stream_index];
- int index = av_index_search_timestamp(st, timestamp, flags);
- if (index < 0)
- return -1;
- if (avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET) < 0)
- return -1;
+ int ret = av_index_search_timestamp(st, timestamp, flags);
+ if (ret < 0)
+ return ret;
+
+ ret = avio_seek(s->pb, st->index_entries[ret].pos, SEEK_SET);
+ if (ret < 0)
+ return ret;
- film->current_sample = index;
+ film->current_sample = ret;
return 0;
}