mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
add av_dict_free, fix memleak
This commit is contained in:
@@ -2083,8 +2083,12 @@ bool CStreamRec::Open(CZapitChannel * channel)
|
|||||||
|
|
||||||
if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) {
|
if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) {
|
||||||
printf("%s: Cannot open input [%s]!\n", __FUNCTION__, url.c_str());
|
printf("%s: Cannot open input [%s]!\n", __FUNCTION__, url.c_str());
|
||||||
|
if (!headers.empty())
|
||||||
|
av_dict_free(&options);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!headers.empty())
|
||||||
|
av_dict_free(&options);
|
||||||
|
|
||||||
if (avformat_find_stream_info(ifcx, NULL) < 0) {
|
if (avformat_find_stream_info(ifcx, NULL) < 0) {
|
||||||
printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str());
|
printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str());
|
||||||
|
@@ -788,8 +788,12 @@ bool CStreamStream::Open()
|
|||||||
av_dict_set(&options, "headers", headers.c_str(), 0);
|
av_dict_set(&options, "headers", headers.c_str(), 0);
|
||||||
if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) {
|
if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) {
|
||||||
printf("%s: Cannot open input [%s]!\n", __FUNCTION__, channel->getUrl().c_str());
|
printf("%s: Cannot open input [%s]!\n", __FUNCTION__, channel->getUrl().c_str());
|
||||||
|
if (!headers.empty())
|
||||||
|
av_dict_free(&options);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!headers.empty())
|
||||||
|
av_dict_free(&options);
|
||||||
|
|
||||||
if (avformat_find_stream_info(ifcx, NULL) < 0) {
|
if (avformat_find_stream_info(ifcx, NULL) < 0) {
|
||||||
printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str());
|
printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str());
|
||||||
|
Reference in New Issue
Block a user