mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 06:06:43 +00:00
xbmc-pvr: remove unneeded patches
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
29a749777d
commit
2ca6c96a63
@ -1,15 +0,0 @@
|
||||
diff -Naur xbmc-dharma-35100/Makefile.in xbmc-dharma-35100.patch/Makefile.in
|
||||
--- xbmc-dharma-35100/Makefile.in 2010-10-30 05:36:41.000000000 +0200
|
||||
+++ xbmc-dharma-35100.patch/Makefile.in 2010-11-01 04:53:48.542705631 +0100
|
||||
@@ -471,11 +471,6 @@
|
||||
xbmc/cores/DllLoader/exports/util/exports_utils.a \
|
||||
xbmc/cores/DllLoader/exports/exports.a
|
||||
|
||||
-ifeq (arm, $(ARCH))
|
||||
-# Force external python2.5 for now!
|
||||
-LIBS +=-lpython2.5
|
||||
-endif
|
||||
-
|
||||
xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC)
|
||||
ifeq ($(findstring osx,$(ARCH)), osx)
|
||||
$(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic
|
@ -1,354 +0,0 @@
|
||||
diff -Naur xbmc-Dharma-10.1-c8405db/xbmc/lib/libPython/xbmcmodule/Makefile xbmc-Dharma-10.1-c8405db.patch/xbmc/lib/libPython/xbmcmodule/Makefile
|
||||
--- xbmc-Dharma-10.1-c8405db/xbmc/lib/libPython/xbmcmodule/Makefile 2011-02-15 13:30:06.000000000 +0100
|
||||
+++ xbmc-Dharma-10.1-c8405db.patch/xbmc/lib/libPython/xbmcmodule/Makefile 2011-03-03 16:47:38.230032818 +0100
|
||||
@@ -1,8 +1,9 @@
|
||||
INCLUDES=-I../../../.. -I. -I../../../ -I../../../linux -I../../../../guilib -I../../../utils -I../../../cores -I../../../../lib/jsoncpp/jsoncpp/include
|
||||
|
||||
-SRCS=action.cpp controlbutton.cpp controlcheckmark.cpp control.cpp controlfadelabel.cpp controlimage.cpp controllabel.cpp controllist.cpp controlprogress.cpp controlslider.cpp controlspin.cpp controltextbox.cpp dialog.cpp GUIPythonWindow.cpp GUIPythonWindowDialog.cpp GUIPythonWindowXML.cpp GUIPythonWindowXMLDialog.cpp infotagmusic.cpp infotagvideo.cpp keyboard.cpp listitem.cpp player.cpp pyplaylist.cpp PythonPlayer.cpp pyutil.cpp window.cpp winxml.cpp winxmldialog.cpp xbmcguimodule.cpp xbmcmodule.cpp controlgroup.cpp xbmcplugin.cpp controlradiobutton.cpp PythonAddon.cpp xbmcaddonmodule.cpp
|
||||
+SRCS=action.cpp controlbutton.cpp controlcheckmark.cpp control.cpp controlfadelabel.cpp controlimage.cpp controllabel.cpp controllist.cpp controlprogress.cpp controlslider.cpp controlspin.cpp controltextbox.cpp dialog.cpp GUIPythonWindow.cpp GUIPythonWindowDialog.cpp GUIPythonWindowXML.cpp GUIPythonWindowXMLDialog.cpp infotagmusic.cpp infotagvideo.cpp keyboard.cpp listitem.cpp player.cpp pyplaylist.cpp PythonPlayer.cpp pyutil.cpp window.cpp winxml.cpp winxmldialog.cpp xbmcguimodule.cpp xbmcmodule.cpp controlgroup.cpp xbmcplugin.cpp controlradiobutton.cpp PythonAddon.cpp xbmcaddonmodule.cpp xbmcvfsmodule.cpp
|
||||
|
||||
LIB=xbmcmodule.a
|
||||
|
||||
include ../../../../Makefile.include
|
||||
-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS)))
|
||||
+
|
||||
diff -Naur xbmc-Dharma-10.1-c8405db/xbmc/lib/libPython/xbmcmodule/xbmcmodule.cpp xbmc-Dharma-10.1-c8405db.patch/xbmc/lib/libPython/xbmcmodule/xbmcmodule.cpp
|
||||
--- xbmc-Dharma-10.1-c8405db/xbmc/lib/libPython/xbmcmodule/xbmcmodule.cpp 2011-02-15 13:30:06.000000000 +0100
|
||||
+++ xbmc-Dharma-10.1-c8405db.patch/xbmc/lib/libPython/xbmcmodule/xbmcmodule.cpp 2011-03-03 16:47:38.257032286 +0100
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "SectionLoader.h"
|
||||
#include "Settings.h"
|
||||
#include "LocalizeStrings.h"
|
||||
+#include "utils/FileUtils.h"
|
||||
|
||||
// include for constants
|
||||
#include "pyutil.h"
|
||||
@@ -958,6 +959,35 @@
|
||||
|
||||
return Py_BuildValue((char*)"b", exists);
|
||||
}
|
||||
+
|
||||
+ PyDoc_STRVAR(subHashAndFileSize__doc__,
|
||||
+ "subHashAndFileSize(file)\n"
|
||||
+ "\n"
|
||||
+ "file : file to calculate subtitle hash and size for"
|
||||
+ "\n"
|
||||
+ "example:\n"
|
||||
+ " size,hash = xbmcvfs.subHashAndFileSize(file)\n");
|
||||
+ PyObject* XBMC_subHashAndFileSize(PyObject *self, PyObject *args, PyObject *kwds)
|
||||
+ {
|
||||
+ PyObject *f_line;
|
||||
+ if (!PyArg_ParseTuple(
|
||||
+ args,
|
||||
+ (char*)"O",
|
||||
+ &f_line))
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ CStdString strSource;
|
||||
+ if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) return NULL;
|
||||
+
|
||||
+ CStdString strSize;
|
||||
+ CStdString strHash;
|
||||
+ Py_BEGIN_ALLOW_THREADS
|
||||
+ CFileUtils::SubtitleFileSizeAndHash(strSource, strSize, strHash);
|
||||
+ Py_END_ALLOW_THREADS
|
||||
+
|
||||
+ return Py_BuildValue((char*)"ss",strSize.c_str(), strHash.c_str());
|
||||
+ }
|
||||
|
||||
// define c functions to be used in python here
|
||||
PyMethodDef xbmcMethods[] = {
|
||||
@@ -1005,6 +1035,8 @@
|
||||
{(char*)"getCleanMovieTitle", (PyCFunction)XBMC_GetCleanMovieTitle, METH_VARARGS|METH_KEYWORDS, getCleanMovieTitle__doc__},
|
||||
|
||||
{(char*)"skinHasImage", (PyCFunction)XBMC_SkinHasImage, METH_VARARGS|METH_KEYWORDS, skinHasImage__doc__},
|
||||
+ {(char*)"subHashAndFileSize", (PyCFunction)XBMC_subHashAndFileSize, METH_VARARGS, subHashAndFileSize__doc__},
|
||||
+
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
diff -Naur xbmc-Dharma-10.1-c8405db/xbmc/lib/libPython/xbmcmodule/xbmcvfsmodule.cpp xbmc-Dharma-10.1-c8405db.patch/xbmc/lib/libPython/xbmcmodule/xbmcvfsmodule.cpp
|
||||
--- xbmc-Dharma-10.1-c8405db/xbmc/lib/libPython/xbmcmodule/xbmcvfsmodule.cpp 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ xbmc-Dharma-10.1-c8405db.patch/xbmc/lib/libPython/xbmcmodule/xbmcvfsmodule.cpp 2011-03-03 16:53:19.588294319 +0100
|
||||
@@ -0,0 +1,205 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2005-2011 Team XBMC
|
||||
+ * http://www.xbmc.org
|
||||
+ *
|
||||
+ * This Program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||
+ * any later version.
|
||||
+ *
|
||||
+ * This Program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with XBMC; see the file COPYING. If not, write to
|
||||
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ * http://www.gnu.org/copyleft/gpl.html
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include "system.h"
|
||||
+#if (defined USE_EXTERNAL_PYTHON)
|
||||
+#if (defined HAVE_LIBPYTHON2_6)
|
||||
+#include <python2.6/Python.h>
|
||||
+#elif (defined HAVE_LIBPYTHON2_5)
|
||||
+#include <python2.5/Python.h>
|
||||
+#elif (defined HAVE_LIBPYTHON2_4)
|
||||
+#include <python2.4/Python.h>
|
||||
+#else
|
||||
+#error "Could not determine version of Python to use."
|
||||
+#endif
|
||||
+#else
|
||||
+#include "python/Include/Python.h"
|
||||
+#endif
|
||||
+#include "../XBPythonDll.h"
|
||||
+
|
||||
+#include "FileSystem/File.h"
|
||||
+#include "pyutil.h"
|
||||
+
|
||||
+using namespace std;
|
||||
+using namespace XFILE;
|
||||
+using namespace PYXBMC;
|
||||
+
|
||||
+#ifndef __GNUC__
|
||||
+#pragma code_seg("PY_TEXT")
|
||||
+#pragma data_seg("PY_DATA")
|
||||
+#pragma bss_seg("PY_BSS")
|
||||
+#pragma const_seg("PY_RDATA")
|
||||
+#endif
|
||||
+
|
||||
+#if defined(__GNUG__) && (__GNUC__>4) || (__GNUC__==4 && __GNUC_MINOR__>=2)
|
||||
+#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
+#endif
|
||||
+
|
||||
+#ifdef __cplusplus
|
||||
+extern "C" {
|
||||
+#endif
|
||||
+
|
||||
+ namespace xbmcvfs
|
||||
+ {
|
||||
+ /*****************************************************************
|
||||
+ * start of xbmcvfs methods
|
||||
+ *****************************************************************/
|
||||
+ typedef struct {
|
||||
+ PyObject_HEAD
|
||||
+ CFile* pFile;
|
||||
+ } File;
|
||||
+
|
||||
+ // copy() method
|
||||
+ PyDoc_STRVAR(copy__doc__,
|
||||
+ "copy(source, destination) -- copy file to destination, returns true/false.\n"
|
||||
+ "\n"
|
||||
+ "source : file to copy.\n"
|
||||
+ "destination : destination file"
|
||||
+ "\n"
|
||||
+ "example:\n"
|
||||
+ " success = xbmcvfs.copy(source, destination)\n");
|
||||
+
|
||||
+ PyObject* vfs_copy(PyObject *self, PyObject *args)
|
||||
+ {
|
||||
+ PyObject *f_line;
|
||||
+ PyObject *d_line;
|
||||
+ if (!PyArg_ParseTuple(
|
||||
+ args,
|
||||
+ (char*)"OO",
|
||||
+ &f_line,
|
||||
+ &d_line))
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ CStdString strSource;
|
||||
+ CStdString strDestnation;
|
||||
+ bool bResult = true;
|
||||
+
|
||||
+ if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) return NULL;
|
||||
+ if (!PyXBMCGetUnicodeString(strDestnation, d_line, 1)) return NULL;
|
||||
+ Py_BEGIN_ALLOW_THREADS
|
||||
+ bResult = CFile::Cache(strSource, strDestnation);
|
||||
+ Py_END_ALLOW_THREADS
|
||||
+
|
||||
+ return Py_BuildValue((char*)"b", bResult);
|
||||
+ }
|
||||
+ PyDoc_STRVAR(delete__doc__,
|
||||
+ "delete(file)\n"
|
||||
+ "\n"
|
||||
+ "file : file to delete"
|
||||
+ "\n"
|
||||
+ "example:\n"
|
||||
+ " xbmcvfs.delete(file)\n");
|
||||
+
|
||||
+ // delete a file
|
||||
+ PyObject* vfs_delete(File *self, PyObject *args, PyObject *kwds)
|
||||
+ {
|
||||
+ PyObject *f_line;
|
||||
+ if (!PyArg_ParseTuple(
|
||||
+ args,
|
||||
+ (char*)"O",
|
||||
+ &f_line))
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ CStdString strSource;
|
||||
+ if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) return NULL;
|
||||
+
|
||||
+ Py_BEGIN_ALLOW_THREADS
|
||||
+ self->pFile->Delete(strSource);
|
||||
+ Py_END_ALLOW_THREADS
|
||||
+
|
||||
+ Py_INCREF(Py_None);
|
||||
+ return Py_None;
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ PyDoc_STRVAR(rename__doc__,
|
||||
+ "rename(file, newFileName)\n"
|
||||
+ "\n"
|
||||
+ "file : file to reaname"
|
||||
+ "newFileName : new filename, including the full path"
|
||||
+ "\n"
|
||||
+ "example:\n"
|
||||
+ " success = xbmcvfs.rename(file,newFileName)\n");
|
||||
+
|
||||
+ // rename a file
|
||||
+ PyObject* vfs_rename(File *self, PyObject *args, PyObject *kwds)
|
||||
+ {
|
||||
+ PyObject *f_line;
|
||||
+ PyObject *d_line;
|
||||
+ if (!PyArg_ParseTuple(
|
||||
+ args,
|
||||
+ (char*)"OO",
|
||||
+ &f_line,
|
||||
+ &d_line))
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ CStdString strSource;
|
||||
+ CStdString strDestnation;
|
||||
+ if (!PyXBMCGetUnicodeString(strSource, f_line, 1)) return NULL;
|
||||
+ if (!PyXBMCGetUnicodeString(strDestnation, d_line, 1)) return NULL;
|
||||
+
|
||||
+ bool bResult;
|
||||
+ Py_BEGIN_ALLOW_THREADS
|
||||
+ bResult = self->pFile->Rename(strSource,strDestnation);
|
||||
+ Py_END_ALLOW_THREADS
|
||||
+
|
||||
+ return Py_BuildValue((char*)"b", bResult);
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ // define c functions to be used in python here
|
||||
+ PyMethodDef xbmcvfsMethods[] = {
|
||||
+ {(char*)"copy", (PyCFunction)vfs_copy, METH_VARARGS, copy__doc__},
|
||||
+ {(char*)"delete", (PyCFunction)vfs_delete, METH_VARARGS, delete__doc__},
|
||||
+ {(char*)"rename", (PyCFunction)vfs_rename, METH_VARARGS, rename__doc__},
|
||||
+ {NULL, NULL, 0, NULL}
|
||||
+ };
|
||||
+
|
||||
+ /*****************************************************************
|
||||
+ * end of methods and python objects
|
||||
+ * initxbmc(void);
|
||||
+ *****************************************************************/
|
||||
+
|
||||
+
|
||||
+ PyMODINIT_FUNC
|
||||
+ DeinitVFSModule()
|
||||
+ {
|
||||
+ // no need to Py_DECREF our objects (see InitXBMCMVFSModule()) as they were created only
|
||||
+ // so that they could be added to the module, which steals a reference.
|
||||
+ }
|
||||
+
|
||||
+ PyMODINIT_FUNC
|
||||
+ InitVFSModule()
|
||||
+ {
|
||||
+ // init general xbmc modules
|
||||
+ PyObject* pXbmcvfsModule;
|
||||
+ pXbmcvfsModule = Py_InitModule((char*)"xbmcvfs", xbmcvfsMethods);
|
||||
+ if (pXbmcvfsModule == NULL) return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+#ifdef __cplusplus
|
||||
+}
|
||||
+#endif
|
||||
diff -Naur xbmc-Dharma-10.1-c8405db/xbmc/lib/libPython/XBPython.cpp xbmc-Dharma-10.1-c8405db.patch/xbmc/lib/libPython/XBPython.cpp
|
||||
--- xbmc-Dharma-10.1-c8405db/xbmc/lib/libPython/XBPython.cpp 2011-02-15 13:30:09.000000000 +0100
|
||||
+++ xbmc-Dharma-10.1-c8405db.patch/xbmc/lib/libPython/XBPython.cpp 2011-03-03 16:47:38.270032028 +0100
|
||||
@@ -119,6 +119,8 @@
|
||||
void InitAddonModule(void);
|
||||
void InitAddonTypes(void);
|
||||
void DeinitAddonModule(void);
|
||||
+ void InitVFSModule(void);
|
||||
+ void DeinitVFSModule(void);
|
||||
}
|
||||
|
||||
XBPython::XBPython()
|
||||
@@ -297,7 +299,8 @@
|
||||
InitPluginModule(); // init xbmcplugin modules
|
||||
InitGUIModule(); // init xbmcgui modules
|
||||
InitAddonModule(); // init xbmcaddon modules
|
||||
-
|
||||
+ InitVFSModule(); // init xbmcvfs modules
|
||||
+
|
||||
// redirecting default output to debug console
|
||||
if (PyRun_SimpleString(""
|
||||
"import xbmc\n"
|
||||
@@ -325,6 +328,7 @@
|
||||
DeinitPluginModule();
|
||||
DeinitGUIModule();
|
||||
DeinitAddonModule();
|
||||
+ DeinitVFSModule();
|
||||
}
|
||||
|
||||
/**
|
||||
diff -Naur xbmc-Dharma-10.1-c8405db/xbmc/utils/FileUtils.cpp xbmc-Dharma-10.1-c8405db.patch/xbmc/utils/FileUtils.cpp
|
||||
--- xbmc-Dharma-10.1-c8405db/xbmc/utils/FileUtils.cpp 2011-02-15 13:30:05.000000000 +0100
|
||||
+++ xbmc-Dharma-10.1-c8405db.patch/xbmc/utils/FileUtils.cpp 2011-03-03 16:47:38.279031851 +0100
|
||||
@@ -72,3 +72,32 @@
|
||||
}
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+bool CFileUtils::SubtitleFileSizeAndHash(const CStdString &path, CStdString &strSize, CStdString &strHash)
|
||||
+{
|
||||
+ const size_t chksum_block_size = 8192;
|
||||
+
|
||||
+ CFile file;
|
||||
+ size_t i;
|
||||
+ uint64_t hash = 0;
|
||||
+ uint64_t buffer1[chksum_block_size*2];
|
||||
+ uint64_t fileSize ;
|
||||
+ // In natural language it calculates: size + 64k chksum of the first and last 64k
|
||||
+ // (even if they overlap because the file is smaller than 128k).
|
||||
+ file.Open(path, READ_NO_CACHE); //open file
|
||||
+ file.Read(buffer1, chksum_block_size*sizeof(uint64_t)); //read first 64k
|
||||
+ file.Seek(-(int64_t)chksum_block_size*sizeof(uint64_t), SEEK_END); //seek to the end of the file
|
||||
+ file.Read(&buffer1[chksum_block_size], chksum_block_size*sizeof(uint64_t)); //read last 64k
|
||||
+
|
||||
+ for (i=0;i<chksum_block_size*2;i++)
|
||||
+ hash += buffer1[i];
|
||||
+
|
||||
+ fileSize = file.GetLength();
|
||||
+
|
||||
+ hash += fileSize; //add size
|
||||
+
|
||||
+ file.Close(); //close file
|
||||
+ strHash.Format("%"PRIx64"", hash); //format hash
|
||||
+ strSize.Format("%d", fileSize); // format size
|
||||
+ return true;
|
||||
+}
|
||||
diff -Naur xbmc-Dharma-10.1-c8405db/xbmc/utils/FileUtils.h xbmc-Dharma-10.1-c8405db.patch/xbmc/utils/FileUtils.h
|
||||
--- xbmc-Dharma-10.1-c8405db/xbmc/utils/FileUtils.h 2011-02-15 13:30:05.000000000 +0100
|
||||
+++ xbmc-Dharma-10.1-c8405db.patch/xbmc/utils/FileUtils.h 2011-03-03 16:47:38.279031851 +0100
|
||||
@@ -6,4 +6,5 @@
|
||||
public:
|
||||
static bool DeleteItem(const CFileItemPtr &item);
|
||||
static bool RenameFile(const CStdString &strFile);
|
||||
+ static bool SubtitleFileSizeAndHash(const CStdString &path, CStdString &strSize, CStdString &strHash);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user