mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 04:58:06 +00:00
Fix playback of streams with more than one audio track (only one supported).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24618 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
8ea2de1262
commit
e1fa5aef51
@ -164,6 +164,7 @@ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) {
|
||||
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(demuxer_t* demuxer) {
|
||||
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(demuxer_t* demuxer) {
|
||||
// Issue a RTSP "SETUP" command on the chosen subsession:
|
||||
if (!rtspClient->setupMediaSubsession(*subsession, False,
|
||||
rtspStreamOverTCP)) break;
|
||||
if (!strcmp(subsession->mediumName(), "audio"))
|
||||
audiofound = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user