diff options
author | Bruno Cabral <brataoufba@gmail.com> | 2013-12-20 23:49:40 +0000 |
---|---|---|
committer | Bruno Cabral <brataoufba@gmail.com> | 2013-12-20 23:49:40 +0000 |
commit | 26f7618e82c6d758404251c5f175e0e910d4e47f (patch) | |
tree | 03b967620092ce3d169415b85a63e424f472e0be | |
parent | 6f907615d5c6a2f7e12a3717dd901d1b6368370a (diff) | |
download | libextractor-26f7618e82c6d758404251c5f175e0e910d4e47f.tar.gz libextractor-26f7618e82c6d758404251c5f175e0e910d4e47f.zip |
Remove unused libmagic and add as Author.
-rw-r--r-- | AUTHORS | 2 | ||||
-rw-r--r-- | src/plugins/previewopus_extractor.c | 28 |
2 files changed, 10 insertions, 20 deletions
@@ -5,6 +5,7 @@ LRN <lrn1986@gmail.com> | |||
5 | Developers: | 5 | Developers: |
6 | Andreas Huggel <ahuggel@gmx.net> | 6 | Andreas Huggel <ahuggel@gmx.net> |
7 | Blake Matheny <bmatheny@mobocracy.net> | 7 | Blake Matheny <bmatheny@mobocracy.net> |
8 | Bruno Cabral <bcabral@uw.edu> | ||
8 | Bruno Haible <bruno@clisp.org> | 9 | Bruno Haible <bruno@clisp.org> |
9 | Christopher Adam Telfer | 10 | Christopher Adam Telfer |
10 | Filip Pizlo <pizlo@purdue.edu> | 11 | Filip Pizlo <pizlo@purdue.edu> |
@@ -56,6 +57,7 @@ odf - Christian Grothoff | |||
56 | ole2 - Christian Grothoff | 57 | ole2 - Christian Grothoff |
57 | ogg - Christian Grothoff | 58 | ogg - Christian Grothoff |
58 | png - Christian Grothoff | 59 | png - Christian Grothoff |
60 | previewopus - Bruno Cabral | ||
59 | ps - Christian Grothoff | 61 | ps - Christian Grothoff |
60 | riff - Christian Grothoff | 62 | riff - Christian Grothoff |
61 | rpm - Christian Grothoff | 63 | rpm - Christian Grothoff |
diff --git a/src/plugins/previewopus_extractor.c b/src/plugins/previewopus_extractor.c index 1f4c874..1387044 100644 --- a/src/plugins/previewopus_extractor.c +++ b/src/plugins/previewopus_extractor.c | |||
@@ -106,12 +106,10 @@ | |||
106 | #define OUTPUT_SAMPLE_FORMAT AV_SAMPLE_FMT_S16 | 106 | #define OUTPUT_SAMPLE_FORMAT AV_SAMPLE_FMT_S16 |
107 | 107 | ||
108 | 108 | ||
109 | /** | 109 | /** Our output buffer*/ |
110 | * Global handle to MAGIC data. | ||
111 | */ | ||
112 | static magic_t magic; | ||
113 | |||
114 | static unsigned char *buffer; | 110 | static unsigned char *buffer; |
111 | |||
112 | /** Actual output buffer size */ | ||
115 | static int totalSize; | 113 | static int totalSize; |
116 | 114 | ||
117 | /** | 115 | /** |
@@ -987,7 +985,6 @@ extract_audio (struct EXTRACTOR_ExtractContext *ec) | |||
987 | frame_finished = 0; | 985 | frame_finished = 0; |
988 | 986 | ||
989 | 987 | ||
990 | |||
991 | /** | 988 | /** |
992 | * Loop as long as we have input samples to read or output samples | 989 | * Loop as long as we have input samples to read or output samples |
993 | * to write; abort as soon as we have neither. | 990 | * to write; abort as soon as we have neither. |
@@ -1126,14 +1123,13 @@ EXTRACTOR_previewopus_extract_method (struct EXTRACTOR_ExtractContext *ec) | |||
1126 | unsigned int i; | 1123 | unsigned int i; |
1127 | ssize_t iret; | 1124 | ssize_t iret; |
1128 | void *data; | 1125 | void *data; |
1129 | const char *mime; | 1126 | |
1130 | 1127 | ||
1131 | if (-1 == (iret = ec->read (ec->cls, | 1128 | if (-1 == (iret = ec->read (ec->cls, |
1132 | &data, | 1129 | &data, |
1133 | 16 * 1024))) | 1130 | 16 * 1024))) |
1134 | return; | 1131 | return; |
1135 | if (NULL == (mime = magic_buffer (magic, data, iret))) | 1132 | |
1136 | return; | ||
1137 | if (0 != ec->seek (ec->cls, 0, SEEK_SET)) | 1133 | if (0 != ec->seek (ec->cls, 0, SEEK_SET)) |
1138 | return; | 1134 | return; |
1139 | 1135 | ||
@@ -1163,18 +1159,14 @@ previewopus_av_log_callback (void* ptr, | |||
1163 | 1159 | ||
1164 | 1160 | ||
1165 | /** | 1161 | /** |
1166 | * Initialize av-libs and load magic file. | 1162 | * Initialize av-libs |
1167 | */ | 1163 | */ |
1168 | void __attribute__ ((constructor)) | 1164 | void __attribute__ ((constructor)) |
1169 | previewopus_lib_init (void) | 1165 | previewopus_lib_init (void) |
1170 | { | 1166 | { |
1171 | av_log_set_callback (&previewopus_av_log_callback); | 1167 | av_log_set_callback (&previewopus_av_log_callback); |
1172 | av_register_all (); | 1168 | av_register_all (); |
1173 | magic = magic_open (MAGIC_MIME_TYPE); | 1169 | |
1174 | if (0 != magic_load (magic, NULL)) | ||
1175 | { | ||
1176 | /* FIXME: how to deal with errors? */ | ||
1177 | } | ||
1178 | } | 1170 | } |
1179 | 1171 | ||
1180 | 1172 | ||
@@ -1184,11 +1176,7 @@ previewopus_lib_init (void) | |||
1184 | void __attribute__ ((destructor)) | 1176 | void __attribute__ ((destructor)) |
1185 | previewopus_ltdl_fini () | 1177 | previewopus_ltdl_fini () |
1186 | { | 1178 | { |
1187 | if (NULL != magic) | 1179 | |
1188 | { | ||
1189 | magic_close (magic); | ||
1190 | magic = NULL; | ||
1191 | } | ||
1192 | } | 1180 | } |
1193 | 1181 | ||
1194 | 1182 | ||