ytparser/moviebrowser: add option for selecting prefered quality

Origin commit data
------------------
Branch: ni/coolstream
Commit: e01e96c1ac
Author: martii <m4rtii@gmx.de>
Date: 2013-06-09 (Sun, 09 Jun 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2013-06-09 09:31:57 +02:00
committed by [CST] Focus
parent b6a01d2000
commit 742122d110
8 changed files with 34 additions and 7 deletions

View File

@@ -59,19 +59,26 @@ void cYTVideoInfo::Dump()
printf("===================================================================\n");
}
std::string cYTVideoInfo::GetUrl(int fmt)
std::string cYTVideoInfo::GetUrl(int fmt, bool mandatory)
{
yt_urlmap_iterator_t it;
if (fmt) {
if ((it = formats.find(fmt)) != formats.end())
return it->second.GetUrl();
return "";
if (mandatory)
return "";
}
if ((it = formats.find(22)) != formats.end()) // 720p
if ((it = formats.find(22)) != formats.end()) // 720p MP4
return it->second.GetUrl();
if ((it = formats.find(37)) != formats.end()) // 1080p
#if 0
if ((it = formats.find(35)) != formats.end()) // 480p FLV
return it->second.GetUrl();
if ((it = formats.find(18)) != formats.end()) // 270p/360p
if ((it = formats.find(34)) != formats.end()) // 360p FLV
return it->second.GetUrl();
#endif
if ((it = formats.find(18)) != formats.end()) // 270p/360p MP4
return it->second.GetUrl();
if ((it = formats.find(37)) != formats.end()) // 1080p MP4
return it->second.GetUrl();
return "";
}