comparison mplayer.c @ 5789:0132c5747e8a

fix audio only files play
author pontscho
date Mon, 22 Apr 2002 21:36:12 +0000
parents cb47abf3b511
children d9c211c2907f
comparison
equal deleted inserted replaced
5788:8bd1c1e319fb 5789:0132c5747e8a
767 } 767 }
768 768
769 #ifdef HAVE_NEW_GUI 769 #ifdef HAVE_NEW_GUI
770 if ( use_gui ) { 770 if ( use_gui ) {
771 771
772 guiGetEvent( guiReDrawSubWindow,0 );
772 while ( guiIntfStruct.Playing != 1 ) 773 while ( guiIntfStruct.Playing != 1 )
773 { 774 {
774 #ifdef HAVE_NEW_INPUT 775 #ifdef HAVE_NEW_INPUT
775 mp_cmd_t* cmd; 776 mp_cmd_t* cmd;
776 #endif 777 #endif
1278 set_video_quality(sh_video,output_quality); 1279 set_video_quality(sh_video,output_quality);
1279 } 1280 }
1280 1281
1281 // ========== Init display (sh_video->disp_w*sh_video->disp_h/out_fmt) ============ 1282 // ========== Init display (sh_video->disp_w*sh_video->disp_h/out_fmt) ============
1282 1283
1283 #ifdef HAVE_NEW_GUI
1284 if ( use_gui )
1285 {
1286 mplResizeToMovieSize( sh_video->disp_w,sh_video->disp_h );
1287 guiIntfStruct.MovieWidth=sh_video->disp_w;
1288 guiIntfStruct.MovieHeight=sh_video->disp_h;
1289 guiIntfStruct.StreamType=stream->type;
1290 guiGetEvent( guiSetFileName,filename );
1291 if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels;
1292 else guiIntfStruct.AudioType=0;
1293 #ifdef USE_DVDREAD
1294 if ( stream->type == STREAMTYPE_DVD ) guiGetEvent( guiSetDVD,(char *)stream->priv );
1295 #endif
1296 }
1297 #endif
1298
1299 current_module="init_vo_vaa"; 1284 current_module="init_vo_vaa";
1300 1285
1301 if(video_out->control(VOCTRL_QUERY_VAA, &vo_vaa)==VO_NOTIMPL) 1286 if(video_out->control(VOCTRL_QUERY_VAA, &vo_vaa)==VO_NOTIMPL)
1302 memset(&vo_vaa,0,sizeof(vo_vaa_t)); 1287 memset(&vo_vaa,0,sizeof(vo_vaa_t));
1303 /* 1288 /*
1324 //================== MAIN: ========================== 1309 //================== MAIN: ==========================
1325 main: 1310 main:
1326 if(!sh_video) osd_level = 0; 1311 if(!sh_video) osd_level = 0;
1327 1312
1328 fflush(stdout); 1313 fflush(stdout);
1314
1315 #ifdef HAVE_NEW_GUI
1316 if ( use_gui )
1317 {
1318 guiGetEvent( guiSetShVideo,(char *)sh_video );
1319 guiGetEvent( guiSetFileName,filename );
1320 guiIntfStruct.StreamType=stream->type;
1321 if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0;
1322 if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,1 ); else guiGetEvent( guiSetAudioOnly,0 );
1323 #ifdef USE_DVDREAD
1324 if ( stream->type == STREAMTYPE_DVD ) guiGetEvent( guiSetDVD,(char *)stream->priv );
1325 #endif
1326 }
1327 #endif
1329 1328
1330 { 1329 {
1331 //int frame_corr_num=0; // 1330 //int frame_corr_num=0; //
1332 //float v_frame=0; // Video 1331 //float v_frame=0; // Video
1333 float time_frame=0; // Timer 1332 float time_frame=0; // Timer
2732 current_module=NULL; 2731 current_module=NULL;
2733 } 2732 }
2734 2733
2735 #ifdef HAVE_NEW_GUI 2734 #ifdef HAVE_NEW_GUI
2736 if(use_gui){ 2735 if(use_gui){
2736 guiEventHandling();
2737 if(demuxer->file_format==DEMUXER_TYPE_AVI && sh_video->video.dwLength>2){ 2737 if(demuxer->file_format==DEMUXER_TYPE_AVI && sh_video->video.dwLength>2){
2738 // get pos from frame number / total frames 2738 // get pos from frame number / total frames
2739 guiIntfStruct.Position=(float)d_video->pack_no*100.0f/sh_video->video.dwLength; 2739 guiIntfStruct.Position=(float)d_video->pack_no*100.0f/sh_video->video.dwLength;
2740 } else { 2740 } else {
2741 // get pos from file position / filesize 2741 // get pos from file position / filesize