From 7be5f14c3ab0cc3e41f398827f4cf6d4f31d7b99 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Fri, 23 Apr 2010 23:50:34 +0300 Subject: demux_lavf, stream_ffmpeg: support librtmp seeks --- stream/stream_ffmpeg.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'stream/stream_ffmpeg.c') diff --git a/stream/stream_ffmpeg.c b/stream/stream_ffmpeg.c index fe8df9446d..e6705883fc 100644 --- a/stream/stream_ffmpeg.c +++ b/stream/stream_ffmpeg.c @@ -50,7 +50,8 @@ static int seek(stream_t *s, off_t newpos) static int control(stream_t *s, int cmd, void *arg) { - int64_t size; + int64_t size, ts; + double pts; switch(cmd) { case STREAM_CTRL_GET_SIZE: size = url_filesize(s->priv); @@ -58,6 +59,14 @@ static int control(stream_t *s, int cmd, void *arg) *(off_t *)arg = size; return 1; } + break; + case STREAM_CTRL_SEEK_TO_TIME: + pts = *(double *)arg; + ts = pts * AV_TIME_BASE; + ts = av_url_read_seek(s->priv, -1, ts, 0); + if (ts >= 0) + return 1; + break; } return STREAM_UNSUPPORTED; } -- cgit v1.2.3