资源简介
MPlayer是一款开源多媒体播放器,以GNU通用公共许可证发布。此款软件可在各主流作业系统使用,例如Linux和其他类Unix系统、Windows及Mac OS X系统。
本代码经过测试可以编译通过。
代码片段和文件信息
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not write to the Free Software Foundation Inc.
* 51 Franklin Street Fifth Floor Boston MA 02110-1301 USA.
*/
#include “config.h“
#include
#include
#include
#include
#include
#include “playtree.h“
#include “playtreeparser.h“
#include “stream/stream.h“
#include “libmpdemux/demuxer.h“
#include “asxparser.h“
#include “mp_msg.h“
#include “m_config.h“
#include “mpcommon.h“
////// List utils
void
asx_list_free(void* list_ptrASX_FreeFunc free_func) {
void** ptr = *(void***)list_ptr;
if(ptr == NULL) return;
if(free_func != NULL) {
for( ; *ptr != NULL ; ptr++)
free_func(*ptr);
}
free(*(void**)list_ptr);
*(void**)list_ptr = NULL;
}
/////// Attribs utils
char*
asx_get_attrib(const char* attribchar** attribs) {
char** ptr;
if(attrib == NULL || attribs == NULL) return NULL;
for(ptr = attribs; ptr[0] != NULL; ptr += 2){
if(strcasecmp(ptr[0]attrib) == 0)
return strdup(ptr[1]);
}
return NULL;
}
int
asx_attrib_to_enum(const char* valchar** valid_vals) {
char** ptr;
int r = 0;
if(valid_vals == NULL || val == NULL) return -2;
for(ptr = valid_vals ; ptr[0] != NULL ; ptr++) {
if(strcasecmp(valptr[0]) == 0) return r;
r++;
}
return -1;
}
#define asx_warning_attrib_required(pea) mp_msg(MSGT_PLAYTREEMSGL_WARN“At line %d : element %s don‘t have the required attribute %s“p->lineea)
#define asx_warning_body_parse_error(pe) mp_msg(MSGT_PLAYTREEMSGL_WARN“At line %d : error while parsing %s body“p->linee)
ASX_Parser_t*
asx_parser_new(void) {
ASX_Parser_t* parser = calloc(1sizeof(ASX_Parser_t));
return parser;
}
void
asx_parser_free(ASX_Parser_t* parser) {
if(!parser) return;
free(parser->ret_stack);
free(parser);
}
#define LETTER “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ“
#define SPACE “ \n\t\r“
int
asx_parse_attribs(ASX_Parser_t* parserchar* bufferchar*** _attribs) {
char *ptr1 *ptr2 *ptr3;
int n_attrib = 0;
char **attribs = NULL;
char *attrib *val;
ptr1 = buffer;
while(1) {
for( ; strchr(SPACE*ptr1) != NULL; ptr1++) { // Skip space
if(*ptr1 == ‘\0‘) break;
}
ptr3 = strchr(ptr1‘=‘);
if(ptr3 == NULL) break;
for(ptr2 = ptr3-1; strc
- 上一篇:des源码
- 下一篇:VideoEye 0.2 测试版
相关资源
- bp神经网络源代码,可直接运行
- 仿知乎界面小程序源代码
- 贪吃蛇源代码.fla
- dotnet 写字板 实验 源代码 不好请要不
- 图像二维小波变换的实现源代码
- 八三编码器设计 VHDL代码 简单,包附
- linux应用层的华容道游戏源代码
- 网上拍卖系统完整源代码
- CSMA/CD等动画演示加源代码
- silicon lab公司的收音IC SI47XX全套开发工
- 合同管理系统的源代码(附数据库)
- 用VC 编写的仿QQ聊天室程序源代码
- STM32F103 串口程序(完整版)
- VPC3_DPV1源代码,Profibus
- PB做的托盘程序(最小化后在左下角显
- 透明加密源码及说明
- 排队机叫号 源代码
- 五子棋C 源代码
- CAD LISP24个源代码
- 二叉树基本操作源代码
- 推箱子及人工智能寻路C 源代码
- opengl轮廓字体源代码
- 冈萨雷斯 数字图像处理 源代码(m文
- 直流伺服电机电路原理图(内附单片
- 哈哈冒险岛登入器源代码
- midi电子琴简单设计(附源代码).ra
- PESQ C源代码
- 画图程序MFC/VC/VC CRectTracker 串行化
- 莱卡 全站仪数据格式转换程序,有源
- HEX到Bin文件源代码
评论
共有 条评论