diff options
Diffstat (limited to 'src/demuxers/demux_fli.c')
-rw-r--r-- | src/demuxers/demux_fli.c | 83 |
1 files changed, 21 insertions, 62 deletions
diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c index c9cc26cf1..0dad5883a 100644 --- a/src/demuxers/demux_fli.c +++ b/src/demuxers/demux_fli.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA */ /* @@ -23,8 +23,6 @@ * For information on the FLI format, as well as various traps to * avoid while programming a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ - * - * $Id: demux_fli.c,v 1.60 2007/01/19 00:26:40 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H @@ -37,10 +35,10 @@ #include <string.h> #include <stdlib.h> -#include "xine_internal.h" -#include "xineutils.h" -#include "compat.h" -#include "demux.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/compat.h> +#include <xine/demux.h> #include "bswap.h" #define FLI_HEADER_SIZE 128 @@ -86,7 +84,7 @@ static int open_fli_file(demux_fli_t *this) { return 0; /* validate the file */ - this->magic_number = LE_16(&this->fli_header[4]); + this->magic_number = _X_LE_16(&this->fli_header[4]); if ((this->magic_number != FLI_FILE_MAGIC_1) && (this->magic_number != FLI_FILE_MAGIC_2)) return 0; @@ -95,7 +93,7 @@ static int open_fli_file(demux_fli_t *this) { this->input->seek(this->input, FLI_HEADER_SIZE, SEEK_SET); /* check if this is a special FLI file from Magic Carpet game */ - if (LE_16(&this->fli_header[16]) == FLI_CHUNK_MAGIC_1) { + if (_X_LE_16(&this->fli_header[16]) == FLI_CHUNK_MAGIC_1) { /* if the input is non-seekable, do not bother with playing the * special file type */ if (INPUT_IS_SEEKABLE(this->input)) { @@ -108,11 +106,11 @@ static int open_fli_file(demux_fli_t *this) { this->magic_number = FLI_FILE_MAGIC_3; } - this->frame_count = LE_16(&this->fli_header[6]); - this->bih.biWidth = LE_16(&this->fli_header[8]); - this->bih.biHeight = LE_16(&this->fli_header[10]); + this->frame_count = _X_LE_16(&this->fli_header[6]); + this->bih.biWidth = _X_LE_16(&this->fli_header[8]); + this->bih.biHeight = _X_LE_16(&this->fli_header[10]); - this->speed = LE_32(&this->fli_header[16]); + this->speed = _X_LE_32(&this->fli_header[16]); if (this->magic_number == FLI_FILE_MAGIC_1) { /* * in this case, the speed (n) is number of 1/70s ticks between frames: @@ -169,8 +167,8 @@ static int demux_fli_send_chunk(demux_plugin_t *this_gen) { this->status = DEMUX_FINISHED; return this->status; } - chunk_size = LE_32(&fli_buf[0]); - chunk_magic = LE_16(&fli_buf[4]); + chunk_size = _X_LE_32(&fli_buf[0]); + chunk_magic = _X_LE_16(&fli_buf[4]); if ((chunk_magic == FLI_CHUNK_MAGIC_1) || (chunk_magic == FLI_CHUNK_MAGIC_2)) { @@ -268,11 +266,6 @@ static int demux_fli_seek (demux_plugin_t *this_gen, off_t start_pos, int start_ return this->status; } -static void demux_fli_dispose (demux_plugin_t *this) { - - free(this); -} - static int demux_fli_get_status (demux_plugin_t *this_gen) { demux_fli_t *this = (demux_fli_t *) this_gen; @@ -312,7 +305,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str this->demux_plugin.send_headers = demux_fli_send_headers; this->demux_plugin.send_chunk = demux_fli_send_chunk; this->demux_plugin.seek = demux_fli_seek; - this->demux_plugin.dispose = demux_fli_dispose; + this->demux_plugin.dispose = default_demux_plugin_dispose; this->demux_plugin.get_status = demux_fli_get_status; this->demux_plugin.get_stream_length = demux_fli_get_stream_length; this->demux_plugin.get_capabilities = demux_fli_get_capabilities; @@ -323,19 +316,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str switch (stream->content_detection_method) { - case METHOD_BY_EXTENSION: { - const char *extensions, *mrl; - - mrl = input->get_mrl (input); - extensions = class_gen->get_extensions (class_gen); - - if (!_x_demux_check_extension (mrl, extensions)) { - free (this); - return NULL; - } - } - /* falling through is intended */ - + case METHOD_BY_MRL: case METHOD_BY_CONTENT: case METHOD_EXPLICIT: @@ -354,39 +335,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return &this->demux_plugin; } -static const char *get_description (demux_class_t *this_gen) { - return "Autodesk Animator FLI/FLC demux plugin"; -} - -static const char *get_identifier (demux_class_t *this_gen) { - return "FLI/FLC"; -} - -static const char *get_extensions (demux_class_t *this_gen) { - return "fli flc"; -} - -static const char *get_mimetypes (demux_class_t *this_gen) { - return "video/x-flic: fli,flc: Autodesk FLIC files;"; -} - -static void class_dispose (demux_class_t *this_gen) { - demux_fli_class_t *this = (demux_fli_class_t *) this_gen; - - free (this); -} - static void *init_plugin (xine_t *xine, void *data) { demux_fli_class_t *this; this = xine_xmalloc (sizeof (demux_fli_class_t)); this->demux_class.open_plugin = open_plugin; - this->demux_class.get_description = get_description; - this->demux_class.get_identifier = get_identifier; - this->demux_class.get_mimetypes = get_mimetypes; - this->demux_class.get_extensions = get_extensions; - this->demux_class.dispose = class_dispose; + this->demux_class.description = N_("Autodesk Animator FLI/FLC demux plugin"); + this->demux_class.identifier = "FLI/FLC"; + this->demux_class.mimetypes = "video/x-flic: fli,flc: Autodesk FLIC files;"; + this->demux_class.extensions = "fli flc"; + this->demux_class.dispose = default_demux_class_dispose; return this; } @@ -400,6 +359,6 @@ static const demuxer_info_t demux_info_fli = { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 26, "fli", XINE_VERSION_CODE, &demux_info_fli, init_plugin }, + { PLUGIN_DEMUX, 27, "fli", XINE_VERSION_CODE, &demux_info_fli, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; |