Update of /cvsroot/mplayer/main In directory usw-pr-cvs1:/tmp/cvs-serv7279 Modified Files: mplayer.c Log Message: removed dummy audio track for -nosound, vo: flip detection Index: mplayer.c =================================================================== RCS file: /cvsroot/mplayer/main/mplayer.c,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -r1.114 -r1.115 *** mplayer.c 2001/05/11 14:40:19 1.114 --- mplayer.c 2001/05/12 01:57:18 1.115 *************** *** 476,480 **** int vidmode=0; int softzoom=0; ! int flip=0; int screen_size_x=0;//SCREEN_SIZE_X; int screen_size_y=0;//SCREEN_SIZE_Y; --- 476,480 ---- int vidmode=0; int softzoom=0; ! int flip=-1; int screen_size_x=0;//SCREEN_SIZE_X; int screen_size_y=0;//SCREEN_SIZE_Y; *************** *** 752,755 **** --- 752,758 ---- //sh_video=d_video->sh;sh_video->ds=d_video; + sh_audio=NULL; + sh_video=NULL; + switch(file_format){ case DEMUXER_TYPE_AVI: { *************** *** 796,800 **** if(a_pos==-1){ printf("AVI_NI: No audio stream found -> nosound\n"); ! has_audio=0; } else { if(force_ni || abs(a_pos-v_pos)>0x100000){ // distance > 1MB --- 799,803 ---- if(a_pos==-1){ printf("AVI_NI: No audio stream found -> nosound\n"); ! has_audio=0;sh_audio=NULL; } else { if(force_ni || abs(a_pos-v_pos)>0x100000){ // distance > 1MB *************** *** 824,829 **** if(!ds_fill_buffer(d_audio)){ printf("AVI: No Audio stream found... ->nosound\n"); ! has_audio=0; ! sh_audio=NULL; } else { sh_audio=d_audio->sh;sh_audio->ds=d_audio; --- 827,831 ---- if(!ds_fill_buffer(d_audio)){ printf("AVI: No Audio stream found... ->nosound\n"); ! has_audio=0;sh_audio=NULL; } else { sh_audio=d_audio->sh;sh_audio->ds=d_audio; *************** *** 857,871 **** // demuxer->endpos=avi_header.movi_end; if(!ds_fill_buffer(d_video)){ ! printf("ASF: missing video stream!? contact the author, it may be a bug :(\n"); ! GUI_MSG( mplASFErrorMissingVideoStream ) ! exit(1); } - sh_video=d_video->sh;sh_video->ds=d_video; if(has_audio){ if(verbose) printf("ASF: Searching for audio stream (id:%d)\n",d_audio->id); if(!ds_fill_buffer(d_audio)){ printf("ASF: No Audio stream found... ->nosound\n"); ! has_audio=0; ! sh_audio=NULL; } else { sh_audio=d_audio->sh;sh_audio->ds=d_audio; --- 859,881 ---- // demuxer->endpos=avi_header.movi_end; if(!ds_fill_buffer(d_video)){ ! printf("ASF: no video stream found!\n"); ! sh_video=NULL; ! //printf("ASF: missing video stream!? contact the author, it may be a bug :(\n"); ! //GUI_MSG( mplASFErrorMissingVideoStream ) ! //exit(1); ! } else { ! sh_video=d_video->sh;sh_video->ds=d_video; ! sh_video->fps=1000.0f; sh_video->frametime=0.001f; // 1ms ! printf("VIDEO: [%.4s] %ldx%ld %dbpp\n", ! (char *)&sh_video->bih->biCompression, ! sh_video->bih->biWidth, ! sh_video->bih->biHeight, ! sh_video->bih->biBitCount); } if(has_audio){ if(verbose) printf("ASF: Searching for audio stream (id:%d)\n",d_audio->id); if(!ds_fill_buffer(d_audio)){ printf("ASF: No Audio stream found... ->nosound\n"); ! has_audio=0;sh_audio=NULL; } else { sh_audio=d_audio->sh;sh_audio->ds=d_audio; *************** *** 873,882 **** } } - sh_video->fps=1000.0f; sh_video->frametime=0.001f; // 1ms - printf("VIDEO: [%.4s] %ldx%ld %dbpp\n", - (char *)&sh_video->bih->biCompression, - sh_video->bih->biWidth, - sh_video->bih->biHeight, - sh_video->bih->biBitCount); break; } --- 883,886 ---- *************** *** 899,903 **** case 2: sh_audio->format=0x10001;break; // dvd pcm case 3: sh_audio->format=0x2000;break; // ac3 ! default: has_audio=0; // unknown type } } --- 903,907 ---- case 2: sh_audio->format=0x10001;break; // dvd pcm case 3: sh_audio->format=0x2000;break; // ac3 ! default: has_audio=0;sh_audio=NULL; // unknown type } } *************** *** 912,918 **** case DEMUXER_TYPE_ASF: { // display info: ! sh_video->format=sh_video->bih->biCompression; ! sh_video->disp_w=sh_video->bih->biWidth; ! sh_video->disp_h=abs(sh_video->bih->biHeight); break; } --- 916,924 ---- case DEMUXER_TYPE_ASF: { // display info: ! if(sh_video){ ! sh_video->format=sh_video->bih->biCompression; ! sh_video->disp_w=sh_video->bih->biWidth; ! sh_video->disp_h=abs(sh_video->bih->biHeight); ! } break; } *************** *** 986,989 **** --- 992,996 ---- //if(verbose) printf("file successfully opened (has_audio=%d)\n",has_audio); + if(sh_video) printf("[V] filefmt:%d fourcc:0x%X size:%dx%d fps:%5.2f ftime:=%6.4f\n", file_format,sh_video->format,sh_video->disp_w,sh_video->disp_h, *************** *** 996,1002 **** FILE *f; int len; ! demux_stream_t *ds=(stream_dump_type==1)?d_audio:d_video; ! demux_stream_t *ds2=(stream_dump_type!=1)?d_audio:d_video; ! ds_free_packs(ds2); ds2->id=-2; // ignore this stream! f=fopen(stream_dump_name?stream_dump_name:"stream.dump","wb"); if(!f){ printf("Can't open dump file!!!\n");exit(1); } --- 1003,1022 ---- FILE *f; int len; ! demux_stream_t *ds=NULL; ! // select stream to dump ! switch(stream_dump_type){ ! case 1: ds=d_audio;break; ! case 2: ds=d_video;break; ! case 3: ds=d_dvdsub;break; ! } ! if(!ds){ ! printf("dump: FATAL: selected stream missing!\n"); ! exit(1); ! } ! // disable other streams: ! if(d_audio && d_audio!=ds) {ds_free_packs(d_audio); d_audio->id=-2; } ! if(d_video && d_video!=ds) {ds_free_packs(d_video); d_video->id=-2; } ! if(d_dvdsub && d_dvdsub!=ds) {ds_free_packs(d_dvdsub); d_dvdsub->id=-2; } ! // let's dump it! f=fopen(stream_dump_name?stream_dump_name:"stream.dump","wb"); if(!f){ printf("Can't open dump file!!!\n");exit(1); } *************** *** 1011,1014 **** --- 1031,1039 ---- } + if(!sh_video){ + printf("Sorry, no video stream... it's unplayable yet\n"); + exit(1); + } + //================== Init AUDIO (codec) ========================== if(has_audio){ *************** *** 1081,1084 **** --- 1106,1117 ---- sh_video->outfmtidx=i; + if(flip==-1){ + // autodetect flipping + flip=0; + if(sh_video->codec->outflags[i]&CODECS_FLAG_FLIP) + if(!(sh_video->codec->outflags[i]&CODECS_FLAG_NOFLIP)) + flip=1; + } + if(verbose) printf("vo_debug1: out_fmt=0x%08X\n",out_fmt); *************** *** 1231,1235 **** vidmode?"vm ":"", softzoom?"zoom ":"", ! flip?"flip ":"" // fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3) ); --- 1264,1268 ---- vidmode?"vm ":"", softzoom?"zoom ":"", ! (flip==1)?"flip ":"" // fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3) ); *************** *** 1446,1453 **** --- 1479,1490 ---- alsa=1; // fake, required for timer: + #if 1 + sh_audio=NULL; + #else sh_audio=new_sh_audio(255); // FIXME!!!!!!!!!! sh_audio->samplerate=76800; sh_audio->samplesize=sh_audio->channels=2; sh_audio->o_bps=sh_audio->channels*sh_audio->samplerate*sh_audio->samplesize; + #endif } *************** *** 1456,1460 **** //==================== START PLAYING ======================= ! if(file_format==DEMUXER_TYPE_AVI){ a_pts=d_audio->pts; audio_delay-=(float)(sh_audio->audio.dwInitialFrames-sh_video->video.dwInitialFrames)*sh_video->frametime; --- 1493,1497 ---- //==================== START PLAYING ======================= ! if(file_format==DEMUXER_TYPE_AVI && has_audio){ a_pts=d_audio->pts; audio_delay-=(float)(sh_audio->audio.dwInitialFrames-sh_video->video.dwInitialFrames)*sh_video->frametime; *************** *** 1481,1491 **** /*========================== PLAY AUDIO ============================*/ ! if(!has_audio){ ! int playsize=512; ! a_frame+=playsize/(float)(sh_audio->o_bps); ! a_pts+=playsize/(float)(sh_audio->o_bps); //time_frame+=playsize/(float)(sh_audio->o_bps); ! ! } else while(has_audio){ unsigned int t; --- 1518,1527 ---- /*========================== PLAY AUDIO ============================*/ ! //if(!has_audio){ ! // int playsize=512; ! // a_frame+=playsize/(float)(sh_audio->o_bps); ! // a_pts+=playsize/(float)(sh_audio->o_bps); //time_frame+=playsize/(float)(sh_audio->o_bps); ! //} else while(has_audio){ unsigned int t; *************** *** 2010,2018 **** // clear demux buffers: ! if(has_audio) ds_free_packs(d_audio); ds_free_packs(d_video); // printf("sh_audio->a_buffer_len=%d \n",sh_audio->a_buffer_len); ! sh_audio->a_buffer_len=0; switch(file_format){ --- 2046,2054 ---- // clear demux buffers: ! if(has_audio){ ds_free_packs(d_audio);sh_audio->a_buffer_len=0;} ds_free_packs(d_video); // printf("sh_audio->a_buffer_len=%d \n",sh_audio->a_buffer_len); ! switch(file_format){ _______________________________________________ Mplayer-cvslog mailing list Mplayer-cvslog@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
participants (1)
-
GEREOFFY