summaryrefslogtreecommitdiff
path: root/libavformat/mmsh.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-31 22:43:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-10-31 22:43:38 +0100
commit237bcaa27518e7439afc982112b83dedeab0cb6b (patch)
treec9c87850f9f8fe5856aaa21cd9c204eb15d10564 /libavformat/mmsh.c
parent60fcc19bff49e0b1972eae014afc087afd94a415 (diff)
mmsh:_implement a minimal mmsh_seek() so the stream position can be found out.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mmsh.c')
-rw-r--r--libavformat/mmsh.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c
index beef0a87ba..3b493ee61c 100644
--- a/libavformat/mmsh.c
+++ b/libavformat/mmsh.c
@@ -385,12 +385,22 @@ static int64_t mmsh_read_seek(URLContext *h, int stream_index,
return ret;
}
+static int64_t mmsh_seek(URLContext *h, int64_t pos, int whence)
+{
+ MMSHContext *mmsh = h->priv_data;
+ MMSContext *mms = &mmsh->mms;
+
+ if(pos == 0 && whence == SEEK_CUR)
+ return mms->asf_header_read_size + mms->remaining_in_len + mmsh->chunk_seq * mms->asf_packet_len;
+ return AVERROR(ENOSYS);
+}
+
URLProtocol ff_mmsh_protocol = {
.name = "mmsh",
.url_open = mmsh_open,
.url_read = mmsh_read,
.url_write = NULL,
- .url_seek = NULL,
+ .url_seek = mmsh_seek,
.url_close = mmsh_close,
.url_read_seek = mmsh_read_seek,
};