[FFmpeg-devel] [PATCH 1/2] rtsp: Don't use AVStream->priv_data for mapping RTSPStreams to AVStreams

Ronald S. Bultje rsbultje
Fri Feb 11 21:07:09 CET 2011


Hi,

On Fri, Feb 11, 2011 at 2:57 PM, Martin Storsj? <martin at martin.st> wrote:
> On Fri, 11 Feb 2011, Ronald S. Bultje wrote:
>
>> On Fri, Feb 11, 2011 at 2:19 PM, Martin Storsj? <martin at martin.st> wrote:
>> > On Fri, 11 Feb 2011, Ronald S. Bultje wrote:
>> >
>> >> On Fri, Feb 11, 2011 at 2:20 AM, Martin Storsj? <martin at martin.st> wrote:
>> >> > Since a few weeks ago, AVStream->priv_data isn't set. The much
>> >> > more straightforward solution is to use RTSPStream->stream_index
>> >> > instead.
>> >> > ---
>> >> > Btw, are there any better-working RealRTSP samples than the ones
>> >> > on multimediawiki? The audio-only ones work fine, but most of
>> >> > the ones with video crash ffplay sooner or later (unrelated
>> >> > to these patches).
>> >> >
>> >> > ?libavformat/rtspdec.c | ? ?5 ++---
>> >> > ?1 files changed, 2 insertions(+), 3 deletions(-)
>> >> >
>> >> > diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
>> >> > index 45ed7bb..31a51f8 100644
>> >> > --- a/libavformat/rtspdec.c
>> >> > +++ b/libavformat/rtspdec.c
>> >> > @@ -281,9 +281,9 @@ retry:
>> >> > ? ? ? ? ? ? snprintf(cmd, sizeof(cmd),
>> >> > ? ? ? ? ? ? ? ? ? ? ?"Subscribe: ");
>> >> > ? ? ? ? ? ? for (i = 0; i < rt->nb_rtsp_streams; i++) {
>> >> > + ? ? ? ? ? ? ? ?int r = rt->rtsp_streams[i]->stream_index;
>> >> > ? ? ? ? ? ? ? ? rule_nr = 0;
>> >> > - ? ? ? ? ? ? ? ?for (r = 0; r < s->nb_streams; r++) {
>> >> > - ? ? ? ? ? ? ? ? ? ?if (s->streams[r]->priv_data == rt->rtsp_streams[i]) {
>> >> > + ? ? ? ? ? ? ? ?if (r >= 0) {
>> >> > ? ? ? ? ? ? ? ? ? ? ? ? if (s->streams[r]->discard != AVDISCARD_ALL) {
>> >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (!first)
>> >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? av_strlcat(rt->last_subscription, ",",
>> >>
>> >> Not a good idea! This breaks playback of streams with multiple audio
>> >> tracks, e.g. absolute radio high bitrate. These have multiple
>> >> AVStreams per RTSPStream (switch using 'a' in ffplay, set starting
>> >> stream using -ast <num>), and this patch breaks that.
>> >
>> > Uhm, no? As far as I can see, each RTSPStream corresponds to one AVStream.
>> > av_new_stream isn't called anywhere else except sdp_parse_line, where
>> > av_new_stream() is called once for each RTSPStream created (except for
>> > mpeg2ts streams).
>>
>> Check rdt.c.
>
> Oh, I see, sorry for that.
>
> Do you have any sample urls that I could try out, that uses this feature?

rtsp://a1665.l3944145664.c39441.g.lr.akamaistream.net/live/D/1665/39441/v0001/reflector:45664?BBC-UID=542cc1b8d079db636a0c2ee2e1d877c1075688bda000a11f92999674adda3564&SSO2-UID=

http://www.radiofeeds.co.uk/rp.asp has various realmedia RTSP streams,
some use this feature.

Ronald



More information about the ffmpeg-devel mailing list