[FFmpeg-devel] [PATCH] RTMP seek support

Howard Chu hyc
Tue Mar 30 22:24:47 CEST 2010


Howard Chu wrote:
> Howard Chu wrote:
>> Howard Chu wrote:
>>> This is a first stab at getting seek working on an RTMP stream. Unfortunately,
>>> it usually fails. Sometimes it works correctly, but most times it just hangs.
>>> Apparently there's something getting out of sync, but I don't have any idea
>>> where. Any help would be appreciated.
>>>
>>> I've been testing with this stream:
>>>
>>> gdb --args ./ffplay_g
>>> "rtmp://fms.scctv.net/annenberg//vod/world_of_chemistry_01
>>> swfurl=http://www.learner.org/vod/swfs/player-licensed.swf
>>> pageurl=http://www.learner.org/vod/vod_window.html?pid=793"
>>
>> Thanks to a tip from uau this is now working.
>
> Some confusion over whether to implement read_seek or read_seek2.
> av_seek_frame() already rescales the timestamp correctly for the stream, so
> the protocol handler shouldn't be doing that. (But avformat_seek_file doesn't
> rescale, so read_seek2 would need to do it.)

Cleaned up some more. Since it looks like the read_seek2 API is still a work 
in progress I've dropped it from the patch.

Note that the did_rseek flag wouldn't even be needed if the rest of flvdec 
always read from the start of a frame, instead of reading from the end of the 
previous frame, as it currently does. But I took a look at fixing that and the 
diff would be pretty large, so I chose this approach instead.

The patch for aviobuf.c is going to be needed regardless - you shouldn't be 
setting "s->pos = s->seek()" unconditionally, since s->seek may not be 
implemented. Storing a -32 in s->pos is bound to screw something else up.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dif.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100330/f5f8e3ab/attachment.txt>



More information about the ffmpeg-devel mailing list