avformat: Warn about using network functions without calling avformat_network_init

This is to make developers aware of the fact that they will
start using the new init function at some point.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö
2011-11-07 13:57:33 +02:00
parent 87892ef8a6
commit ce145690b6
3 changed files with 9 additions and 0 deletions

View File

@ -119,8 +119,15 @@ void ff_tls_deinit(void)
avpriv_unlock_avformat();
}
int ff_network_inited_globally;
int ff_network_init(void)
{
if (!ff_network_inited_globally)
av_log(NULL, AV_LOG_WARNING, "Using network protocols without global "
"network initialization. Please use "
"avformat_network_init(), this will "
"become mandatory later.\n");
#if HAVE_WINSOCK2_H
WSADATA wsaData;
if (WSAStartup(MAKEWORD(1,1), &wsaData))