Esempio n. 1
0
static void
asx_parse_ref(ASX_Parser_t* parser, char** attribs) {
    char *href;

    href = asx_get_attrib("HREF",attribs);
    if(href == NULL) {
        asx_warning_attrib_required(parser,"REF" ,"HREF" );
        return;
    }
#if 0
    // replace http my mmshttp to avoid infinite loops
    // disabled since some playlists for e.g. WinAMP use asx as well
    // "-user-agent NSPlayer/4.1.0.3856" is a possible workaround
    if (strncmp(href, "http://", 7) == 0) {
        char *newref = malloc(3 + strlen(href) + 1);
        strcpy(newref, "mms");
        strcpy(newref + 3, href);
        free(href);
        href = newref;
    }
#endif

    playlist_add_file(parser->pl, href);

    mp_msg(MSGT_PLAYTREE,MSGL_V,"Adding file %s to element entry\n",href);

    free(href);

}
Esempio n. 2
0
static void
asx_parse_ref(ASX_Parser_t* parser, char** attribs, play_tree_t* pt) {
  char *href;

  href = asx_get_attrib("HREF",attribs);
  if(href == NULL) {
    asx_warning_attrib_required(parser,"REF" ,"HREF" );
    return;
  }

  play_tree_add_file(pt,href);

  mp_msg(MSGT_PLAYTREE,MSGL_V,"Adding file %s to element entry\n",href);

  free(href);

}
Esempio n. 3
0
static void
asx_parse_param(ASX_Parser_t* parser, char** attribs, play_tree_t* pt) {
  char *name,*val;
  
  name = asx_get_attrib("NAME",attribs);
  if(!name) {
    asx_warning_attrib_required(parser,"PARAM" ,"NAME" );
    return;
  }
  val = asx_get_attrib("VALUE",attribs);
  if(m_config_get_option(mconfig,name) == NULL) {
    mp_msg(MSGT_PLAYTREE,MSGL_WARN,"Found unknown param in asx: %s",name);
    if(val)
      mp_msg(MSGT_PLAYTREE,MSGL_WARN,"=%s\n",val);
    else
      mp_msg(MSGT_PLAYTREE,MSGL_WARN,"\n");
    return;
  }
  play_tree_set_param(pt,name,val);
  free(name);
  if(val) free(val);
}
Esempio n. 4
0
static play_tree_t*
asx_parse_entryref(ASX_Parser_t* parser,char* buffer,char** _attribs) {
  play_tree_t* pt;
  char *href;
  stream_t* stream;
  play_tree_parser_t* ptp;
  int f=DEMUXER_TYPE_UNKNOWN;

  if(parser->deep > 0)
    return NULL;

  href = asx_get_attrib("HREF",_attribs);
  if(href == NULL) {
    asx_warning_attrib_required(parser,"ENTRYREF" ,"HREF" );
    return NULL;
  }
  stream=open_stream(href,0,&f);
  if(!stream) {
    mp_msg(MSGT_PLAYTREE,MSGL_WARN,"Can't open playlist %s\n",href);
    free(href);
    return NULL;
  }

  mp_msg(MSGT_PLAYTREE,MSGL_V,"Adding playlist %s to element entryref\n",href);

  ptp = play_tree_parser_new(stream,parser->deep+1);

  pt = play_tree_parser_get_play_tree(ptp, 1);

  play_tree_parser_free(ptp);
  free_stream(stream);
  free(href);
  //mp_msg(MSGT_PLAYTREE,MSGL_INFO,"Need to implement entryref\n");
    
  return pt;
}
Esempio n. 5
0
static void
asx_parse_param(ASX_Parser_t* parser, char** attribs, play_tree_t* pt) {
  char *name = NULL,*val = NULL;

  name = asx_get_attrib("NAME",attribs);
  if(!name) {
    asx_warning_attrib_required(parser,"PARAM" ,"NAME" );
    return;
  }
  val = asx_get_attrib("VALUE",attribs);
  if(m_config_get_option(mconfig,name) == NULL) {
    mp_msg(MSGT_PLAYTREE,MSGL_WARN,"Found unknown param in asx: %s",name);
    if(val)
      mp_msg(MSGT_PLAYTREE,MSGL_WARN,"=%s\n",val);
    else
      mp_msg(MSGT_PLAYTREE,MSGL_WARN,"\n");
    goto err_out;
  }
  mp_msg(MSGT_PLAYTREE, MSGL_ERR, "Support for specifying parameters in playlists has been disabled.\n");
//  play_tree_set_param(pt,name,val);
err_out:
  free(name);
  free(val);
}