[FFmpeg-devel] [PATCH] Fix SDP demuxer dependencies

Reimar Döffinger Reimar.Doeffinger
Mon Dec 28 20:16:14 CET 2009


On Mon, Dec 28, 2009 at 08:10:22PM +0100, Reimar D?ffinger wrote:
> On Mon, Dec 28, 2009 at 01:55:45PM -0500, Ronald S. Bultje wrote:
> > Hi,
> > 
> > On Mon, Dec 28, 2009 at 1:30 PM, Martin Storsj? <martin at martin.st> wrote:
> > > On Mon, 28 Dec 2009, Ronald S. Bultje wrote:
> > >> rtp_asf should not (binarily) depend on asf, it could use any asf
> > >> demuxer. This should not lead to a linker failure.
> > >
> > > Well, on line 111 it uses &asf_demuxer, and thus directly references a
> > > symbol from asfdec.c.
> > 
> > Oh, right... Hmm... Have to figure out how to get rid of that, for now
> > the patch is ok then (as Luca said).
> 
> It should only be a very quick patch to change the hardcoded demuxer to
> use av_find_input_format instead.

Untested, and I fear it will crash if there is no asf demuxer (as does
the current code if for some reason av_open_input_stream fails I
suspect?), but this should do it:
Index: rtp_asf.c
===================================================================
--- rtp_asf.c   (revision 20921)
+++ rtp_asf.c   (working copy)
@@ -94,6 +94,7 @@
 void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
 {
     if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
+        AVInputFormat *asf_demux;
         ByteIOContext pb;
         RTSPState *rt = s->priv_data;
         int len = strlen(p) * 6 / 8;
@@ -103,12 +104,17 @@
         if (rtp_asf_fix_header(buf, len) < 0)
             av_log(s, AV_LOG_ERROR,
                    "Failed to fix invalid RTSP-MS/ASF min_pktsize\n");
-        init_packetizer(&pb, buf, len);
         if (rt->asf_ctx) {
             av_close_input_stream(rt->asf_ctx);
             rt->asf_ctx = NULL;
         }
-        av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);
+        asf_demux = av_find_input_format("asf");
+        if (!asf_demux) {
+            av_log(s, AV_LOG_ERROR, "Could not find an ASF demuxer\n");
+            return;
+        }
+        init_packetizer(&pb, buf, len);
+        av_open_input_stream(&rt->asf_ctx, &pb, "", asf_demux, NULL);
         rt->asf_pb_pos = url_ftell(&pb);
         av_free(buf);
         rt->asf_ctx->pb = NULL;



More information about the ffmpeg-devel mailing list