資源簡介
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 測試版
評論
共有 條評論