}
}
+bool CDVDFileInfo::DemuxerToStreamDetails(CDVDInputStream *pInputStream, CDVDDemux *pDemuxer, const std::vector<CStreamDetailSubtitle> subs, CStreamDetails &details)
+{
+ bool result = DemuxerToStreamDetails(pInputStream, pDemuxer, details);
+ for (unsigned int i = 0; i < subs.size(); i++)
+ {
+ CStreamDetailSubtitle* sub = new CStreamDetailSubtitle();
+ sub->m_strLanguage = subs[i].m_strLanguage;
+ details.AddStream(sub);
+ result = true;
+ }
+ return result;
+}
+
/* returns true if details have been added */
bool CDVDFileInfo::DemuxerToStreamDetails(CDVDInputStream *pInputStream, CDVDDemux *pDemux, CStreamDetails &details, const CStdString &path)
{
class CFileItem;
class CDVDDemux;
class CStreamDetails;
+class CStreamDetailSubtitle;
class CDVDInputStream;
class CTextureDetails;
static bool GetFileStreamDetails(CFileItem *pItem);
static bool DemuxerToStreamDetails(CDVDInputStream* pInputStream, CDVDDemux *pDemux, CStreamDetails &details, const CStdString &path = "");
+ /** \brief Probe the file's internal and external streams and store the info in the StreamDetails parameter.
+ * \param[out] details The file's StreamDetails consisting of internal streams and external subtitle streams.
+ */
+ static bool DemuxerToStreamDetails(CDVDInputStream *pInputStream, CDVDDemux *pDemuxer, const std::vector<CStreamDetailSubtitle> subs, CStreamDetails &details);
+
static bool GetFileDuration(const CStdString &path, int &duration);
/** \brief Probe the streams of an external subtitle file and store the info in the StreamDetails parameter.
{
if (m_pDemuxer)
{
- bool result = CDVDFileInfo::DemuxerToStreamDetails(m_pInputStream, m_pDemuxer, details);
+ std::vector<SelectionStream> subs = m_SelectionStreams.Get(STREAM_SUBTITLE);
+ std::vector<CStreamDetailSubtitle> extSubDetails;
+ for (unsigned int i = 0; i < subs.size(); i++)
+ {
+ if (subs[i].filename == m_filename)
+ continue;
+
+ CStreamDetailSubtitle p;
+ p.m_strLanguage = subs[i].language;
+ extSubDetails.push_back(p);
+ }
+
+ bool result = CDVDFileInfo::DemuxerToStreamDetails(m_pInputStream, m_pDemuxer, extSubDetails, details);
if (result && details.GetStreamCount(CStreamDetail::VIDEO) > 0) // this is more correct (dvds in particular)
{
/*
#include "Edl.h"
#include "FileItem.h"
#include "threads/SingleLock.h"
+#include "utils/StreamDetails.h"
class CDVDInputStream;
return false;
}
+CStreamDetailSubtitle& CStreamDetailSubtitle::operator=(const CStreamDetailSubtitle &that)
+{
+ if (this != &that)
+ {
+ this->m_pParent = that.m_pParent;
+ this->m_strLanguage = that.m_strLanguage;
+ }
+ return *this;
+}
+
CStreamDetails& CStreamDetails::operator=(const CStreamDetails &that)
{
if (this != &that)
{
public:
CStreamDetailSubtitle();
+ CStreamDetailSubtitle& operator=(const CStreamDetailSubtitle &that);
virtual void Archive(CArchive& ar);
virtual void Serialize(CVariant& value) const;
virtual bool IsWorseThan(CStreamDetail *that);