Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
changed: Improve logic in GetStreamDetails() for items without a (com…
…plete) VideoInfoTag
  • Loading branch information
arnova authored and davilla committed Apr 9, 2013
1 parent 73ae781 commit 7cf4af4
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions xbmc/video/VideoDatabase.cpp
Expand Up @@ -3100,13 +3100,22 @@ CVideoInfoTag CVideoDatabase::GetDetailsByTypeAndId(VIDEODB_CONTENT_TYPE type, i

bool CVideoDatabase::GetStreamDetails(CFileItem& item)
{
CVideoInfoTag *tag = item.GetVideoInfoTag();
if (tag->m_iFileId < 0)
tag->m_iFileId = GetFileId(item);
// Note that this function (possibly) creates VideoInfoTags for items that don't have one yet!
int fileId = -1;

return GetStreamDetails(*tag);
}
if (item.HasVideoInfoTag())
fileId = item.GetVideoInfoTag()->m_iFileId;

if (fileId < 0)
fileId = GetFileId(item);

if (fileId < 0)
return false;

// Have a file id, get stream details if available (creates tag either way)
item.GetVideoInfoTag()->m_iFileId = fileId;
return GetStreamDetails(*item.GetVideoInfoTag());
}

bool CVideoDatabase::GetStreamDetails(CVideoInfoTag& tag) const
{
Expand Down

0 comments on commit 7cf4af4

Please sign in to comment.