forked from FFmpeg/FFmpeg
Support for seeking in TTA files.
Originally committed as revision 8820 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
2bd8416e7c
commit
70fa2486a1
1 changed files with 15 additions and 0 deletions
|
@ -120,6 +120,20 @@ static int tta_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
return av_get_packet(&s->pb, pkt, size);
|
return av_get_packet(&s->pb, pkt, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
|
||||||
|
{
|
||||||
|
TTAContext *c = s->priv_data;
|
||||||
|
AVStream *st = s->streams[stream_index];
|
||||||
|
int index = av_index_search_timestamp(st, timestamp, flags);
|
||||||
|
if (index < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
c->currentframe = index;
|
||||||
|
url_fseek(&s->pb, st->index_entries[index].pos, SEEK_SET);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
AVInputFormat tta_demuxer = {
|
AVInputFormat tta_demuxer = {
|
||||||
"tta",
|
"tta",
|
||||||
"true-audio",
|
"true-audio",
|
||||||
|
@ -128,5 +142,6 @@ AVInputFormat tta_demuxer = {
|
||||||
tta_read_header,
|
tta_read_header,
|
||||||
tta_read_packet,
|
tta_read_packet,
|
||||||
NULL,
|
NULL,
|
||||||
|
tta_read_seek,
|
||||||
.extensions = "tta",
|
.extensions = "tta",
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue