comparison mplayer.c @ 1582:12aa68bf2ff5

erros emssages moved to help_mp.h for translation
author arpi
date Sat, 18 Aug 2001 19:51:21 +0000
parents 5c7760aa4f94
children ca7bf882d2f8
comparison
equal deleted inserted replaced
1581:435f0a0e6a5c 1582:12aa68bf2ff5
288 } 288 }
289 else mplSendMessage( mplUnknowError ); 289 else mplSendMessage( mplUnknowError );
290 } 290 }
291 #endif 291 #endif
292 292
293 if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,"\nExiting... (%s)\n",how); 293 if(how) mp_msgt(MSGT_CPLAYER,MSGL_INFO,MSGTR_Exiting,how);
294 mp_msg(MSGT_CPLAYER,MSGL_V,"max framesize was %d bytes\n",max_framesize); 294 mp_msg(MSGT_CPLAYER,MSGL_V,"max framesize was %d bytes\n",max_framesize);
295 if(benchmark){ 295 if(benchmark){
296 double tot=video_time_usage+vout_time_usage+audio_time_usage; 296 double tot=video_time_usage+vout_time_usage+audio_time_usage;
297 double total_time_usage=(float)total_time_usage_start*0.000001; 297 double total_time_usage=(float)total_time_usage_start*0.000001;
298 mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARKs: V:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n", 298 mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARKs: V:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n",
335 if(sig_count==2) exit(1); 335 if(sig_count==2) exit(1);
336 if(sig_count>2){ 336 if(sig_count>2){
337 // can't stop :( 337 // can't stop :(
338 kill(getpid(),SIGKILL); 338 kill(getpid(),SIGKILL);
339 } 339 }
340 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"\nMPlayer interrupted by signal %d in module: %s \n",x, 340 mp_msgt(MSGT_CPLAYER,MSGL_FATAL,MSGTR_IntBySignal,x,
341 current_module?current_module:"unknown" 341 current_module?current_module:"unknown"
342 ); 342 );
343 #ifdef HAVE_GUI 343 #ifdef HAVE_GUI
344 if ( !nogui ) 344 if ( !nogui )
345 { 345 {
380 char *conffile; 380 char *conffile;
381 int conffile_fd; 381 int conffile_fd;
382 if (parse_config_file(conf, "/etc/mplayer.conf") < 0) 382 if (parse_config_file(conf, "/etc/mplayer.conf") < 0)
383 exit(1); 383 exit(1);
384 if ((conffile = get_path("")) == NULL) { 384 if ((conffile = get_path("")) == NULL) {
385 mp_msg(MSGT_CPLAYER,MSGL_WARN,"Can't find HOME dir\n"); 385 mp_msgt(MSGT_CPLAYER,MSGL_WARN,MSGTR_NoHomeDir);
386 } else { 386 } else {
387 mkdir(conffile, 0777); 387 mkdir(conffile, 0777);
388 free(conffile); 388 free(conffile);
389 if ((conffile = get_path("config")) == NULL) { 389 if ((conffile = get_path("config")) == NULL) {
390 mp_msg(MSGT_CPLAYER,MSGL_ERR,"get_path(\"config\") problem\n"); 390 mp_msgt(MSGT_CPLAYER,MSGL_ERR,MSGTR_GetpathProblem);
391 } else { 391 } else {
392 if ((conffile_fd = open(conffile, O_CREAT | O_EXCL | O_WRONLY, 0666)) != -1) { 392 if ((conffile_fd = open(conffile, O_CREAT | O_EXCL | O_WRONLY, 0666)) != -1) {
393 mp_msg(MSGT_CPLAYER,MSGL_INFO,"Creating config file: %s\n", conffile); 393 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CreatingCfgFile, conffile);
394 write(conffile_fd, default_config, strlen(default_config)); 394 write(conffile_fd, default_config, strlen(default_config));
395 close(conffile_fd); 395 close(conffile_fd);
396 } 396 }
397 if (parse_config_file(conf, conffile) < 0) 397 if (parse_config_file(conf, conffile) < 0)
398 exit(1); 398 exit(1);
526 video_out = video_out_drivers[i];break; 526 video_out = video_out_drivers[i];break;
527 } 527 }
528 } 528 }
529 #endif 529 #endif
530 if(!video_out){ 530 if(!video_out){
531 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"Invalid video output driver name: %s\nUse '-vo help' to get a list of available video drivers.\n",video_driver?video_driver:"?"); 531 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_InvalidVOdriver,video_driver?video_driver:"?");
532 return 0; 532 return 0;
533 } 533 }
534 534
535 // check audio_out driver name: 535 // check audio_out driver name:
536 if (audio_driver) 536 if (audio_driver)
555 if(strcmp(info->short_name,audio_driver) == 0){ 555 if(strcmp(info->short_name,audio_driver) == 0){
556 audio_out = audio_out_drivers[i];break; 556 audio_out = audio_out_drivers[i];break;
557 } 557 }
558 } 558 }
559 if (!audio_out){ 559 if (!audio_out){
560 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"Invalid audio output driver name: %s\nUse '-ao help' to get a list of available audio drivers.\n",audio_driver); 560 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_InvalidAOdriver,audio_driver);
561 return 0; 561 return 0;
562 } 562 }
563 /*DSP!! if(dsp) audio_out->control(AOCONTROL_SET_DEVICE,(int)dsp);*/ 563 /*DSP!! if(dsp) audio_out->control(AOCONTROL_SET_DEVICE,(int)dsp);*/
564 564
565 // check codec.conf 565 // check codec.conf
566 if(!parse_codec_cfg(get_path("codecs.conf"))){ 566 if(!parse_codec_cfg(get_path("codecs.conf"))){
567 if(!parse_codec_cfg(DATADIR"/codecs.conf")){ 567 if(!parse_codec_cfg(DATADIR"/codecs.conf")){
568 mp_msg(MSGT_CPLAYER,MSGL_HINT,"(copy/link DOCS/codecs.conf to ~/.mplayer/codecs.conf)\n"); 568 mp_msg(MSGT_CPLAYER,MSGL_HINT,MSGTR_CopyCodecsConf);
569 exit(1); 569 exit(1);
570 } 570 }
571 } 571 }
572 572
573 // check font 573 // check font
574 #ifdef USE_OSD 574 #ifdef USE_OSD
575 if(font_name){ 575 if(font_name){
576 vo_font=read_font_desc(font_name,font_factor,verbose>1); 576 vo_font=read_font_desc(font_name,font_factor,verbose>1);
577 if(!vo_font) mp_msg(MSGT_CPLAYER,MSGL_ERR,"Can't load font: %s\n",font_name); 577 if(!vo_font) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadFont,font_name);
578 } else { 578 } else {
579 // try default: 579 // try default:
580 vo_font=read_font_desc(get_path("font/font.desc"),font_factor,verbose>1); 580 vo_font=read_font_desc(get_path("font/font.desc"),font_factor,verbose>1);
581 if(!vo_font) 581 if(!vo_font)
582 vo_font=read_font_desc(DATADIR"/font/font.desc",font_factor,verbose>1); 582 vo_font=read_font_desc(DATADIR"/font/font.desc",font_factor,verbose>1);
585 585
586 #ifdef USE_SUB 586 #ifdef USE_SUB
587 // check .sub 587 // check .sub
588 if(sub_name){ 588 if(sub_name){
589 subtitles=sub_read_file(sub_name); 589 subtitles=sub_read_file(sub_name);
590 if(!subtitles) mp_msg(MSGT_CPLAYER,MSGL_ERR,"Can't load subtitles: %s\n",sub_name); 590 if(!subtitles) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name);
591 } else { 591 } else {
592 if(sub_auto) // auto load sub file ... 592 if(sub_auto) // auto load sub file ...
593 subtitles=sub_read_file( sub_filename( get_path("sub/"), filename ) ); 593 subtitles=sub_read_file( sub_filename( get_path("sub/"), filename ) );
594 if(!subtitles) subtitles=sub_read_file(get_path("default.sub")); // try default 594 if(!subtitles) subtitles=sub_read_file(get_path("default.sub")); // try default
595 } 595 }
601 stream->start_pos+=seek_to_byte; 601 stream->start_pos+=seek_to_byte;
602 602
603 #ifdef HAVE_LIBCSS 603 #ifdef HAVE_LIBCSS
604 if (dvdimportkey) { 604 if (dvdimportkey) {
605 if (dvd_import_key(dvdimportkey)) { 605 if (dvd_import_key(dvdimportkey)) {
606 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"Error processing DVD KEY.\n"); 606 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_ErrorDVDkey);
607 exit(1); 607 exit(1);
608 } 608 }
609 mp_msg(MSGT_CPLAYER,MSGL_INFO,"DVD command line requested key is stored for descrambling.\n"); 609 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CmdlineDVDkey);
610 } 610 }
611 if (dvd_auth_device) { 611 if (dvd_auth_device) {
612 // if (dvd_auth(dvd_auth_device,f)) { 612 // if (dvd_auth(dvd_auth_device,f)) {
613 if (dvd_auth(dvd_auth_device,filename)) { 613 if (dvd_auth(dvd_auth_device,filename)) {
614 GUI_MSG( mplErrorDVDAuth ) 614 GUI_MSG( mplErrorDVDAuth )
615 exit(0); 615 exit(0);
616 } 616 }
617 mp_msg(MSGT_CPLAYER,MSGL_INFO,"DVD auth sequence seems to be OK.\n"); 617 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_DVDauthOk);
618 } 618 }
619 #endif 619 #endif
620 620
621 //============ Open & Sync stream and detect file format =============== 621 //============ Open & Sync stream and detect file format ===============
622 622
640 case 1: ds=d_audio;break; 640 case 1: ds=d_audio;break;
641 case 2: ds=d_video;break; 641 case 2: ds=d_video;break;
642 case 3: ds=d_dvdsub;break; 642 case 3: ds=d_dvdsub;break;
643 } 643 }
644 if(!ds){ 644 if(!ds){
645 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"dump: FATAL: selected stream missing!\n"); 645 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_DumpSelectedSteramMissing);
646 exit(1); 646 exit(1);
647 } 647 }
648 // disable other streams: 648 // disable other streams:
649 if(d_audio && d_audio!=ds) {ds_free_packs(d_audio); d_audio->id=-2; } 649 if(d_audio && d_audio!=ds) {ds_free_packs(d_audio); d_audio->id=-2; }
650 if(d_video && d_video!=ds) {ds_free_packs(d_video); d_video->id=-2; } 650 if(d_video && d_video!=ds) {ds_free_packs(d_video); d_video->id=-2; }
651 if(d_dvdsub && d_dvdsub!=ds) {ds_free_packs(d_dvdsub); d_dvdsub->id=-2; } 651 if(d_dvdsub && d_dvdsub!=ds) {ds_free_packs(d_dvdsub); d_dvdsub->id=-2; }
652 // let's dump it! 652 // let's dump it!
653 f=fopen(stream_dump_name?stream_dump_name:"stream.dump","wb"); 653 f=fopen(stream_dump_name?stream_dump_name:"stream.dump","wb");
654 if(!f){ mp_msg(MSGT_CPLAYER,MSGL_FATAL,"Can't open dump file!!!\n");exit(1); } 654 if(!f){ mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CantOpenDumpfile);exit(1); }
655 while(!ds->eof){ 655 while(!ds->eof){
656 unsigned char* start; 656 unsigned char* start;
657 int in_size=ds_get_packet(ds,&start); 657 int in_size=ds_get_packet(ds,&start);
658 if( (file_format==DEMUXER_TYPE_AVI || file_format==DEMUXER_TYPE_ASF) 658 if( (file_format==DEMUXER_TYPE_AVI || file_format==DEMUXER_TYPE_ASF)
659 && stream_dump_type==2) fwrite(&in_size,1,4,f); 659 && stream_dump_type==2) fwrite(&in_size,1,4,f);
660 if(in_size>0) fwrite(start,in_size,1,f); 660 if(in_size>0) fwrite(start,in_size,1,f);
661 } 661 }
662 fclose(f); 662 fclose(f);
663 mp_msg(MSGT_CPLAYER,MSGL_INFO,"core dumped :)\n"); 663 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CoreDumped);
664 exit(1); 664 exit(1);
665 } 665 }
666 666
667 sh_audio=d_audio->sh; 667 sh_audio=d_audio->sh;
668 sh_video=d_video->sh; 668 sh_video=d_video->sh;
675 file_format,sh_video->format, sh_video->disp_w,sh_video->disp_h, 675 file_format,sh_video->format, sh_video->disp_w,sh_video->disp_h,
676 sh_video->fps,sh_video->frametime 676 sh_video->fps,sh_video->frametime
677 ); 677 );
678 678
679 if(!sh_video->fps && !force_fps){ 679 if(!sh_video->fps && !force_fps){
680 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"FPS not specified (or invalid) in the header! Use the -fps option!\n"); 680 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_FPSnotspecified);
681 exit(1); 681 exit(1);
682 } 682 }
683 683
684 } 684 }
685 685
686 fflush(stdout); 686 fflush(stdout);
687 687
688 if(!sh_video){ 688 if(!sh_video){
689 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"Sorry, no video stream... it's unplayable yet\n"); 689 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_NoVideoStream);
690 exit(1); 690 exit(1);
691 } 691 }
692 692
693 //================== Init AUDIO (codec) ========================== 693 //================== Init AUDIO (codec) ==========================
694 if(sh_audio){ 694 if(sh_audio){
695 // Go through the codec.conf and find the best codec... 695 // Go through the codec.conf and find the best codec...
696 sh_audio->codec=NULL; 696 sh_audio->codec=NULL;
697 if(audio_family!=-1) mp_msg(MSGT_CPLAYER,MSGL_INFO,"Trying to force audio codec driver family %d ...\n",audio_family); 697 if(audio_family!=-1) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceAudioFmt,audio_family);
698 while(1){ 698 while(1){
699 sh_audio->codec=find_codec(sh_audio->format,NULL,sh_audio->codec,1); 699 sh_audio->codec=find_codec(sh_audio->format,NULL,sh_audio->codec,1);
700 if(!sh_audio->codec){ 700 if(!sh_audio->codec){
701 if(audio_family!=-1) { 701 if(audio_family!=-1) {
702 sh_audio->codec=NULL; /* re-search */ 702 sh_audio->codec=NULL; /* re-search */
703 mp_msg(MSGT_CPLAYER,MSGL_ERR,"Can't find audio codec for forced driver family, fallback to other drivers.\n"); 703 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindAfmtFallback);
704 audio_family=-1; 704 audio_family=-1;
705 continue; 705 continue;
706 } 706 }
707 mp_msg(MSGT_CPLAYER,MSGL_ERR,"Can't find codec for audio format 0x%X !\n",sh_audio->format); 707 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindAudioCodec,sh_audio->format);
708 mp_msg(MSGT_CPLAYER,MSGL_HINT, "*** Try to upgrade %s from DOCS/codecs.conf\n",get_path("codecs.conf")); 708 mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
709 mp_msg(MSGT_CPLAYER,MSGL_HINT, "*** If it's still not OK, then read DOCS/CODECS!\n");
710 sh_audio=NULL; 709 sh_audio=NULL;
711 break; 710 break;
712 } 711 }
713 if(audio_codec && strcmp(sh_audio->codec->name,audio_codec)) continue; 712 if(audio_codec && strcmp(sh_audio->codec->name,audio_codec)) continue;
714 else if(audio_family!=-1 && sh_audio->codec->driver!=audio_family) continue; 713 else if(audio_family!=-1 && sh_audio->codec->driver!=audio_family) continue;
718 } 717 }
719 718
720 if(sh_audio){ 719 if(sh_audio){
721 mp_msg(MSGT_CPLAYER,MSGL_V,"Initializing audio codec...\n"); 720 mp_msg(MSGT_CPLAYER,MSGL_V,"Initializing audio codec...\n");
722 if(!init_audio(sh_audio)){ 721 if(!init_audio(sh_audio)){
723 mp_msg(MSGT_CPLAYER,MSGL_ERR,"Couldn't initialize audio codec! -> nosound\n"); 722 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CouldntInitAudioCodec);
724 sh_audio=0; 723 sh_audio=0;
725 } else { 724 } else {
726 mp_msg(MSGT_CPLAYER,MSGL_INFO,"AUDIO: srate=%d chans=%d bps=%d sfmt=0x%X ratio: %d->%d\n",sh_audio->samplerate,sh_audio->channels,sh_audio->samplesize, 725 mp_msg(MSGT_CPLAYER,MSGL_INFO,"AUDIO: srate=%d chans=%d bps=%d sfmt=0x%X ratio: %d->%d\n",sh_audio->samplerate,sh_audio->channels,sh_audio->samplesize,
727 sh_audio->sample_format,sh_audio->i_bps,sh_audio->o_bps); 726 sh_audio->sample_format,sh_audio->i_bps,sh_audio->o_bps);
728 } 727 }
730 729
731 //================== Init VIDEO (codec & libvo) ========================== 730 //================== Init VIDEO (codec & libvo) ==========================
732 731
733 // Go through the codec.conf and find the best codec... 732 // Go through the codec.conf and find the best codec...
734 sh_video->codec=NULL; 733 sh_video->codec=NULL;
735 if(video_family!=-1) mp_msg(MSGT_CPLAYER,MSGL_INFO,"Trying to force video codec driver family %d ...\n",video_family); 734 if(video_family!=-1) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceVideoFmt,video_family);
736 while(1){ 735 while(1){
737 sh_video->codec=find_codec(sh_video->format, 736 sh_video->codec=find_codec(sh_video->format,
738 sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,sh_video->codec,0); 737 sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,sh_video->codec,0);
739 if(!sh_video->codec){ 738 if(!sh_video->codec){
740 if(video_family!=-1) { 739 if(video_family!=-1) {
741 sh_video->codec=NULL; /* re-search */ 740 sh_video->codec=NULL; /* re-search */
742 mp_msg(MSGT_CPLAYER,MSGL_WARN,"Can't find video codec for forced driver family, fallback to other drivers.\n"); 741 mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_CantFindVfmtFallback);
743 video_family=-1; 742 video_family=-1;
744 continue; 743 continue;
745 } 744 }
746 mp_msg(MSGT_CPLAYER,MSGL_ERR,"Can't find codec for video format 0x%X !\n",sh_video->format); 745 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindVideoCodec,sh_video->format);
747 mp_msg(MSGT_CPLAYER,MSGL_HINT,"*** Try to upgrade %s from DOCS/codecs.conf\n",get_path("codecs.conf")); 746 mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
748 mp_msg(MSGT_CPLAYER,MSGL_HINT,"*** If it's still not OK, then read DOCS/CODECS!\n");
749 exit(1); 747 exit(1);
750 } 748 }
751 // is next line needed anymore? - atmos :: 749 // is next line needed anymore? - atmos ::
752 if(!allow_dshow && sh_video->codec->driver==VFM_DSHOW) continue; // skip DShow 750 if(!allow_dshow && sh_video->codec->driver==VFM_DSHOW) continue; // skip DShow
753 else if(video_codec && strcmp(sh_video->codec->name,video_codec)) continue; 751 else if(video_codec && strcmp(sh_video->codec->name,video_codec)) continue;
768 #endif 766 #endif
769 mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug: query(%s) returned 0x%X\n",vo_format_name(out_fmt),ret); 767 mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug: query(%s) returned 0x%X\n",vo_format_name(out_fmt),ret);
770 if(ret) break; 768 if(ret) break;
771 } 769 }
772 if(i>=CODECS_MAX_OUTFMT){ 770 if(i>=CODECS_MAX_OUTFMT){
773 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"Sorry, selected video_out device is incompatible with this codec.\n"); 771 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_VOincompCodec);
774 exit(1); 772 exit(1);
775 } 773 }
776 sh_video->outfmtidx=i; 774 sh_video->outfmtidx=i;
777 775
778 if(flip==-1){ 776 if(flip==-1){
784 } 782 }
785 783
786 mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug1: out_fmt=%s\n",vo_format_name(out_fmt)); 784 mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug1: out_fmt=%s\n",vo_format_name(out_fmt));
787 785
788 if(!init_video(sh_video)){ 786 if(!init_video(sh_video)){
789 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"FATAL: Couldn't initialize video codec :(\n"); 787 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CouldntInitVideoCodec);
790 exit(1); 788 exit(1);
791 } 789 }
792 790
793 if(auto_quality>0){ 791 if(auto_quality>0){
794 // Auto quality option enabled 792 // Auto quality option enabled
803 if(encode_name){ 801 if(encode_name){
804 // encode file!!! 802 // encode file!!!
805 FILE *encode_file=fopen(encode_name,"rb"); 803 FILE *encode_file=fopen(encode_name,"rb");
806 if(encode_file){ 804 if(encode_file){
807 fclose(encode_file); 805 fclose(encode_file);
808 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"File already exists: %s (don't overwrite your favourite AVI!)\n",encode_name); 806 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_EncodeFileExists,encode_name);
809 return 0; 807 return 0;
810 } 808 }
811 encode_file=fopen(encode_name,"wb"); 809 encode_file=fopen(encode_name,"wb");
812 if(!encode_file){ 810 if(!encode_file){
813 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"Cannot create file for encoding\n"); 811 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CantCreateEncodeFile);
814 return 0; 812 return 0;
815 } 813 }
816 write_avi_header_1(encode_file,mmioFOURCC('d', 'i', 'v', 'x'),sh_video->fps,sh_video->disp_w,sh_video->disp_h); 814 write_avi_header_1(encode_file,mmioFOURCC('d', 'i', 'v', 'x'),sh_video->fps,sh_video->disp_w,sh_video->disp_h);
817 fclose(encode_file); 815 fclose(encode_file);
818 encode_index_name=malloc(strlen(encode_name)+8); 816 encode_index_name=malloc(strlen(encode_name)+8);
890 888
891 #ifdef USE_LIBVO2 889 #ifdef USE_LIBVO2
892 if(!vo2_start(video_out, 890 if(!vo2_start(video_out,
893 sh_video->disp_w,sh_video->disp_h,out_fmt,0, 891 sh_video->disp_w,sh_video->disp_h,out_fmt,0,
894 fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3) )){ 892 fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3) )){
895 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"FATAL: Cannot initialize video driver!\n"); 893 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CannotInitVO );
896 exit(1); 894 exit(1);
897 } 895 }
898 #else 896 #else
899 if(video_out->init(sh_video->disp_w,sh_video->disp_h, 897 if(video_out->init(sh_video->disp_w,sh_video->disp_h,
900 screen_size_x,screen_size_y, 898 screen_size_x,screen_size_y,
901 fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3), 899 fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
902 title,out_fmt)){ 900 title,out_fmt)){
903 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"FATAL: Cannot initialize video driver!\n"); 901 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CannotInitVO);
904 exit(1); 902 exit(1);
905 } 903 }
906 #endif 904 #endif
907 mp_msg(MSGT_CPLAYER,MSGL_V,"INFO: Video OUT driver init OK!\n"); 905 mp_msg(MSGT_CPLAYER,MSGL_V,"INFO: Video OUT driver init OK!\n");
908 906
982 ); 980 );
983 if(strlen(info->comment) > 0) 981 if(strlen(info->comment) > 0)
984 mp_msg(MSGT_CPLAYER,MSGL_V,"AO: Comment: %s\n", info->comment); 982 mp_msg(MSGT_CPLAYER,MSGL_V,"AO: Comment: %s\n", info->comment);
985 if(!audio_out->init(force_srate?force_srate:sh_audio->samplerate, 983 if(!audio_out->init(force_srate?force_srate:sh_audio->samplerate,
986 sh_audio->channels,sh_audio->sample_format,0)){ 984 sh_audio->channels,sh_audio->sample_format,0)){
987 mp_msg(MSGT_CPLAYER,MSGL_ERR,"couldn't open/init audio device -> NOSOUND\n"); 985 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CannotInitAO);
988 sh_audio=0; audio_out=NULL; 986 sh_audio=0; audio_out=NULL;
989 } 987 }
990 988
991 // printf("Audio buffer size: %d bytes, delay: %5.3fs\n",audio_buffer_size,audio_buffer_delay); 989 // printf("Audio buffer size: %d bytes, delay: %5.3fs\n",audio_buffer_size,audio_buffer_delay);
992 990
1039 sh_video->fps=force_fps; 1037 sh_video->fps=force_fps;
1040 sh_video->frametime=1.0f/sh_video->fps; 1038 sh_video->frametime=1.0f/sh_video->fps;
1041 mp_msg(MSGT_CPLAYER,MSGL_INFO,"FPS forced to be %5.3f (ftime: %5.3f)\n",sh_video->fps,sh_video->frametime); 1039 mp_msg(MSGT_CPLAYER,MSGL_INFO,"FPS forced to be %5.3f (ftime: %5.3f)\n",sh_video->fps,sh_video->frametime);
1042 } 1040 }
1043 1041
1044 mp_msg(MSGT_CPLAYER,MSGL_INFO,"Start playing...\n");fflush(stdout); 1042 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_StartPlaying);fflush(stdout);
1045 1043
1046 InitTimer(); 1044 InitTimer();
1047 1045
1048 total_time_usage_start=GetTimer(); 1046 total_time_usage_start=GetTimer();
1049 1047
1051 unsigned int aq_total_time=GetTimer(); 1049 unsigned int aq_total_time=GetTimer();
1052 float aq_sleep_time=0; 1050 float aq_sleep_time=0;
1053 1051
1054 if(play_n_frames>=0){ 1052 if(play_n_frames>=0){
1055 --play_n_frames; 1053 --play_n_frames;
1056 if(play_n_frames<0) exit_player("Requested number of frames played"); 1054 if(play_n_frames<0) exit_player(MSGTR_Exit_frames);
1057 } 1055 }
1058 1056
1059 /*========================== PLAY AUDIO ============================*/ 1057 /*========================== PLAY AUDIO ============================*/
1060 while(sh_audio){ 1058 while(sh_audio){
1061 unsigned int t; 1059 unsigned int t;
1261 static int drop_message=0; 1259 static int drop_message=0;
1262 drop_frame=frame_dropping; // tricky! 1260 drop_frame=frame_dropping; // tricky!
1263 ++drop_frame_cnt; 1261 ++drop_frame_cnt;
1264 if(drop_frame_cnt>50 && AV_delay>0.5 && !drop_message){ 1262 if(drop_frame_cnt>50 && AV_delay>0.5 && !drop_message){
1265 drop_message=1; 1263 drop_message=1;
1266 mp_msg(MSGT_AVSYNC,MSGL_WARN, 1264 mp_msg(MSGT_AVSYNC,MSGL_WARN,MSGTR_SystemTooSlow);
1267 "\n************************************************************************"
1268 "\n** Your system is too SLOW to play this! try with -framedrop or RTFM! **"
1269 "\n************************************************************************"
1270 "\n");
1271 } 1265 }
1272 mp_msg(MSGT_AVSYNC,MSGL_DBG2,"\nframe drop %d, %.2f\n", drop_frame, time_frame); 1266 mp_msg(MSGT_AVSYNC,MSGL_DBG2,"\nframe drop %d, %.2f\n", drop_frame, time_frame);
1273 } 1267 }
1274 } else { 1268 } else {
1275 if( (time_frame<-3*frame_time || time_frame>3*frame_time) || benchmark) 1269 if( (time_frame<-3*frame_time || time_frame>3*frame_time) || benchmark)
1506 if(sh_audio) sh_audio->timer+=0.1; 1500 if(sh_audio) sh_audio->timer+=0.1;
1507 break; 1501 break;
1508 // quit 1502 // quit
1509 case KEY_ESC: // ESC 1503 case KEY_ESC: // ESC
1510 case KEY_ENTER: // ESC 1504 case KEY_ENTER: // ESC
1511 case 'q': exit_player("Quit"); 1505 case 'q': exit_player(MSGTR_Exit_quit);
1512 case 'g': grab_frames=2;break; 1506 case 'g': grab_frames=2;break;
1513 // pause 1507 // pause
1514 case 'p': 1508 case 'p':
1515 case ' ': 1509 case ' ':
1516 osd_function=OSD_PAUSE; 1510 osd_function=OSD_PAUSE;
1738 1732
1739 } // while(!eof) 1733 } // while(!eof)
1740 1734
1741 mp_msg(MSGT_GLOBAL,MSGL_V,"EOF code: %d \n",eof); 1735 mp_msg(MSGT_GLOBAL,MSGL_V,"EOF code: %d \n",eof);
1742 1736
1743 exit_player("End of file"); 1737 exit_player(MSGTR_Exit_eof);
1744 } 1738 }
1745 return 1; 1739 return 1;
1746 } 1740 }