[PATCH] demux_rtp.cpp: Don't initialize more than one audio subsession
Hi! If an rtsp stream contains more than one audio stream, both are initialized in current demux_rtp.cpp. This leads to visible picture(!) corruption. Attached patch fixes this by preventing initialization of more than one audio stream. Please comment, Carl Eugen PS: I did not succeed in producing a hack that would allow to change the audio streams while playing (after a hard coded time for example), so atm, applying this patch would not remove a feature. Index: libmpdemux/demux_rtp.cpp =================================================================== --- libmpdemux/demux_rtp.cpp (Revision 22916) +++ libmpdemux/demux_rtp.cpp (Arbeitskopie) @@ -164,6 +164,7 @@ rtpState->firstSyncTime.tv_sec = rtpState->firstSyncTime.tv_usec = 0; demuxer->priv = rtpState; + int audiofound = 0; // Create RTP receivers (sources) for each subsession: MediaSubsessionIterator iter(*mediaSession); MediaSubsession* subsession; @@ -171,6 +172,10 @@ while ((subsession = iter.next()) != NULL) { // Ignore any subsession that's not audio or video: if (strcmp(subsession->mediumName(), "audio") == 0) { + if (audiofound) { + fprintf(stderr, "Additional subsession \"audio/%s\" skipped\n", subsession->codecName()); + continue; + } desiredReceiveBufferSize = 100000; } else if (strcmp(subsession->mediumName(), "video") == 0) { desiredReceiveBufferSize = 2000000; @@ -203,6 +208,8 @@ // Issue a RTSP "SETUP" command on the chosen subsession: if (!rtspClient->setupMediaSubsession(*subsession, False, rtspStreamOverTCP)) break; + if (!strcmp(subsession->mediumName(), "audio")) + audiofound = 1; } } }
If an rtsp stream contains more than one audio stream, both are initialized in current demux_rtp.cpp.
This leads to visible picture(!) corruption.
Why? Wouldn't it be better to fix that bug instead? Anyway, why would a RTSP stream contain more than one audio streams? Do you have an example (showing the SDP description)? I'm wondering what the stream is actually trying to do...
Attached patch fixes this by preventing initialization of more than one audio stream.
Please comment
Mumble... I suppose that's OK. -- Ross Finlayson Live Networks, Inc. http://www.live555.com/
Ross Finlayson wrote:
Anyway, why would a RTSP stream contain more than one audio streams? Do you have an example (showing the SDP description)? I'm wondering what the stream is actually trying to do...
Multi language description? lu -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
If an rtsp stream contains more than one audio stream, both are initialized in current demux_rtp.cpp.
This leads to visible picture(!) corruption. Attached patch fixes this by preventing initialization of more than one audio stream.
Finally applied. Carl Eugen
participants (3)
-
Carl Eugen Hoyos -
Luca Barbato -
Ross Finlayson