From 740352ceabf20e948984df918ed3c5e81f7c9b47 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Fri, 9 Mar 2018 19:08:17 +0000 Subject: Remove mpcinfo plugin The code quality of it is terrible, the user experience of using it is terrible, and it should have been removed years ago --- plugins/mpcinfo/oggInfo.c | 124 ---------------------------------------------- 1 file changed, 124 deletions(-) delete mode 100644 plugins/mpcinfo/oggInfo.c (limited to 'plugins/mpcinfo/oggInfo.c') diff --git a/plugins/mpcinfo/oggInfo.c b/plugins/mpcinfo/oggInfo.c deleted file mode 100644 index 777d2106..00000000 --- a/plugins/mpcinfo/oggInfo.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * This program 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. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -static int getOggInt(char *buff, int beg, int bytes){ -//if (DEBUG==1) putlog("getOggInt"); - int ret=0; - int i; - for (i=0;i=0) ret+=buff[i+beg]*iPow(256,i);else ret+=(256+buff[i+beg])*iPow(256,i); - //printf("[%i]=%i\n",i,buff[i+beg]); - } - return ret; -} - -static char *upperStr(char *text) -{ - char *ret = (char*) malloc(sizeof(char)*(strlen(text) + 1)); - - size_t i; - for (i = 0; i < strlen(text); i++) - { - ret[i] = toupper(text[i]); - } - - ret[strlen(text)] = 0; - - return ret; -} - -struct tagInfo getOggHeader(char *file){ -//if (DEBUG==1) putlog("reading ogg header"); - char header[4096]; - int i, c; - int h1pos, h3pos, maxBr, nomBr, minBr, pos, count, tagLen; - char *sub; - char *name; - char *val; - char HEADLOC1[]="_vorbis", HEADLOC3[]="_vorbis", HEADLOC5[]="_vorbis"; - FILE *f; - struct tagInfo info; - - info.artist=NULL; - f = fopen(file,"rb"); - if (f==NULL){ - hexchat_print(ph,"file not found while trying to read ogg header"); - //if (DEBUG==1) putlog("file not found while trying to read ogg header"); - return info; - } - - for (i=0;i<4095;i++) {c=fgetc(f);header[i]=(char)c;} - fclose(f); - HEADLOC1[0]=1; - HEADLOC3[0]=3; - HEADLOC5[0]=5; - h1pos=inStr(header,4096,HEADLOC1); - h3pos=inStr(header,4096,HEADLOC3); - //int h5pos=inStr(header,4096,HEADLOC5); //not needed - - //printf("loc1: %i\n",h1pos);printf("loc3: %i\n",h3pos);printf("loc5: %i\n",h5pos); - maxBr=getOggInt(header,h1pos+7+9,4); - nomBr=getOggInt(header,h1pos+7+13,4); - minBr=getOggInt(header,h1pos+7+17,4); - info.freq=getOggInt(header,h1pos+7+5,4); - info.mode=header[h1pos+7+4]; - info.bitrate=nomBr; - if (((maxBr==nomBr)&&(nomBr=minBr))||((minBr==0)&&(maxBr==0))||((minBr=-1)&&(maxBr=-1)) )info.cbr=1;else info.cbr=0; - printf("bitrates: %i|%i|%i\n",maxBr,nomBr,minBr); - printf("freq: %u\n",info.freq); - pos=h3pos+7; - pos+=getOggInt(header,pos,4)+4; - count=getOggInt(header,pos,4); - //printf("tags: %i\n",count); - pos+=4; - - info.artist=NULL;info.title=NULL;info.album=NULL;info.comment=NULL;info.genre=NULL; - for (i=0;i