mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-14 02:27:48 +00:00
avformat/brstm: clip timestamp when seeking into acceptable range
This commit is contained in:
parent
38be47017b
commit
f4b84d89d1
@ -446,7 +446,11 @@ static int read_seek(AVFormatContext *s, int stream_index,
|
|||||||
BRSTMDemuxContext *b = s->priv_data;
|
BRSTMDemuxContext *b = s->priv_data;
|
||||||
int64_t ret = 0;
|
int64_t ret = 0;
|
||||||
|
|
||||||
|
if (timestamp < 0)
|
||||||
|
timestamp = 0;
|
||||||
timestamp /= b->samples_per_block;
|
timestamp /= b->samples_per_block;
|
||||||
|
if (timestamp >= b->block_count)
|
||||||
|
timestamp = b->block_count - 1;
|
||||||
ret = avio_seek(s->pb, b->data_start + timestamp * b->block_size *
|
ret = avio_seek(s->pb, b->data_start + timestamp * b->block_size *
|
||||||
st->codecpar->channels, SEEK_SET);
|
st->codecpar->channels, SEEK_SET);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user