mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
streaminfo2: fix segfault with unknown media_type
Origin commit data
------------------
Branch: ni/coolstream
Commit: c60990407b
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-02-17 (Mon, 17 Feb 2020)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -183,11 +183,13 @@ void CStreamInfo2::analyzeStream(AVFormatContext *avfc, unsigned int idx)
|
||||
size_t pos = m["codec"].find_first_of(":");
|
||||
if (pos != std::string::npos)
|
||||
m["codec"] = m["codec"].erase(0, pos + 2);
|
||||
|
||||
#if (LIBAVFORMAT_VERSION_MAJOR > 57) || ((LIBAVFORMAT_VERSION_MAJOR == 57) && (LIBAVFORMAT_VERSION_MINOR > 32))
|
||||
m["codec_type"] = av_get_media_type_string(st->codecpar->codec_type);
|
||||
std::string codecType = av_get_media_type_string(st->codecpar->codec_type) ? av_get_media_type_string(st->codecpar->codec_type):"unknown";
|
||||
#else
|
||||
m["codec_type"] = av_get_media_type_string(st->codec->codec_type);
|
||||
std::string codecType = av_get_media_type_string(st->codec->codec_type) ? av_get_media_type_string(st->codec->codec_type):"unknown";
|
||||
#endif
|
||||
m["codec_type"] = codecType;
|
||||
m["codec_type"][0] ^= 'a' ^ 'A';
|
||||
|
||||
m["pid"] = to_string(st->id);
|
||||
|
Reference in New Issue
Block a user