comparison mplayer.c @ 6796:9c828335b2d0

add preferences to gui
author pontscho
date Thu, 25 Jul 2002 20:34:33 +0000
parents 0d08931fb3c3
children b9a6817d9ff3
comparison
equal deleted inserted replaced
6795:776b686069af 6796:9c828335b2d0
164 int benchmark=0; 164 int benchmark=0;
165 165
166 // static int play_in_bg=0; 166 // static int play_in_bg=0;
167 167
168 // options: 168 // options:
169 static int auto_quality=0; 169 int auto_quality=0;
170 static int output_quality=0; 170 static int output_quality=0;
171 171
172 int use_gui=0; 172 int use_gui=0;
173 173
174 int osd_level=2; 174 int osd_level=2;
218 #define cache_fill_status 0 218 #define cache_fill_status 0
219 #endif 219 #endif
220 220
221 // dump: 221 // dump:
222 static char *stream_dump_name="stream.dump"; 222 static char *stream_dump_name="stream.dump";
223 static int stream_dump_type=0; 223 int stream_dump_type=0;
224 224
225 // A-V sync: 225 // A-V sync:
226 static float default_max_pts_correction=-1;//0.01f; 226 static float default_max_pts_correction=-1;//0.01f;
227 static float max_pts_correction=0;//default_max_pts_correction; 227 static float max_pts_correction=0;//default_max_pts_correction;
228 static float c_total=0; 228 static float c_total=0;
229 static float audio_delay=0; 229 float audio_delay=0;
230 230
231 static int dapsync=0; 231 static int dapsync=0;
232 static int softsleep=0; 232 static int softsleep=0;
233 233
234 static float force_fps=0; 234 static float force_fps=0;
235 static int force_srate=0; 235 static int force_srate=0;
236 static int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode 236 int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode
237 static int play_n_frames=-1; 237 static int play_n_frames=-1;
238 static int play_n_frames_mf=-1; 238 static int play_n_frames_mf=-1;
239 239
240 // screen info: 240 // screen info:
241 char* video_driver=NULL; //"mga"; // default 241 char* video_driver=NULL; //"mga"; // default
895 const vo_info_t *info = video_out_drivers[i]->get_info (); 895 const vo_info_t *info = video_out_drivers[i]->get_info ();
896 if(strcmp(info->short_name,vo) == 0){ 896 if(strcmp(info->short_name,vo) == 0){
897 video_out = video_out_drivers[i];break; 897 video_out = video_out_drivers[i];break;
898 } 898 }
899 } 899 }
900
901 if(!video_out){ 900 if(!video_out){
902 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_InvalidVOdriver,vo?vo:"?"); 901 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_InvalidVOdriver,vo?vo:"?");
903 exit_player(MSGTR_Exit_error); 902 exit_player(MSGTR_Exit_error);
904 } 903 }
905 if(vo) 904 if(vo)
1209 subtitles=sub_read_file(sub_name, sh_video->fps); 1208 subtitles=sub_read_file(sub_name, sh_video->fps);
1210 if(!subtitles) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name); 1209 if(!subtitles) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name);
1211 } else 1210 } else
1212 if(sub_auto) { // auto load sub file ... 1211 if(sub_auto) { // auto load sub file ...
1213 subtitles=sub_read_file( filename ? sub_filename( get_path("sub/"), filename ) 1212 subtitles=sub_read_file( filename ? sub_filename( get_path("sub/"), filename )
1214 : "default.sub", sh_video->fps ); 1213 : "default.sub", sh_video->fps );
1215 } 1214 }
1216 if(subtitles && stream_dump_type==3) list_sub_file(subtitles); 1215 if(subtitles && stream_dump_type==3) list_sub_file(subtitles);
1217 if(subtitles && stream_dump_type==4) dump_mpsub(subtitles, sh_video->fps); 1216 if(subtitles && stream_dump_type==4) dump_mpsub(subtitles, sh_video->fps);
1218 if(subtitles && stream_dump_type==6) dump_srt(subtitles, sh_video->fps); 1217 if(subtitles && stream_dump_type==6) dump_srt(subtitles, sh_video->fps);
1219 } 1218 }
1353 fflush(stdout); 1352 fflush(stdout);
1354 1353
1355 #ifdef HAVE_NEW_GUI 1354 #ifdef HAVE_NEW_GUI
1356 if ( use_gui ) 1355 if ( use_gui )
1357 { 1356 {
1357 guiGetEvent( guiSetStream,(char *)stream );
1358 guiGetEvent( guiSetFileName,filename ); 1358 guiGetEvent( guiSetFileName,filename );
1359 guiGetEvent( guiSetStream,(char *)stream );
1360 if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0; 1359 if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0;
1361 if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,1 ); else guiGetEvent( guiSetAudioOnly,0 ); 1360 if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,(char *)1 ); else guiGetEvent( guiSetAudioOnly,(char *)0 );
1362 guiGetEvent( guiSetVolume,NULL ); 1361 guiGetEvent( guiSetVolume,NULL );
1363 } 1362 }
1364 #endif 1363 #endif
1365 1364
1366 { 1365 {
1946 { 1945 {
1947 if ( guiIntfStruct.Playing == guiSetStop ) goto goto_next_file; 1946 if ( guiIntfStruct.Playing == guiSetStop ) goto goto_next_file;
1948 guiGetEvent( guiCEvent,(char *)guiSetPlay ); 1947 guiGetEvent( guiCEvent,(char *)guiSetPlay );
1949 } 1948 }
1950 #endif 1949 #endif
1951 if(pkey!=32 && pkey!=112) 1950 if(pkey!=32 && pkey!=112 && pkey!=-1)
1952 mplayer_put_key(pkey); // pass on the key 1951 mplayer_put_key(pkey); // pass on the key
1953 } 1952 }
1954 1953
1955 // handle -sstep 1954 // handle -sstep
1956 if(step_sec>0) { 1955 if(step_sec>0) {
3105 demuxer=NULL; 3104 demuxer=NULL;
3106 3105
3107 current_module="free_stream"; 3106 current_module="free_stream";
3108 if(stream) free_stream(stream); 3107 if(stream) free_stream(stream);
3109 stream=NULL; 3108 stream=NULL;
3110 3109
3110 #ifdef USE_SUB
3111 current_module="sub_free"; 3111 current_module="sub_free";
3112 if ( subtitles ) 3112 if ( subtitles )
3113 { 3113 {
3114 sub_free( subtitles ); 3114 sub_free( subtitles );
3115 sub_name=NULL; 3115 sub_name=NULL;
3116 vo_sub=NULL; 3116 vo_sub=NULL;
3117 subtitles=NULL; 3117 subtitles=NULL;
3118 } 3118 }
3119 #endif
3119 3120
3120 eof = 0; 3121 eof = 0;
3121 goto play_next_file; 3122 goto play_next_file;
3122 } 3123 }
3123 3124