comparison mplayer.c @ 1660:0ed5a9568d0f

file_format -> demuxer->file_format
author arpi
date Thu, 23 Aug 2001 13:21:21 +0000
parents 9d85b84e367e
children dab7950fe1c3
comparison
equal deleted inserted replaced
1659:6b71bbf515e4 1660:0ed5a9568d0f
700 current_module="demux_open"; 700 current_module="demux_open";
701 701
702 demuxer=demux_open(stream,file_format,audio_id,video_id,dvdsub_id); 702 demuxer=demux_open(stream,file_format,audio_id,video_id,dvdsub_id);
703 if(!demuxer) goto goto_next_file; // exit_player(MSGTR_Exit_error); // ERROR 703 if(!demuxer) goto goto_next_file; // exit_player(MSGTR_Exit_error); // ERROR
704 704
705 file_format=demuxer->file_format; 705 //file_format=demuxer->file_format;
706 706
707 d_audio=demuxer->audio; 707 d_audio=demuxer->audio;
708 d_video=demuxer->video; 708 d_video=demuxer->video;
709 d_dvdsub=demuxer->sub; 709 d_dvdsub=demuxer->sub;
710 710
734 exit_player(MSGTR_Exit_error); 734 exit_player(MSGTR_Exit_error);
735 } 735 }
736 while(!ds->eof){ 736 while(!ds->eof){
737 unsigned char* start; 737 unsigned char* start;
738 int in_size=ds_get_packet(ds,&start); 738 int in_size=ds_get_packet(ds,&start);
739 if( (file_format==DEMUXER_TYPE_AVI || file_format==DEMUXER_TYPE_ASF) 739 if( (demuxer->file_format==DEMUXER_TYPE_AVI || demuxer->file_format==DEMUXER_TYPE_ASF)
740 && stream_dump_type==2) fwrite(&in_size,1,4,f); 740 && stream_dump_type==2) fwrite(&in_size,1,4,f);
741 if(in_size>0) fwrite(start,in_size,1,f); 741 if(in_size>0) fwrite(start,in_size,1,f);
742 } 742 }
743 fclose(f); 743 fclose(f);
744 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CoreDumped); 744 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CoreDumped);
753 if(sh_video){ 753 if(sh_video){
754 754
755 if(!video_read_properties(sh_video)) goto goto_next_file; // exit_player(MSGTR_Exit_error); // couldn't read header? 755 if(!video_read_properties(sh_video)) goto goto_next_file; // exit_player(MSGTR_Exit_error); // couldn't read header?
756 756
757 mp_msg(MSGT_CPLAYER,MSGL_INFO,"[V] filefmt:%d fourcc:0x%X size:%dx%d fps:%5.2f ftime:=%6.4f\n", 757 mp_msg(MSGT_CPLAYER,MSGL_INFO,"[V] filefmt:%d fourcc:0x%X size:%dx%d fps:%5.2f ftime:=%6.4f\n",
758 file_format,sh_video->format, sh_video->disp_w,sh_video->disp_h, 758 demuxer->file_format,sh_video->format, sh_video->disp_w,sh_video->disp_h,
759 sh_video->fps,sh_video->frametime 759 sh_video->fps,sh_video->frametime
760 ); 760 );
761 761
762 if(!sh_video->fps && !force_fps){ 762 if(!sh_video->fps && !force_fps){
763 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_FPSnotspecified); 763 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_FPSnotspecified);
1060 if(audio_out){ audio_out->uninit(); audio_out=NULL;} // close device 1060 if(audio_out){ audio_out->uninit(); audio_out=NULL;} // close device
1061 } 1061 }
1062 1062
1063 current_module=NULL; 1063 current_module=NULL;
1064 1064
1065 if(file_format!=DEMUXER_TYPE_AVI) pts_from_bps=0; // it must be 0 for mpeg/asf! 1065 if(demuxer->file_format!=DEMUXER_TYPE_AVI) pts_from_bps=0; // it must be 0 for mpeg/asf!
1066 if(force_fps){ 1066 if(force_fps){
1067 sh_video->fps=force_fps; 1067 sh_video->fps=force_fps;
1068 sh_video->frametime=1.0f/sh_video->fps; 1068 sh_video->frametime=1.0f/sh_video->fps;
1069 mp_msg(MSGT_CPLAYER,MSGL_INFO,"FPS forced to be %5.3f (ftime: %5.3f)\n",sh_video->fps,sh_video->frametime); 1069 mp_msg(MSGT_CPLAYER,MSGL_INFO,"FPS forced to be %5.3f (ftime: %5.3f)\n",sh_video->fps,sh_video->frametime);
1070 } 1070 }
1158 1158
1159 //-------------------- Decode a frame: ----------------------- 1159 //-------------------- Decode a frame: -----------------------
1160 1160
1161 vdecode_time=video_time_usage; 1161 vdecode_time=video_time_usage;
1162 1162
1163 if(file_format==DEMUXER_TYPE_MPEG_ES || file_format==DEMUXER_TYPE_MPEG_PS){ 1163 if(demuxer->file_format==DEMUXER_TYPE_MPEG_ES || demuxer->file_format==DEMUXER_TYPE_MPEG_PS){
1164 int in_frame=0; 1164 int in_frame=0;
1165 float newfps; 1165 float newfps;
1166 //videobuf_len=0; 1166 //videobuf_len=0;
1167 while(videobuf_len<VIDEOBUFFER_SIZE-MAX_VIDEO_PACKET_SIZE){ 1167 while(videobuf_len<VIDEOBUFFER_SIZE-MAX_VIDEO_PACKET_SIZE){
1168 int i=sync_video_packet(d_video); 1168 int i=sync_video_packet(d_video);
1239 1239
1240 // Increase video timers: 1240 // Increase video timers:
1241 sh_video->num_frames+=frame_time; 1241 sh_video->num_frames+=frame_time;
1242 ++sh_video->num_frames_decoded; 1242 ++sh_video->num_frames_decoded;
1243 frame_time*=sh_video->frametime; 1243 frame_time*=sh_video->frametime;
1244 if(file_format==DEMUXER_TYPE_ASF && !force_fps){ 1244 if(demuxer->file_format==DEMUXER_TYPE_ASF && !force_fps){
1245 // .ASF files has no fixed FPS - just frame durations! 1245 // .ASF files has no fixed FPS - just frame durations!
1246 float d=d_video->pts-pts1; 1246 float d=d_video->pts-pts1;
1247 if(d>=0 && d<5) frame_time=d; 1247 if(d>=0 && d<5) frame_time=d;
1248 if(d>0){ 1248 if(d>0){
1249 if(verbose) 1249 if(verbose)
1254 } 1254 }
1255 } 1255 }
1256 sh_video->timer+=frame_time; 1256 sh_video->timer+=frame_time;
1257 time_frame+=frame_time; // for nosound 1257 time_frame+=frame_time; // for nosound
1258 1258
1259 if(file_format==DEMUXER_TYPE_MPEG_PS) d_video->pts+=frame_time; 1259 if(demuxer->file_format==DEMUXER_TYPE_MPEG_PS) d_video->pts+=frame_time;
1260 1260
1261 mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"*** ftime=%5.3f ***\n",frame_time); 1261 mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"*** ftime=%5.3f ***\n",frame_time);
1262 1262
1263 if(drop_frame){ 1263 if(drop_frame){
1264 1264