diff options
author | geronimo <geronimo013@gmx.de> | 2012-07-27 07:18:23 +0200 |
---|---|---|
committer | geronimo <geronimo013@gmx.de> | 2012-07-27 07:18:23 +0200 |
commit | d2769982da50332c9354344e2e196f581f7d888b (patch) | |
tree | 3986f5c953af85dafebc27fbcb1f6af28cfda49f /libs/fsScan | |
parent | 37dc743591dee0e4326d0100a41f725d4704faf3 (diff) | |
download | cmp-d2769982da50332c9354344e2e196f581f7d888b.tar.gz cmp-d2769982da50332c9354344e2e196f581f7d888b.tar.bz2 |
remove yajl dependency, handle connection abort if client closes connection during play
Diffstat (limited to 'libs/fsScan')
-rw-r--r-- | libs/fsScan/fsScan.layout | 48 | ||||
-rw-r--r-- | libs/fsScan/fsScan.layout.save | 48 | ||||
-rw-r--r-- | libs/fsScan/include/AbstractMedia.h | 1 | ||||
-rw-r--r-- | libs/fsScan/include/AbstractMultiFileMovie.h | 1 | ||||
-rw-r--r-- | libs/fsScan/src/AbstractMedia.cc | 8 | ||||
-rw-r--r-- | libs/fsScan/src/AbstractMultiFileMovie.cc | 6 |
6 files changed, 64 insertions, 48 deletions
diff --git a/libs/fsScan/fsScan.layout b/libs/fsScan/fsScan.layout index 846388e..8fcde57 100644 --- a/libs/fsScan/fsScan.layout +++ b/libs/fsScan/fsScan.layout @@ -1,64 +1,64 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_layout_file> <ActiveTarget name="Debug" /> - <File name="include/File.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="include/FileRepresentation.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1782" topLine="0" /> + <Cursor1 position="1593" topLine="0" /> </Cursor> </File> - <File name="src/File.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="include/MediaFactory.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="3161" topLine="54" /> + <Cursor1 position="1119" topLine="0" /> </Cursor> </File> - <File name="src/FilesystemScanner.cc" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/LegacyVdrRecording.cc" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="2803" topLine="0" /> + <Cursor1 position="1450" topLine="0" /> </Cursor> </File> - <File name="src/FileRepresentation.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/AbstractMedia.cc" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1911" topLine="9" /> + <Cursor1 position="1453" topLine="0" /> </Cursor> </File> - <File name="include/FileSystem.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/FileSystem.cc" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1438" topLine="0" /> + <Cursor1 position="1476" topLine="9" /> </Cursor> </File> - <File name="src/FileSystem.cc" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="include/File.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1476" topLine="9" /> + <Cursor1 position="1782" topLine="0" /> </Cursor> </File> - <File name="src/AbstractMedia.cc" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="include/FileSystem.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1453" topLine="0" /> + <Cursor1 position="1438" topLine="0" /> </Cursor> </File> - <File name="src/LegacyVdrRecording.cc" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/VdrRecording.cc" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1450" topLine="0" /> + <Cursor1 position="1404" topLine="0" /> </Cursor> </File> - <File name="include/FileRepresentation.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/FileRepresentation.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1593" topLine="0" /> + <Cursor1 position="1911" topLine="9" /> </Cursor> </File> - <File name="src/MediaFactory.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/MediaFactory.cc" open="1" top="1" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="0" topLine="0" /> + <Cursor1 position="1709" topLine="9" /> </Cursor> </File> - <File name="include/MediaFactory.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/File.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1119" topLine="0" /> + <Cursor1 position="3161" topLine="54" /> </Cursor> </File> - <File name="src/VdrRecording.cc" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/FilesystemScanner.cc" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1404" topLine="0" /> + <Cursor1 position="2177" topLine="0" /> </Cursor> </File> </CodeBlocks_layout_file> diff --git a/libs/fsScan/fsScan.layout.save b/libs/fsScan/fsScan.layout.save index 846388e..70e2a8e 100644 --- a/libs/fsScan/fsScan.layout.save +++ b/libs/fsScan/fsScan.layout.save @@ -1,64 +1,64 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_layout_file> <ActiveTarget name="Debug" /> - <File name="include/File.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="include/FileRepresentation.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1782" topLine="0" /> + <Cursor1 position="1593" topLine="0" /> </Cursor> </File> - <File name="src/File.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/FileSystem.cc" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="3161" topLine="54" /> + <Cursor1 position="1476" topLine="9" /> </Cursor> </File> - <File name="src/FilesystemScanner.cc" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/LegacyVdrRecording.cc" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="2803" topLine="0" /> + <Cursor1 position="1450" topLine="0" /> </Cursor> </File> - <File name="src/FileRepresentation.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="include/FileSystem.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1911" topLine="9" /> + <Cursor1 position="1438" topLine="0" /> </Cursor> </File> - <File name="include/FileSystem.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="include/MediaFactory.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1438" topLine="0" /> + <Cursor1 position="1119" topLine="0" /> </Cursor> </File> - <File name="src/FileSystem.cc" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/MediaFactory.cc" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1476" topLine="9" /> + <Cursor1 position="1709" topLine="9" /> </Cursor> </File> - <File name="src/AbstractMedia.cc" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/File.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1453" topLine="0" /> + <Cursor1 position="3161" topLine="54" /> </Cursor> </File> - <File name="src/LegacyVdrRecording.cc" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/FileRepresentation.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1450" topLine="0" /> + <Cursor1 position="1911" topLine="9" /> </Cursor> </File> - <File name="include/FileRepresentation.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/VdrRecording.cc" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1593" topLine="0" /> + <Cursor1 position="1404" topLine="0" /> </Cursor> </File> - <File name="src/MediaFactory.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/AbstractMedia.cc" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="0" topLine="0" /> + <Cursor1 position="1453" topLine="0" /> </Cursor> </File> - <File name="include/MediaFactory.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="include/File.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1119" topLine="0" /> + <Cursor1 position="1782" topLine="0" /> </Cursor> </File> - <File name="src/VdrRecording.cc" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="src/FilesystemScanner.cc" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="1404" topLine="0" /> + <Cursor1 position="2177" topLine="0" /> </Cursor> </File> </CodeBlocks_layout_file> diff --git a/libs/fsScan/include/AbstractMedia.h b/libs/fsScan/include/AbstractMedia.h index 573265b..750ffde 100644 --- a/libs/fsScan/include/AbstractMedia.h +++ b/libs/fsScan/include/AbstractMedia.h @@ -63,6 +63,7 @@ public: ///< determine the real size, number of files, etc. virtual size_t ReadChunk(char *buf, size_t bufSize); ///< used to hide the differences between single- and multi-file media. + virtual void Reset(void); static const char *MediaType2Text(int Type); protected: diff --git a/libs/fsScan/include/AbstractMultiFileMovie.h b/libs/fsScan/include/AbstractMultiFileMovie.h index f05826b..aed75b9 100644 --- a/libs/fsScan/include/AbstractMultiFileMovie.h +++ b/libs/fsScan/include/AbstractMultiFileMovie.h @@ -39,6 +39,7 @@ public: protected: cAbstractMultiFileMovie(const cFile &File, const char *Mime, SupportedMediaType Type); + virtual void Reset(void); void SetName(char *Name); void SetSize(size_t Size); bool checkBuffer(void); diff --git a/libs/fsScan/src/AbstractMedia.cc b/libs/fsScan/src/AbstractMedia.cc index 1a7c1da..27ad751 100644 --- a/libs/fsScan/src/AbstractMedia.cc +++ b/libs/fsScan/src/AbstractMedia.cc @@ -86,6 +86,14 @@ size_t cAbstractMedia::ReadChunk(char* Buf, size_t bufSize) return rv; } +void cAbstractMedia::Reset(void) +{ + if (fd >= 0) { + close(fd); + fd = -1; + } +} + size_t cAbstractMedia::Size(void) const { return keyPath.Size(); diff --git a/libs/fsScan/src/AbstractMultiFileMovie.cc b/libs/fsScan/src/AbstractMultiFileMovie.cc index a5de060..d20da87 100644 --- a/libs/fsScan/src/AbstractMultiFileMovie.cc +++ b/libs/fsScan/src/AbstractMultiFileMovie.cc @@ -90,6 +90,12 @@ size_t cAbstractMultiFileMovie::ReadChunk(char* Buf, size_t bufSize) return rv; } +void cAbstractMultiFileMovie::Reset() +{ + cMovie::Reset(); + curFileNo = 0; +} + void cAbstractMultiFileMovie::SetName(char* Name) ///< Name must have already been allocated from heap! { |