1 |
From 074db6f21d674348a66b95950b7316d81fef294a Mon Sep 17 00:00:00 2001 |
2 |
From: Anssi Hannula <anssi@xbmc.org> |
3 |
Date: Tue, 1 Feb 2011 18:30:45 +0200 |
4 |
Subject: [PATCH 12/12] removed: unused function CDVDFileInfo::GetFileMetaData |
5 |
|
6 |
This function populated CFileItem properties according to metadata |
7 |
extracted by libavformat. It used old libavformat API and should be |
8 |
ported to use the new metadata API instead. However, the function is not |
9 |
used so it is simply removed. |
10 |
|
11 |
(cherry-picked from e5ba935601a573fad1308632ffe3362f6d59db61) |
12 |
--- |
13 |
xbmc/cores/dvdplayer/DVDFileInfo.cpp | 72 ---------------------------------- |
14 |
xbmc/cores/dvdplayer/DVDFileInfo.h | 3 - |
15 |
2 files changed, 0 insertions(+), 75 deletions(-) |
16 |
|
17 |
diff --git a/xbmc/cores/dvdplayer/DVDFileInfo.cpp b/xbmc/cores/dvdplayer/DVDFileInfo.cpp |
18 |
index 046bc26..5190b7d 100644 |
19 |
--- a/xbmc/cores/dvdplayer/DVDFileInfo.cpp |
20 |
+++ b/xbmc/cores/dvdplayer/DVDFileInfo.cpp |
21 |
@@ -43,7 +43,6 @@ |
22 |
#include "DVDCodecs/Video/DVDVideoCodec.h" |
23 |
#include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h" |
24 |
|
25 |
-#include "Codecs/DllAvFormat.h" |
26 |
#include "Codecs/DllAvCodec.h" |
27 |
#include "Codecs/DllSwScale.h" |
28 |
#include "FileSystem/File.h" |
29 |
@@ -255,77 +254,6 @@ bool CDVDFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str |
30 |
return bOk; |
31 |
} |
32 |
|
33 |
- |
34 |
-void CDVDFileInfo::GetFileMetaData(const CStdString &strPath, CFileItem *pItem) |
35 |
-{ |
36 |
- if (!pItem) |
37 |
- return; |
38 |
- |
39 |
- CDVDInputStream *pInputStream = CDVDFactoryInputStream::CreateInputStream(NULL, strPath, ""); |
40 |
- if (!pInputStream) |
41 |
- { |
42 |
- CLog::Log(LOGERROR, "%s - Error creating stream for %s", __FUNCTION__, strPath.c_str()); |
43 |
- return ; |
44 |
- } |
45 |
- |
46 |
- if (pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD) || !pInputStream->Open(strPath.c_str(), "")) |
47 |
- { |
48 |
- CLog::Log(LOGERROR, "%s - invalid stream in %s", __FUNCTION__, strPath.c_str()); |
49 |
- delete pInputStream; |
50 |
- return ; |
51 |
- } |
52 |
- |
53 |
- CDVDDemuxFFmpeg *pDemuxer = new CDVDDemuxFFmpeg; |
54 |
- |
55 |
- try |
56 |
- { |
57 |
- if (!pDemuxer->Open(pInputStream)) |
58 |
- { |
59 |
- CLog::Log(LOGERROR, "%s - Error opening demuxer", __FUNCTION__); |
60 |
- delete pDemuxer; |
61 |
- delete pInputStream; |
62 |
- return ; |
63 |
- } |
64 |
- } |
65 |
- catch(...) |
66 |
- { |
67 |
- CLog::Log(LOGERROR, "%s - Exception thrown when opening demuxer", __FUNCTION__); |
68 |
- if (pDemuxer) |
69 |
- delete pDemuxer; |
70 |
- delete pInputStream; |
71 |
- return ; |
72 |
- } |
73 |
- |
74 |
- AVFormatContext *pContext = pDemuxer->m_pFormatContext; |
75 |
- if (pContext) |
76 |
- { |
77 |
- int nLenMsec = pDemuxer->GetStreamLength(); |
78 |
- CStdString strDuration; |
79 |
- int nHours = nLenMsec / 1000 / 60 / 60; |
80 |
- int nMinutes = ((nLenMsec / 1000) - nHours * 3600) / 60; |
81 |
- int nSec = (nLenMsec / 1000) - nHours * 3600 - nMinutes * 60; |
82 |
- strDuration.Format("%d", nLenMsec); |
83 |
- pItem->SetProperty("duration-msec", strDuration); |
84 |
- strDuration.Format("%02d:%02d:%02d", nHours, nMinutes, nSec); |
85 |
- pItem->SetProperty("duration-str", strDuration); |
86 |
- pItem->SetProperty("title", pContext->title); |
87 |
- pItem->SetProperty("author", pContext->author); |
88 |
- pItem->SetProperty("copyright", pContext->copyright); |
89 |
- pItem->SetProperty("comment", pContext->comment); |
90 |
- pItem->SetProperty("album", pContext->album); |
91 |
- strDuration.Format("%d", pContext->year); |
92 |
- pItem->SetProperty("year", strDuration); |
93 |
- strDuration.Format("%d", pContext->track); |
94 |
- pItem->SetProperty("track", strDuration); |
95 |
- pItem->SetProperty("genre", pContext->genre); |
96 |
- } |
97 |
- |
98 |
- delete pDemuxer; |
99 |
- pInputStream->Close(); |
100 |
- delete pInputStream; |
101 |
- |
102 |
-} |
103 |
- |
104 |
/** |
105 |
* \brief Open the item pointed to by pItem and extact streamdetails |
106 |
* \return true if the stream details have changed |
107 |
diff --git a/xbmc/cores/dvdplayer/DVDFileInfo.h b/xbmc/cores/dvdplayer/DVDFileInfo.h |
108 |
index 09d2619..7335321 100644 |
109 |
--- a/xbmc/cores/dvdplayer/DVDFileInfo.h |
110 |
+++ b/xbmc/cores/dvdplayer/DVDFileInfo.h |
111 |
@@ -33,9 +33,6 @@ public: |
112 |
// Extract a thumbnail immage from the media at strPath an image file in strTarget, optionally populating a streamdetails class with the data |
113 |
static bool ExtractThumb(const CStdString &strPath, const CStdString &strTarget, CStreamDetails *pStreamDetails); |
114 |
|
115 |
- // GetFileMetaData will fill pItem's properties according to what can be extracted from the file. |
116 |
- static void GetFileMetaData(const CStdString &strPath, CFileItem *pItem); |
117 |
- |
118 |
// Probe the files streams and store the info in the VideoInfoTag |
119 |
static bool GetFileStreamDetails(CFileItem *pItem); |
120 |
static bool DemuxerToStreamDetails(CDVDInputStream* pInputStream, CDVDDemux *pDemux, CStreamDetails &details, const CStdString &path = ""); |
121 |
-- |
122 |
1.7.4.4 |
123 |
|