Mercurial > mplayer.hg
comparison Gui/mplayer/mw.h @ 6996:163f78ece9c2
add uri2filename converter
author | pontscho |
---|---|
date | Wed, 14 Aug 2002 12:17:04 +0000 |
parents | 7242f1840f8d |
children | 98bed9e12087 |
comparison
equal
deleted
inserted
replaced
6995:8f92313a0cd5 | 6996:163f78ece9c2 |
---|---|
666 /* now fill it with new items */ | 666 /* now fill it with new items */ |
667 for(f=0; f < num; f++){ | 667 for(f=0; f < num; f++){ |
668 char* str = strdup( files[f] ); | 668 char* str = strdup( files[f] ); |
669 plItem* item; | 669 plItem* item; |
670 | 670 |
671 #ifdef USE_ICONV | |
671 if ( strchr( str,'%' ) ) | 672 if ( strchr( str,'%' ) ) |
672 { | 673 { |
673 char * t = calloc( 1,strlen( str ) ); | 674 char * tmp=gconvert_uri_to_filename( str ); |
674 int i,c = 0; | 675 free( str ); str=tmp; |
675 for ( i=0;i < strlen( str );i++ ) | |
676 if ( str[i] != '%' ) t[c++]=str[i]; | |
677 else | |
678 { | |
679 char tmp[4] = "0xXX"; | |
680 // if ( str[++i] == '%' ) { t[c++]='%'; continue; }; | |
681 tmp[2]=str[++i]; tmp[3]=str[++i]; t[c++]=(char)strtol( tmp,(char **)NULL,16 ); | |
682 } | |
683 free( str ); str=t; | |
684 } | 676 } |
677 #endif | |
685 | 678 |
686 if(stat(str,&buf) == 0 && S_ISDIR(buf.st_mode) == 0) { | 679 if(stat(str,&buf) == 0 && S_ISDIR(buf.st_mode) == 0) { |
687 /* this is not a directory so try to play it */ | 680 /* this is not a directory so try to play it */ |
688 printf("Received D&D %s\n",str); | 681 printf("Received D&D %s\n",str); |
689 item = calloc(1,sizeof(plItem)); | 682 item = calloc(1,sizeof(plItem)); |