[MPlayer-cvslog] r24618 - trunk/libmpdemux/demux_rtp.cpp

cehoyos subversion at mplayerhq.hu
Wed Sep 26 00:34:01 CEST 2007


Author: cehoyos
Date: Wed Sep 26 00:34:01 2007
New Revision: 24618

Log:
Fix playback of streams with more than one audio track (only one supported).

Modified:
   trunk/libmpdemux/demux_rtp.cpp

Modified: trunk/libmpdemux/demux_rtp.cpp
==============================================================================
--- trunk/libmpdemux/demux_rtp.cpp	(original)
+++ trunk/libmpdemux/demux_rtp.cpp	Wed Sep 26 00:34:01 2007
@@ -164,6 +164,7 @@ extern "C" demuxer_t* demux_open_rtp(dem
     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 @@ extern "C" demuxer_t* demux_open_rtp(dem
     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 @@ extern "C" demuxer_t* demux_open_rtp(dem
 	  // Issue a RTSP "SETUP" command on the chosen subsession:
 	  if (!rtspClient->setupMediaSubsession(*subsession, False,
 						rtspStreamOverTCP)) break;
+	  if (!strcmp(subsession->mediumName(), "audio"))
+	    audiofound = 1;
 	}
       }
     }



More information about the MPlayer-cvslog mailing list