[FFmpeg-devel] [PATCH 1/2] rtsp: Don't use AVStream->priv_data for mapping RTSPStreams to AVStreams
Ronald S. Bultje
rsbultje
Fri Feb 11 16:14:47 CET 2011
Hi,
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.
Ronald
More information about the ffmpeg-devel
mailing list