setup url instead of filename in the AVFormatContext to satisfy filename being deprecated

pull/2562/head
Isaac Connor 2019-01-14 10:47:53 -05:00
parent c97eb16942
commit d0cca01c4c
1 changed files with 5 additions and 1 deletions

View File

@ -338,7 +338,11 @@ AVFormatContext *SessionDescriptor::generateFormatContext() const
{
AVFormatContext *formatContext = avformat_alloc_context();
strncpy( formatContext->filename, mUrl.c_str(), sizeof(formatContext->filename) );
#if (LIBAVFORMAT_VERSION_CHECK(58, 12, 0, 0, 100))
formatContext->url = av_strdup(mUrl.c_str());
#else
strncpy(formatContext->filename, mUrl.c_str(), sizeof(formatContext->filename));
#endif
/*
if ( mName.length() )
strncpy( formatContext->title, mName.c_str(), sizeof(formatContext->title) );