[MPlayer-dev-eng] [PATCH] Do not block mplayer at rtsp eof

Carl Eugen Hoyos cehoyos at ag.or.at
Tue May 1 18:22:31 CEST 2007


Hi Ross!

On 2007-05-01 14:04, Ross Finlayson wrote:
> At 1:10 PM +0200 5/1/07, Carl Eugen Hoyos wrote:
> >Current svn hangs on eof when playing rtsp streams (from a server that
> >supports trick play). Attached patch fixes this issue by quitting after
> >no packet has arrived for three seconds.
> 
> No, this is bad.  A RTSP client should quit only if it receives a 
> RTCP "BYE" packet, or if the RTSP connection closes.  (I.e., the 
> testing for "stream->eof" is OK, but the 3 second delay is not.)

Please note that the "if (eof)return null" part of the patch does not
make sense without the rest: It's only there to avoid getBuffer calling
getNextFrame again after it has already failed (=did not return packet)
once.

> For streams that have a known end point, the server will indicate 
> this, by including an end time in the 'time' ("t=") SDP attribute, 
> but will *not* send a RTCP "BYE" when it reaches the end of the 
> stream.  This allows the client to - if it wishes - seek backwards 
> and replay the stream (using RTSP).  (For 'live' streams, with no 
> predefined end point, the server will instead send a RTCP "BYE" if 
> the stream ends.)

I think we agree that "BYE" is already handled through
onSourceClosure(), so we don't have to deal with it.

> (If a client *really* wants to quit after reaching the end of the 
> stream - i.e., without using its ability to seek backwards and replay 
> the stream - then it can, if it wishes, use the stream's known 'end 
> time' to figure this out.  This is what our "openRTSP" command-line 
> client does, for example.  For GUI clients, however, we really want 
> to retain the ability to seek backwards and replay the stream.)

As Rich pointed out, for mplayer, it's mandatory to finish playing on EOF.
I guess you mean "mediaSession->playEndTime()" when talking about "known
end time": I'm surprised because it's never (I mean in testing streams I
use) exactly accurate.

New patch attached: If not behind 95% of playEndTime(), it waits 10sec,
which is the timeout of mplayers native rtsp code; behind 95%, it will
quit after 2 sec.

Since having no timeout at all is really bad IMO, I'd like to apply this
or a similar version.

Thanks for reviewing, Carl Eugen
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patcheof
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070501/96e1abf6/attachment.asc>


More information about the MPlayer-dev-eng mailing list