[Mplayer-cvslog] CVS: main codec-cfg.h,1.17,1.18 codec-cfg.c,1.37,1.38 mplayer.c,1.283,1.284
Arpi of Ize
arpi at mplayer.dev.hu
Thu Sep 27 14:59:37 CEST 2001
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv5812
Modified Files:
codec-cfg.h codec-cfg.c mplayer.c
Log Message:
-ac help / -vc help
Index: codec-cfg.h
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- codec-cfg.h 24 Sep 2001 20:21:53 -0000 1.17
+++ codec-cfg.h 27 Sep 2001 12:59:35 -0000 1.18
@@ -71,5 +71,6 @@
codecs_t* find_video_codec(unsigned int fourcc, unsigned int *fourccmap, codecs_t *start);
codecs_t* find_audio_codec(unsigned int fourcc, unsigned int *fourccmap, codecs_t *start);
codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap,codecs_t *start,int audioflag);
+void list_codecs(int audioflag);
#endif
Index: codec-cfg.c
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- codec-cfg.c 24 Sep 2001 20:21:53 -0000 1.37
+++ codec-cfg.c 27 Sep 2001 12:59:35 -0000 1.38
@@ -644,6 +644,30 @@
return NULL;
}
+void list_codecs(int audioflag){
+ int i, j;
+ codecs_t *c;
+
+ if (audioflag) {
+ i = nr_acodecs;
+ c = audio_codecs;
+ } else {
+ i = nr_vcodecs;
+ c = video_codecs;
+ }
+ if(!i) return NULL;
+ for (/* NOTHING */; i--; c++) {
+ if(c->dll)
+ printf("%-10s %2d %s [%s]\n",c->name,c->driver,c->info,c->dll);
+ else
+ printf("%-10s %2d %s\n",c->name,c->driver,c->info);
+
+ }
+
+}
+
+
+
#ifdef CODECS2HTML
void wrapline(FILE *f2,char *s){
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.283
retrieving revision 1.284
diff -u -r1.283 -r1.284
--- mplayer.c 26 Sep 2001 21:35:14 -0000 1.283
+++ mplayer.c 27 Sep 2001 12:59:35 -0000 1.284
@@ -430,11 +430,7 @@
}
}
-//ifndef HAVE_GUI
- int main(int argc,char* argv[], char *envp[]){
-//else
-// int mplayer(int argc,char* argv[], char *envp[]){
-//endif
+int main(int argc,char* argv[], char *envp[]){
#ifdef USE_SUB
static subtitle* subtitles=NULL;
@@ -530,6 +526,28 @@
exit(0);
}
+// check codec.conf
+if(!parse_codec_cfg(get_path("codecs.conf"))){
+ if(!parse_codec_cfg(DATADIR"/codecs.conf")){
+ mp_msg(MSGT_CPLAYER,MSGL_HINT,MSGTR_CopyCodecsConf);
+ exit(1);
+ }
+}
+
+ if(audio_codec && strcmp(audio_codec,"help")==0){
+ printf("Available audio codecs:\n");
+ list_codecs(1);
+ printf("\n");
+ exit(0);
+ }
+ if(video_codec && strcmp(video_codec,"help")==0){
+ printf("Available video codecs:\n");
+ list_codecs(0);
+ printf("\n");
+ exit(0);
+ }
+
+
if(!num_filenames && !vcd_track && !dvd_title){
if(!use_gui){
// no file/vcd/dvd -> show HELP:
@@ -550,13 +568,6 @@
//------ load global data first ------
-// check codec.conf
-if(!parse_codec_cfg(get_path("codecs.conf"))){
- if(!parse_codec_cfg(DATADIR"/codecs.conf")){
- mp_msg(MSGT_CPLAYER,MSGL_HINT,MSGTR_CopyCodecsConf);
- exit(1);
- }
-}
// check font
#ifdef USE_OSD
More information about the MPlayer-cvslog
mailing list