# HG changeset patch # User rsf # Date 1077430808 0 # Node ID 94e1953fbe8efb99c7a002a584685b78ce80df21 # Parent 1615952c26a8fc63b38b88ace98fe7e2d0f52202 Added support for multiplexed audio+video RTP streams. diff -r 1615952c26a8 -r 94e1953fbe8e libmpdemux/demux_rtp.cpp --- a/libmpdemux/demux_rtp.cpp Sun Feb 22 06:19:24 2004 +0000 +++ b/libmpdemux/demux_rtp.cpp Sun Feb 22 06:20:08 2004 +0000 @@ -119,7 +119,7 @@ int rtspStreamOverTCP = 0; -extern "C" void demux_open_rtp(demuxer_t* demuxer) { +extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) { do { TaskScheduler* scheduler = BasicTaskScheduler::createNew(); if (scheduler == NULL) break; @@ -254,6 +254,17 @@ rtpState->flags |= flags; } } while (0); + + // Hack: If audio and video are demuxed together on a single RTP stream, + // then create a new "demuxer_t" structure to allow the higher-level + // code to recognize this: + if (demux_is_multiplexed_rtp_stream(demuxer)) { + stream_t* s = new_ds_stream(demuxer->video); + demuxer_t* od = demux_open(s, DEMUXER_TYPE_UNKNOWN, -1, -1, -1, NULL); + demuxer = new_demuxers_demuxer(od, od, od); + } + + return demuxer; } extern "C" int demux_is_mpeg_rtp_stream(demuxer_t* demuxer) {