-rw-r--r-- | core/multimedia/opieplayer/libmad/libmadplugin.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.cpp b/core/multimedia/opieplayer/libmad/libmadplugin.cpp index eda5859..b06cdaa 100644 --- a/core/multimedia/opieplayer/libmad/libmadplugin.cpp +++ b/core/multimedia/opieplayer/libmad/libmadplugin.cpp | |||
@@ -1,102 +1,103 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // largly modified by Maximilian Reiss <max.reiss@gmx.de> | 20 | // largly modified by Maximilian Reiss <max.reiss@gmx.de> |
21 | 21 | ||
22 | #include <stdio.h> | 22 | #include <stdio.h> |
23 | #include <stdarg.h> | 23 | #include <stdarg.h> |
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | #include <sys/types.h> | 25 | #include <sys/types.h> |
26 | #include <sys/stat.h> | 26 | #include <sys/stat.h> |
27 | #include <fcntl.h> | 27 | #include <fcntl.h> |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <string.h> | 29 | #include <string.h> |
30 | #include <ctype.h> | 30 | #include <ctype.h> |
31 | #include <errno.h> | 31 | #include <errno.h> |
32 | #include <time.h> | 32 | #include <time.h> |
33 | #include <locale.h> | 33 | #include <locale.h> |
34 | #include <math.h> | 34 | #include <math.h> |
35 | #include <assert.h> | 35 | #include <assert.h> |
36 | 36 | ||
37 | #include <qapplication.h> | 37 | #include <qapplication.h> |
38 | #include <qmessagebox.h> | 38 | #include <qmessagebox.h> |
39 | #include <qregexp.h> | ||
39 | 40 | ||
40 | #include <qpe/config.h> | 41 | #include <qpe/config.h> |
41 | 42 | ||
42 | // for network handling | 43 | // for network handling |
43 | #include <netinet/in.h> | 44 | #include <netinet/in.h> |
44 | #include <netdb.h> | 45 | #include <netdb.h> |
45 | #include <sys/socket.h> | 46 | #include <sys/socket.h> |
46 | #include <arpa/inet.h> | 47 | #include <arpa/inet.h> |
47 | #include <unistd.h> | 48 | #include <unistd.h> |
48 | 49 | ||
49 | 50 | ||
50 | //#define HAVE_MMAP | 51 | //#define HAVE_MMAP |
51 | 52 | ||
52 | #if defined(HAVE_MMAP) | 53 | #if defined(HAVE_MMAP) |
53 | # include <sys/mman.h> | 54 | # include <sys/mman.h> |
54 | #endif | 55 | #endif |
55 | #include "libmadplugin.h" | 56 | #include "libmadplugin.h" |
56 | 57 | ||
57 | 58 | ||
58 | extern "C" { | 59 | extern "C" { |
59 | #include "mad.h" | 60 | #include "mad.h" |
60 | } | 61 | } |
61 | 62 | ||
62 | 63 | ||
63 | #define MPEG_BUFFER_SIZE 65536 | 64 | #define MPEG_BUFFER_SIZE 65536 |
64 | //#define MPEG_BUFFER_SIZE 32768 //16384 // 8192 | 65 | //#define MPEG_BUFFER_SIZE 32768 //16384 // 8192 |
65 | //#define debugMsg(a) qDebug(a) | 66 | //#define debugMsg(a) qDebug(a) |
66 | #define debugMsg(a) | 67 | #define debugMsg(a) |
67 | 68 | ||
68 | 69 | ||
69 | class Input { | 70 | class Input { |
70 | public: | 71 | public: |
71 | char const *path; | 72 | char const *path; |
72 | int fd; | 73 | int fd; |
73 | #if defined(HAVE_MMAP) | 74 | #if defined(HAVE_MMAP) |
74 | void *fdm; | 75 | void *fdm; |
75 | #endif | 76 | #endif |
76 | unsigned char *data; | 77 | unsigned char *data; |
77 | unsigned long length; | 78 | unsigned long length; |
78 | int eof; | 79 | int eof; |
79 | }; | 80 | }; |
80 | 81 | ||
81 | 82 | ||
82 | class Output { | 83 | class Output { |
83 | public: | 84 | public: |
84 | mad_fixed_t attenuate; | 85 | mad_fixed_t attenuate; |
85 | struct filter *filters; | 86 | struct filter *filters; |
86 | unsigned int channels_in; | 87 | unsigned int channels_in; |
87 | unsigned int channels_out; | 88 | unsigned int channels_out; |
88 | unsigned int speed_in; | 89 | unsigned int speed_in; |
89 | unsigned int speed_out; | 90 | unsigned int speed_out; |
90 | const char *path; | 91 | const char *path; |
91 | }; | 92 | }; |
92 | 93 | ||
93 | 94 | ||
94 | # if defined(HAVE_MMAP) | 95 | # if defined(HAVE_MMAP) |
95 | static void *map_file(int fd, unsigned long *length) | 96 | static void *map_file(int fd, unsigned long *length) |
96 | { | 97 | { |
97 | void *fdm; | 98 | void *fdm; |
98 | 99 | ||
99 | *length += MAD_BUFFER_GUARD; | 100 | *length += MAD_BUFFER_GUARD; |
100 | 101 | ||
101 | fdm = mmap(0, *length, PROT_READ, MAP_SHARED, fd, 0); | 102 | fdm = mmap(0, *length, PROT_READ, MAP_SHARED, fd, 0); |
102 | if (fdm == MAP_FAILED) | 103 | if (fdm == MAP_FAILED) |