Mercurial > mplayer.hg
comparison mplayer.c @ 16345:feb16d0117c8
allow multiple help clauses on the command line, Patch by kiriuja " mplayer-patches AH en-directo POUM net "
This one makes
mplayer -vo help -ao help -ac help -vc help -pphelp -af help -vfm help -vf help -afm help -fstype help
produce the desired output.
From the thread:
Date: Jul 16, 2005 8:25 PM
Subject: [MPlayer-dev-eng] [PATCH] allow multiple help clauses on the command line
author | gpoirier |
---|---|
date | Fri, 02 Sep 2005 08:29:30 +0000 |
parents | 60c6693b2b2b |
children | 6ff303d2876b |
comparison
equal
deleted
inserted
replaced
16344:b139ca30d52b | 16345:feb16d0117c8 |
---|---|
1046 int osd_show_framedropping = 0; | 1046 int osd_show_framedropping = 0; |
1047 int osd_show_status = 0; | 1047 int osd_show_status = 0; |
1048 | 1048 |
1049 int rtc_fd=-1; | 1049 int rtc_fd=-1; |
1050 | 1050 |
1051 int opt_exit = 0; // flag indicating whether mplayer should exit without playing anything | |
1052 | |
1051 //float a_frame=0; // Audio | 1053 //float a_frame=0; // Audio |
1052 | 1054 |
1053 int i; | 1055 int i; |
1054 char *tmp; | 1056 char *tmp; |
1055 | 1057 |
1148 if ( use_gui ) cfg_read(); | 1150 if ( use_gui ) cfg_read(); |
1149 #endif | 1151 #endif |
1150 | 1152 |
1151 playtree = m_config_parse_mp_command_line(mconfig, argc, argv); | 1153 playtree = m_config_parse_mp_command_line(mconfig, argc, argv); |
1152 if(playtree == NULL) | 1154 if(playtree == NULL) |
1153 exit_player(NULL); | 1155 opt_exit = 1; |
1154 | 1156 else { |
1155 playtree = play_tree_cleanup(playtree); | 1157 playtree = play_tree_cleanup(playtree); |
1156 if(playtree) { | 1158 if(playtree) { |
1157 playtree_iter = play_tree_iter_new(playtree,mconfig); | 1159 playtree_iter = play_tree_iter_new(playtree,mconfig); |
1158 if(playtree_iter) { | 1160 if(playtree_iter) { |
1159 if(play_tree_iter_step(playtree_iter,0,0) != PLAY_TREE_ITER_ENTRY) { | 1161 if(play_tree_iter_step(playtree_iter,0,0) != PLAY_TREE_ITER_ENTRY) { |
1160 play_tree_iter_free(playtree_iter); | 1162 play_tree_iter_free(playtree_iter); |
1161 playtree_iter = NULL; | 1163 playtree_iter = NULL; |
1162 } | 1164 } |
1163 filename = play_tree_iter_get_file(playtree_iter,1); | 1165 filename = play_tree_iter_get_file(playtree_iter,1); |
1164 } | 1166 } |
1167 } | |
1165 } | 1168 } |
1166 | 1169 |
1167 #ifdef WIN32 | 1170 #ifdef WIN32 |
1168 if(proc_priority){ | 1171 if(proc_priority){ |
1169 int i; | 1172 int i; |
1203 } | 1206 } |
1204 #endif | 1207 #endif |
1205 | 1208 |
1206 if(video_driver_list && strcmp(video_driver_list[0],"help")==0){ | 1209 if(video_driver_list && strcmp(video_driver_list[0],"help")==0){ |
1207 list_video_out(); | 1210 list_video_out(); |
1208 exit_player_with_rc(NULL, 0); | 1211 opt_exit = 1; |
1209 } | 1212 } |
1210 | 1213 |
1211 if(audio_driver_list && strcmp(audio_driver_list[0],"help")==0){ | 1214 if(audio_driver_list && strcmp(audio_driver_list[0],"help")==0){ |
1212 list_audio_out(); | 1215 list_audio_out(); |
1213 exit_player_with_rc(NULL, 0); | 1216 opt_exit = 1; |
1214 } | 1217 } |
1215 | 1218 |
1216 // check codec.conf | 1219 // check codec.conf |
1217 if(!codecs_file || !parse_codec_cfg(codecs_file)){ | 1220 if(!codecs_file || !parse_codec_cfg(codecs_file)){ |
1218 if(!parse_codec_cfg(mem_ptr=get_path("codecs.conf"))){ | 1221 if(!parse_codec_cfg(mem_ptr=get_path("codecs.conf"))){ |
1239 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableAudioCodecs); | 1242 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableAudioCodecs); |
1240 if (identify) | 1243 if (identify) |
1241 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_CODECS\n"); | 1244 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_CODECS\n"); |
1242 list_codecs(1); | 1245 list_codecs(1); |
1243 mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); | 1246 mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); |
1244 exit_player_with_rc(NULL, 0); | 1247 opt_exit = 1; |
1245 } | 1248 } |
1246 if(video_codec_list && strcmp(video_codec_list[0],"help")==0){ | 1249 if(video_codec_list && strcmp(video_codec_list[0],"help")==0){ |
1247 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableVideoCodecs); | 1250 mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_AvailableVideoCodecs); |
1248 if (identify) | 1251 if (identify) |
1249 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_CODECS\n"); | 1252 mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_CODECS\n"); |
1250 list_codecs(0); | 1253 list_codecs(0); |
1251 mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); | 1254 mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); |
1252 exit_player_with_rc(NULL, 0); | 1255 opt_exit = 1; |
1253 } | 1256 } |
1254 if(video_fm_list && strcmp(video_fm_list[0],"help")==0){ | 1257 if(video_fm_list && strcmp(video_fm_list[0],"help")==0){ |
1255 vfm_help(); | 1258 vfm_help(); |
1256 mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); | 1259 mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); |
1257 exit_player_with_rc(NULL, 0); | 1260 opt_exit = 1; |
1258 } | 1261 } |
1259 if(audio_fm_list && strcmp(audio_fm_list[0],"help")==0){ | 1262 if(audio_fm_list && strcmp(audio_fm_list[0],"help")==0){ |
1260 afm_help(); | 1263 afm_help(); |
1261 mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); | 1264 mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); |
1262 exit_player_with_rc(NULL, 0); | 1265 opt_exit = 1; |
1263 } | 1266 } |
1264 if(af_cfg.list && strcmp(af_cfg.list[0],"help")==0){ | 1267 if(af_cfg.list && strcmp(af_cfg.list[0],"help")==0){ |
1265 af_help(); | 1268 af_help(); |
1266 printf("\n"); | 1269 printf("\n"); |
1267 exit_player_with_rc(NULL, 0); | 1270 opt_exit = 1; |
1268 } | 1271 } |
1269 #ifdef HAVE_X11 | 1272 #ifdef HAVE_X11 |
1270 if(vo_fstype_list && strcmp(vo_fstype_list[0],"help")==0){ | 1273 if(vo_fstype_list && strcmp(vo_fstype_list[0],"help")==0){ |
1271 fstype_help(); | 1274 fstype_help(); |
1272 mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); | 1275 mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); |
1273 exit_player_with_rc(NULL, 0); | 1276 opt_exit = 1; |
1274 } | 1277 } |
1275 #endif | 1278 #endif |
1276 if((demuxer_name && strcmp(demuxer_name,"help")==0) || | 1279 if((demuxer_name && strcmp(demuxer_name,"help")==0) || |
1277 (audio_demuxer_name && strcmp(audio_demuxer_name,"help")==0) || | 1280 (audio_demuxer_name && strcmp(audio_demuxer_name,"help")==0) || |
1278 (sub_demuxer_name && strcmp(sub_demuxer_name,"help")==0)){ | 1281 (sub_demuxer_name && strcmp(sub_demuxer_name,"help")==0)){ |
1279 demuxer_help(); | 1282 demuxer_help(); |
1280 mp_msg(MSGT_CPLAYER, MSGL_INFO, "\n"); | 1283 mp_msg(MSGT_CPLAYER, MSGL_INFO, "\n"); |
1281 exit_player_with_rc(NULL, 0); | 1284 opt_exit = 1; |
1282 } | 1285 } |
1286 | |
1287 if(opt_exit) | |
1288 exit_player(NULL); | |
1283 | 1289 |
1284 #ifdef USE_EDL | 1290 #ifdef USE_EDL |
1285 if (edl_check_mode() == EDL_ERROR && edl_filename) | 1291 if (edl_check_mode() == EDL_ERROR && edl_filename) |
1286 { | 1292 { |
1287 mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlCantUseBothModes); | 1293 mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlCantUseBothModes); |