record: fix stream rec segfault, supplement to last commit

This commit is contained in:
Jacek Jendrzej
2019-05-16 17:20:34 +02:00
parent 086578fdb2
commit 15681a54bb

View File

@@ -2194,7 +2194,7 @@ bool CStreamRec::Open(CZapitChannel * channel)
snprintf(ifcx->filename, sizeof(ifcx->filename), "%s", channel->getUrl().c_str());
av_dump_format(ifcx, 0, ifcx->filename, 0);
#else
snprintf(ifcx->url, channel->getUrl().size() + 1, "%s", channel->getUrl().c_str());
ifcx->url = av_strdup(!channel->getUrl().empty() ? channel->getUrl().c_str() : "");
av_dump_format(ifcx, 0, ifcx->url, 0);
#endif