aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Cabral <brataoufba@gmail.com>2013-12-20 23:49:40 +0000
committerBruno Cabral <brataoufba@gmail.com>2013-12-20 23:49:40 +0000
commit26f7618e82c6d758404251c5f175e0e910d4e47f (patch)
tree03b967620092ce3d169415b85a63e424f472e0be
parent6f907615d5c6a2f7e12a3717dd901d1b6368370a (diff)
downloadlibextractor-26f7618e82c6d758404251c5f175e0e910d4e47f.tar.gz
libextractor-26f7618e82c6d758404251c5f175e0e910d4e47f.zip
Remove unused libmagic and add as Author.
-rw-r--r--AUTHORS2
-rw-r--r--src/plugins/previewopus_extractor.c28
2 files changed, 10 insertions, 20 deletions
diff --git a/AUTHORS b/AUTHORS
index 5bf0220..3071673 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -5,6 +5,7 @@ LRN <lrn1986@gmail.com>
5Developers: 5Developers:
6Andreas Huggel <ahuggel@gmx.net> 6Andreas Huggel <ahuggel@gmx.net>
7Blake Matheny <bmatheny@mobocracy.net> 7Blake Matheny <bmatheny@mobocracy.net>
8Bruno Cabral <bcabral@uw.edu>
8Bruno Haible <bruno@clisp.org> 9Bruno Haible <bruno@clisp.org>
9Christopher Adam Telfer 10Christopher Adam Telfer
10Filip Pizlo <pizlo@purdue.edu> 11Filip Pizlo <pizlo@purdue.edu>
@@ -56,6 +57,7 @@ odf - Christian Grothoff
56ole2 - Christian Grothoff 57ole2 - Christian Grothoff
57ogg - Christian Grothoff 58ogg - Christian Grothoff
58png - Christian Grothoff 59png - Christian Grothoff
60previewopus - Bruno Cabral
59ps - Christian Grothoff 61ps - Christian Grothoff
60riff - Christian Grothoff 62riff - Christian Grothoff
61rpm - Christian Grothoff 63rpm - 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 */
112static magic_t magic;
113
114static unsigned char *buffer; 110static unsigned char *buffer;
111
112/** Actual output buffer size */
115static int totalSize; 113static 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 */
1168void __attribute__ ((constructor)) 1164void __attribute__ ((constructor))
1169previewopus_lib_init (void) 1165previewopus_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)
1184void __attribute__ ((destructor)) 1176void __attribute__ ((destructor))
1185previewopus_ltdl_fini () 1177previewopus_ltdl_fini ()
1186{ 1178{
1187 if (NULL != magic) 1179
1188 {
1189 magic_close (magic);
1190 magic = NULL;
1191 }
1192} 1180}
1193 1181
1194 1182