[FFmpeg-devel] [PATCH] rtpdec.c: don't overwrite pkt->stream_index in finalize_packet()

Luca Abeni lucabe72
Sat Feb 28 20:03:40 CET 2009

Hi Ronald,

Ronald S. Bultje wrote:
> Hi,
> On Sat, Feb 28, 2009 at 12:36 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>> Hi,
>> There's this problem with proprietary protocols that they screw up.

>> For MS/ASF/RTP, what happened is that in multi-stream sessions, say
>> one where you're reading audio and video or where you have a high- and
>> a low-bitrate stream, there are (or could be) two active streams. Yet,
>> incoming RTP packets, regardless of TCP/UDP etc., will always have the
>> stream-id 0 (i.e. for TCP, the id after $ is 0, or for UDP, everything
>> arrives over a single RTP connection). The packet data containing the
>> ASF packet contains the actually correct stream-id, which is parsed in
>> asf.c.
I suspect this problem is common to all the "container in RTP" formats?
(I seem to remember that RM in RDT has a similar issue... No?)

Maybe the best thing to do is to provide a framework for handling these 
cases of container encapsulated inside a container... I am not asking 
you to do this; just to think if it could be an idea.

Looking at your patch, I wonder on which tree it is based: AFAIK the 
current code only calls finalize_packet() for static payloads (yes, this 
is a bug and needs to be fixed).

Also, I think it would be better to implement it without repeating the 
"pkt->stream_index = st->index;" line in all the payload handers.


More information about the ffmpeg-devel mailing list