~ubuntu-branches/ubuntu/maverick/vdr-plugin-mp3/maverick

« back to all changes in this revision

Viewing changes to stream.c

  • Committer: Bazaar Package Importer
  • Author(s): Tobias Grimm
  • Date: 2010-03-28 15:09:21 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100328150921-3kti802cqh0pe1hl
Tags: 0.10.2-3
* Build-depend on vdr-dev >= 1.6.0-16
* Minor debian/copyright update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * MP3/MPlayer plugin to VDR (C++)
3
3
 *
4
 
 * (C) 2001-2006 Stefan Huelswitt <s.huelswitt@gmx.de>
 
4
 * (C) 2001-2009 Stefan Huelswitt <s.huelswitt@gmx.de>
5
5
 *
6
6
 * This code is free software; you can redistribute it and/or
7
7
 * modify it under the terms of the GNU General Public License
28
28
#include "setup-mp3.h"
29
29
#include "stream.h"
30
30
#include "network.h"
 
31
#include "data.h"
31
32
#include "menu-async.h"
32
33
#include "i18n.h"
33
34
#include "version.h"
366
367
  bool res=false;
367
368
  char buff[2048];
368
369
 
369
 
  char *h, *p;
370
 
  asprintf(&h,port!=DEFAULT_PORT ? "%s:%d":"%s",host,port);
371
 
  if(MP3Setup.UseProxy) asprintf(&p,"http://%s%s",h,path);
372
 
  else asprintf(&p,"%s",path);
 
370
  char *p;
 
371
  char *h=aprintf(port!=DEFAULT_PORT ? "%s:%d":"%s",host,port);
 
372
  if(MP3Setup.UseProxy) p=aprintf("http://%s%s",h,path);
 
373
  else p=aprintf("%s",path);
373
374
 
374
375
  char a[1024];
375
376
  a[0]=0;
389
390
           "Accept: audio/mpeg\r\n"   //XXX audio/x-mpegurl, */*
390
391
           "Icy-MetaData: 1\r\n"
391
392
           "%s\r\n",
392
 
           p,PLUGIN_NAME,PLUGIN_VERSION,h,a);
 
393
           p,PLUGIN_NAME,PluginVersion,h,a);
393
394
  free(p); free(h);  
394
395
 
395
396
  if(++cc==1) asyncStatus.Set(tr("Connecting to stream server ..."));
405
406
 
406
407
bool cNetStream::ParseHeader(const char *buff, const char *name, char **value)
407
408
{
408
 
  char *s=index(buff,':');
 
409
  const char *s=index(buff,':');
409
410
  if(s && !strncasecmp(buff,name,s-buff)) {
410
411
    s=skipspace(s+1);
411
412
    d(printf("netstream: found header '%s' contents '%s'\n",name,s))
527
528
  return false;
528
529
}
529
530
 
530
 
char *cNetStream::ParseMetaString(const char *buff, const char *name, char **value)
 
531
char *cNetStream::ParseMetaString(char *buff, const char *name, char **value)
531
532
{
532
533
  char *s=index(buff,'=');
533
534
  if(s && !strncasecmp(buff,name,s-buff)) {