diff options
Diffstat (limited to 'libavformat/sapdec.c')
-rw-r--r-- | libavformat/sapdec.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c index 0e99ace614..218c32a2eb 100644 --- a/libavformat/sapdec.c +++ b/libavformat/sapdec.c @@ -2,24 +2,25 @@ * Session Announcement Protocol (RFC 2974) demuxer * Copyright (c) 2010 Martin Storsjo * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avformat.h" +#include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/intreadwrite.h" #include "network.h" @@ -39,8 +40,6 @@ struct SAPState { uint16_t hash; char *sdp; int eof; - - const URLProtocol **protocols; }; static int sap_probe(AVProbeData *p) @@ -57,7 +56,6 @@ static int sap_read_close(AVFormatContext *s) avformat_close_input(&sap->sdp_ctx); if (sap->ann_fd) ffurl_close(sap->ann_fd); - av_freep(&sap->protocols); av_freep(&sap->sdp); ff_network_close(); return 0; @@ -85,17 +83,11 @@ static int sap_read_header(AVFormatContext *s) av_strlcpy(host, "224.2.127.254", sizeof(host)); } - sap->protocols = ffurl_get_protocols(s->protocol_whitelist, - s->protocol_blacklist); - if (!sap->protocols) { - ret = AVERROR(ENOMEM); - goto fail; - } - ff_url_join(url, sizeof(url), "udp", NULL, host, port, "?localport=%d", port); - ret = ffurl_open(&sap->ann_fd, url, AVIO_FLAG_READ, - &s->interrupt_callback, NULL, sap->protocols); + ret = ffurl_open_whitelist(&sap->ann_fd, url, AVIO_FLAG_READ, + &s->interrupt_callback, NULL, + s->protocol_whitelist, s->protocol_blacklist); if (ret) goto fail; @@ -168,6 +160,10 @@ static int sap_read_header(AVFormatContext *s) sap->sdp_ctx->max_delay = s->max_delay; sap->sdp_ctx->pb = &sap->sdp_pb; sap->sdp_ctx->interrupt_callback = s->interrupt_callback; + + if ((ret = ff_copy_whiteblacklists(sap->sdp_ctx, s)) < 0) + goto fail; + ret = avformat_open_input(&sap->sdp_ctx, "temp.sdp", infmt, NULL); if (ret < 0) goto fail; |