From 98653b9f34027a53089f79a5c77e870ba7e1f140 Mon Sep 17 00:00:00 2001 From: "ji.yong.seo" Date: Thu, 21 Jan 2016 13:20:53 +0900 Subject: [PATCH] add protocol deregister API Change-Id: I1407f526e68cafef9569fe86c8ac27a07d6ee3fd Signed-off-by: ji.yong.seo --- libavformat/avio.c | 17 +++++++++++++++++ libavformat/url.h | 5 +++++ 2 files changed, 22 insertions(+) mode change 100644 => 100755 libavformat/avio.c mode change 100644 => 100755 libavformat/url.h diff --git a/libavformat/avio.c b/libavformat/avio.c old mode 100644 new mode 100755 index f68994c..e0ea4a5 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -105,6 +105,23 @@ int ffurl_register_protocol(URLProtocol *protocol) return 0; } +int ffurl_deregister_protocol(URLProtocol *protocol) +{ + URLProtocol **p; + + p = &first_protocol; + + while (*p != NULL) { + if(!strcmp((*p)->name, protocol->name)) { + *p = (*p)->next; + continue; + } + p = &(*p)->next; + } + + return 0; +} + static int url_alloc_for_protocol(URLContext **puc, struct URLProtocol *up, const char *filename, int flags, const AVIOInterruptCB *int_cb) diff --git a/libavformat/url.h b/libavformat/url.h old mode 100644 new mode 100755 index 40be4d5..b05128d --- a/libavformat/url.h +++ b/libavformat/url.h @@ -228,6 +228,11 @@ int ffurl_shutdown(URLContext *h, int flags); int ffurl_register_protocol(URLProtocol *protocol); /** + * Deregister the URLProtocol protocol. + */ +int ffurl_deregister_protocol(URLProtocol *protocol); + +/** * Check if the user has requested to interrup a blocking function * associated with cb. */ -- 2.7.4