asademux.c
资源名称:vlc-1.0.5.zip [点击查看]
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:14k
源码类别:
midi
开发平台:
Unix_Linux
- /*****************************************************************************
- * asademux.c: asa demuxer VM
- *****************************************************************************
- * Copyright (C) 2007 the VideoLAN team
- *
- * Originated from asa: portable digital subtitle renderer
- *
- * Authors: David Lamparter <equinox at diac24 dot net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- ****************************************************************************/
- /****************************************************************************
- * Changes from asa version:
- * - headers adapted
- * - external definition file support dropped
- * - integer timestamps
- ****************************************************************************
- * Please retain Linux kernel CodingStyle for sync.
- * base commit d8c269b0fae9a8f8904e16e92313da165d664c74
- ****************************************************************************/
- #include "config.h"
- #include <vlc_common.h>
- #include <vlc_input.h>
- #include <vlc_demux.h>
- #include <limits.h>
- #include <string.h>
- #include "asademux.h"
- #define MAXDELTA 4 /**< nr of times kept for delta backref */
- #define MAXGROUP 24 /**< maximum number of regex match groups */
- #define xmalloc malloc
- #define xrealloc realloc
- #define xfree free
- #define xstrdup strdup
- /** state of a running import */
- struct asa_import_state {
- demux_t *demux; /**< demuxer for msg* funcs */
- const char *line; /**< beginning of current line */
- size_t remain; /**< remaining data at line */
- char **matches; /**< active matchgroups */
- unsigned nmatches; /**< number of matchgroups */
- char *selstr; /**< buffer for currently selected */
- size_t sellen; /**< strlen of selstr */
- char *out; /**< output buffer (NULL if empty) */
- size_t outlen; /**< length of output string w/o