[FFmpeg-devel] [PATCH] RDT/Realmedia patches #2

Ronald S. Bultje rsbultje
Sat Dec 6 20:48:55 CET 2008


On Sat, Dec 6, 2008 at 2:17 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Nov 30, 2008 at 09:47:16PM -0500, Ronald S. Bultje wrote:
>> Index: ffmpeg-svn/libavformat/rdt.c
>> ===================================================================
>> --- ffmpeg-svn.orig/libavformat/rdt.c 2008-11-30 20:51:48.000000000 -0500
>> +++ ffmpeg-svn/libavformat/rdt.c      2008-11-30 20:59:38.000000000 -0500
>> @@ -80,7 +80,7 @@
>>  }
>>  struct PayloadContext {
>> -    AVFormatContext *rmctx;
>> +    AVFormatContext *rmctx[MAX_STREAMS];
> this is ugly and id like to hear why exactly you would need this

Every rmdemuxer has only a single audio stream instance, and keeps
state of the audio inside the demuxer context (RMDemuxContext). Since
things like codec and/or bitrate are different, so are the demuxer
settings for things like byte reordering and such (e.g. look at the
first lines of the audio code in ff_rm_parse_packet()). These are
stream-specific, and if you have multiple streams within a set working
on the same rmdemuxcontext, then they will overwrite each other's
state and use each others settings, thus leading to (effectively)
noise as output. By using a different rmdemuxcontext for each stream
within a set, settings and state are maintained for each stream within
the set between calls to the RM demuxer for other streams within the
same set, thus leading to correct output for all streams within the

Other solutions to this kind of a problem would be to create a
RMStream, which represents one stream (~AVStream) within the
RMDemuxContext, and store audio/video settings in there, so that we
can have multiple audio/video streams per RM file, but I haven't
looked at how easy that is, or if such RM files exist and if
realplayer can play them back.


More information about the ffmpeg-devel mailing list