changeset 25237:963cd0542cec

Fix playback of streams with more than one video track (only one supported).
author cehoyos
date Sun, 02 Dec 2007 18:04:14 +0000
parents d541a8203657
children f42b8e689416
files libmpdemux/demux_rtp.cpp
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_rtp.cpp	Sun Dec 02 17:45:08 2007 +0000
+++ b/libmpdemux/demux_rtp.cpp	Sun Dec 02 18:04:14 2007 +0000
@@ -164,7 +164,7 @@
     rtpState->firstSyncTime.tv_sec = rtpState->firstSyncTime.tv_usec = 0;
     demuxer->priv = rtpState;
 
-    int audiofound = 0;
+    int audiofound = 0, videofound = 0;
     // Create RTP receivers (sources) for each subsession:
     MediaSubsessionIterator iter(*mediaSession);
     MediaSubsession* subsession;
@@ -178,6 +178,10 @@
 	}
 	desiredReceiveBufferSize = 100000;
       } else if (strcmp(subsession->mediumName(), "video") == 0) {
+	if (videofound) {
+	  fprintf(stderr, "Additional subsession \"video/%s\" skipped\n", subsession->codecName());
+	  continue;
+	}
 	desiredReceiveBufferSize = 2000000;
       } else {
 	continue;
@@ -210,6 +214,8 @@
 						rtspStreamOverTCP)) break;
 	  if (!strcmp(subsession->mediumName(), "audio"))
 	    audiofound = 1;
+	  if (!strcmp(subsession->mediumName(), "video"))
+            videofound = 1;
 	}
       }
     }