summaryrefslogtreecommitdiff
path: root/libavformat/rsd.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-11-20 20:51:22 +0100
committerPaul B Mahol <onemda@gmail.com>2015-11-20 20:52:37 +0100
commitb885d9ced59c878bc05da8304602cfcc2d69438e (patch)
tree6481377cabf3165ba3d727f610159d178c60eec6 /libavformat/rsd.c
parent9b7d39de81cebb689404cd362ed365aa6d451050 (diff)
downloadffmpeg-b885d9ced59c878bc05da8304602cfcc2d69438e.tar.gz
avformat/rsd: implement seeking
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/rsd.c')
-rw-r--r--libavformat/rsd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/rsd.c b/libavformat/rsd.c
index a0bc8fc0a4..dd1f3723d0 100644
--- a/libavformat/rsd.c
+++ b/libavformat/rsd.c
@@ -171,10 +171,12 @@ static int rsd_read_packet(AVFormatContext *s, AVPacket *pkt)
{
AVCodecContext *codec = s->streams[0]->codec;
int ret, size = 1024;
+ int64_t pos;
if (avio_feof(s->pb))
return AVERROR_EOF;
+ pos = avio_tell(s->pb);
if (codec->codec_id == AV_CODEC_ID_ADPCM_IMA_RAD ||
codec->codec_id == AV_CODEC_ID_ADPCM_PSX ||
codec->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV ||
@@ -198,6 +200,10 @@ static int rsd_read_packet(AVFormatContext *s, AVPacket *pkt)
ret = av_get_packet(s->pb, pkt, size);
}
+ if (codec->codec_id == AV_CODEC_ID_XMA2 && pkt->size >= 1)
+ pkt->duration = (pkt->data[0] >> 2) * 512;
+
+ pkt->pos = pos;
pkt->stream_index = 0;
return ret;
@@ -211,4 +217,5 @@ AVInputFormat ff_rsd_demuxer = {
.read_packet = rsd_read_packet,
.extensions = "rsd",
.codec_tag = (const AVCodecTag* const []){rsd_tags, 0},
+ .flags = AVFMT_GENERIC_INDEX,
};