Mercurial > mplayer.hg
changeset 458:49b0474b2e26
I really hope that you will learn how to use cvs, sooner or later...
author | arpi_esp |
---|---|
date | Sun, 15 Apr 2001 23:22:01 +0000 |
parents | cc7e37b09748 |
children | 9dfad88a8107 |
files | cfg-mplayer.h libvo/x11_common.c mplayer.c |
diffstat | 3 files changed, 145 insertions(+), 167 deletions(-) [+] |
line wrap: on
line diff
--- a/cfg-mplayer.h Sun Apr 15 23:10:05 2001 +0000 +++ b/cfg-mplayer.h Sun Apr 15 23:22:01 2001 +0000 @@ -12,14 +12,12 @@ #endif struct config conf[]={ - /* name, pointer, type, flags, min, max */ - {"include", cfg_include, CONF_TYPE_FUNC_PARAM, 0, 0, 0}, /* this must be the first!!! */ - {"o", "Option -o has been renamed to -vo (video-out), use -vo !\n", + /* name, pointer, type, flags, min, max */ + {"include", cfg_include, CONF_TYPE_FUNC_PARAM, 0, 0, 0}, /* this must be the first!!! */ + {"o", "Option -o has been renamed to -vo (video-out), use -vo !\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0}, - {"vo", &video_driver, CONF_TYPE_STRING, 0, 0, 0}, - {"dsp", &dsp, CONF_TYPE_STRING, 0, 0, 0}, - {"mixer", &mixer_device, CONF_TYPE_STRING, 0, 0, 0}, - {"master", &mixer_usemaster, CONF_TYPE_FLAG, 0, 0, 1}, + {"vo", &video_driver, CONF_TYPE_STRING, 0, 0, 0}, + {"dsp", &dsp, CONF_TYPE_STRING, 0, 0, 0}, #ifdef HAVE_FBDEV {"fb", &fb_dev_name, CONF_TYPE_STRING, 0, 0, 0}, {"fbmode", &fb_mode_name, CONF_TYPE_STRING, 0, 0, 0}, @@ -28,58 +26,58 @@ {"monitor_vfreq", &monitor_vfreq_str, CONF_TYPE_STRING, 0, 0, 0}, {"monitor_dotclock", &monitor_dotclock_str, CONF_TYPE_STRING, 0, 0, 0}, #endif - {"encode", &encode_name, CONF_TYPE_STRING, 0, 0, 0}, - {"sub", &sub_name, CONF_TYPE_STRING, 0, 0, 0}, - {"subdelay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0}, - {"subfps", &sub_fps, CONF_TYPE_FLOAT, 0, 0.0, 10.0}, - {"font", &font_name, CONF_TYPE_STRING, 0, 0, 0}, - {"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0}, - {"bg", &play_in_bg, CONF_TYPE_FLAG, 0, 0, 1}, - {"nobg", &play_in_bg, CONF_TYPE_FLAG, 0, 1, 0}, - {"sb", &seek_to_byte, CONF_TYPE_INT, CONF_MIN, 0, 0}, -// {"ss", &seek_to_sec, CONF_TYPE_INT, CONF_MIN, 0, 0}, - {"sound", &has_audio, CONF_TYPE_FLAG, 0, 0, 1}, - {"nosound", &has_audio, CONF_TYPE_FLAG, 0, 1, 0}, - {"abs", &audio_buffer_size, CONF_TYPE_INT, CONF_MIN, 0, 0}, - {"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0}, - {"bps", &pts_from_bps, CONF_TYPE_FLAG, 0, 0, 1}, - {"nobps", &pts_from_bps, CONF_TYPE_FLAG, 0, 1, 0}, - {"alsa", &alsa, CONF_TYPE_FLAG, 0, 0, 1}, - {"noalsa", &alsa, CONF_TYPE_FLAG, 0, 1, 0}, - {"ni", &force_ni, CONF_TYPE_FLAG, 0, 0, 1}, - {"noni", &force_ni, CONF_TYPE_FLAG, 0, 1, 0}, - {"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 256}, - {"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, 0, 256}, -// {"auds", &avi_header.audio_codec, CONF_TYPE_STRING, 0, 0, 0}, -// {"vids", &avi_header.video_codec, CONF_TYPE_STRING, 0, 0, 0}, - {"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10}, - {"fps", &force_fps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0}, - {"afm", &audio_format, CONF_TYPE_INT, CONF_RANGE, 1, 6}, - {"vcd", &vcd_track, CONF_TYPE_INT, CONF_RANGE, 1, 99}, - {"divxq", "Option -divxq has been renamed to -pp (postprocessing), use -pp !\n", + {"encode", &encode_name, CONF_TYPE_STRING, 0, 0, 0}, + {"sub", &sub_name, CONF_TYPE_STRING, 0, 0, 0}, + {"subdelay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0}, + {"subfps", &sub_fps, CONF_TYPE_FLOAT, 0, 0.0, 10.0}, + {"font", &font_name, CONF_TYPE_STRING, 0, 0, 0}, + {"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0}, + {"bg", &play_in_bg, CONF_TYPE_FLAG, 0, 0, 1}, + {"nobg", &play_in_bg, CONF_TYPE_FLAG, 0, 1, 0}, + {"sb", &seek_to_byte, CONF_TYPE_INT, CONF_MIN, 0, 0}, +// {"ss", &seek_to_sec, CONF_TYPE_INT, CONF_MIN, 0, 0}, + {"sound", &has_audio, CONF_TYPE_FLAG, 0, 0, 1}, + {"nosound", &has_audio, CONF_TYPE_FLAG, 0, 1, 0}, + {"abs", &audio_buffer_size, CONF_TYPE_INT, CONF_MIN, 0, 0}, + {"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0}, + {"bps", &pts_from_bps, CONF_TYPE_FLAG, 0, 0, 1}, + {"nobps", &pts_from_bps, CONF_TYPE_FLAG, 0, 1, 0}, + {"alsa", &alsa, CONF_TYPE_FLAG, 0, 0, 1}, + {"noalsa", &alsa, CONF_TYPE_FLAG, 0, 1, 0}, + {"ni", &force_ni, CONF_TYPE_FLAG, 0, 0, 1}, + {"noni", &force_ni, CONF_TYPE_FLAG, 0, 1, 0}, + {"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 256}, + {"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, 0, 256}, +// {"auds", &avi_header.audio_codec, CONF_TYPE_STRING, 0, 0, 0}, +// {"vids", &avi_header.video_codec, CONF_TYPE_STRING, 0, 0, 0}, + {"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10}, + {"fps", &force_fps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0}, + {"afm", &audio_format, CONF_TYPE_INT, CONF_RANGE, 1, 6}, + {"vcd", &vcd_track, CONF_TYPE_INT, CONF_RANGE, 1, 99}, + {"divxq", "Option -divxq has been renamed to -pp (postprocessing), use -pp !\n", CONF_TYPE_PRINT, 0, 0, 0}, - {"pp", &divx_quality, CONF_TYPE_INT, CONF_RANGE, 0, 63}, - {"br", &encode_bitrate, CONF_TYPE_INT, CONF_RANGE, 10000, 10000000}, + {"pp", &divx_quality, CONF_TYPE_INT, CONF_RANGE, 0, 63}, + {"br", &encode_bitrate, CONF_TYPE_INT, CONF_RANGE, 10000, 10000000}, - {"x", &screen_size_x, CONF_TYPE_INT, CONF_RANGE, 1, 4096}, - {"y", &screen_size_y, CONF_TYPE_INT, CONF_RANGE, 1, 4096}, - {"xy", &screen_size_xy, CONF_TYPE_INT, CONF_RANGE, 1, 4096}, + {"x", &screen_size_x, CONF_TYPE_INT, CONF_RANGE, 1, 4096}, + {"y", &screen_size_y, CONF_TYPE_INT, CONF_RANGE, 1, 4096}, + {"xy", &screen_size_xy, CONF_TYPE_INT, CONF_RANGE, 1, 4096}, {"vm", &vidmode, CONF_TYPE_FLAG, 0, 0, 1}, {"novm", &vidmode, CONF_TYPE_FLAG, 0, 1, 0}, - {"fs", &fullscreen, CONF_TYPE_FLAG, 0, 0, 1}, - {"nofs", &fullscreen, CONF_TYPE_FLAG, 0, 1, 0}, + {"fs", &fullscreen, CONF_TYPE_FLAG, 0, 0, 1}, + {"nofs", &fullscreen, CONF_TYPE_FLAG, 0, 1, 0}, {"zoom", &softzoom, CONF_TYPE_FLAG, 0, 0, 1}, {"nozoom", &softzoom, CONF_TYPE_FLAG, 0, 1, 0}, - + {"bpp", &vo_dbpp, CONF_TYPE_INT, CONF_RANGE, 0, 32}, - - {"idx", &no_index, CONF_TYPE_FLAG, 0, 1, 0}, - {"noidx", &no_index, CONF_TYPE_FLAG, 0, 0, 1}, - {"verbose", &verbose, CONF_TYPE_INT, CONF_RANGE, 0, 100}, - {"v", cfg_inc_verbose, CONF_TYPE_FUNC, 0, 0, 0}, - {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0}, - {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0}, - {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0}, - {NULL, NULL, 0, 0, 0, 0} + + {"idx", &no_index, CONF_TYPE_FLAG, 0, 1, 0}, + {"noidx", &no_index, CONF_TYPE_FLAG, 0, 0, 1}, + {"verbose", &verbose, CONF_TYPE_INT, CONF_RANGE, 0, 100}, + {"v", cfg_inc_verbose, CONF_TYPE_FUNC, 0, 0, 0}, + {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0}, + {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0}, + {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0}, + {NULL, NULL, 0, 0, 0, 0} };
--- a/libvo/x11_common.c Sun Apr 15 23:10:05 2001 +0000 +++ b/libvo/x11_common.c Sun Apr 15 23:22:01 2001 +0000 @@ -25,17 +25,17 @@ void vo_hidecursor ( Display *disp , Window win ) { - Cursor no_ptr; - Pixmap bm_no; - XColor black,dummy; - Colormap colormap; - static unsigned char bm_no_data[] = { 0,0,0,0, 0,0,0,0 }; - - colormap = DefaultColormap(disp,DefaultScreen(disp)); - XAllocNamedColor(disp,colormap,"black",&black,&dummy); - bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8,8); - no_ptr=XCreatePixmapCursor(disp, bm_no, bm_no,&black, &black,0, 0); - XDefineCursor(disp,win,no_ptr); + Cursor no_ptr; + Pixmap bm_no; + XColor black,dummy; + Colormap colormap; + static unsigned char bm_no_data[] = { 0,0,0,0, 0,0,0,0 }; + + colormap = DefaultColormap(disp,DefaultScreen(disp)); + XAllocNamedColor(disp,colormap,"black",&black,&dummy); + bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8,8); + no_ptr=XCreatePixmapCursor(disp, bm_no, bm_no,&black, &black,0, 0); + XDefineCursor(disp,win,no_ptr); } @@ -100,10 +100,6 @@ case wsGrayMinus: mplayer_put_key('-'); break; case wsPlus: case wsGrayPlus: mplayer_put_key('+'); break; - case wsGrayMul: - case wsMul: mplayer_put_key('*'); break; - case wsGrayDiv: - case wsDiv: mplayer_put_key('/'); break; default: if((key>='a' && key<='z')||(key>='A' && key<='Z')) mplayer_put_key(key); } @@ -157,17 +153,17 @@ switch( Event.type ) { case Expose: - ret|=VO_EVENT_EXPOSE; + ret|=VO_EVENT_EXPOSE; break; case ConfigureNotify: vo_dwidth=Event.xconfigure.width; - vo_dheight=Event.xconfigure.height; - ret|=VO_EVENT_RESIZE; + vo_dheight=Event.xconfigure.height; + ret|=VO_EVENT_RESIZE; break; case KeyPress: XLookupString( &Event.xkey,buf,sizeof(buf),&keySym,&stat ); vo_x11_putkey( ( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ) ); - ret|=VO_EVENT_KEYPRESS; + ret|=VO_EVENT_KEYPRESS; break; } } @@ -180,20 +176,20 @@ int nothing; if (dpms_disabled) { - if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) - { - printf ("Enabling DPMS\n"); - DPMSEnable(mDisplay); // restoring power saving settings - DPMSQueryExtension(mDisplay, ¬hing, ¬hing); - } + if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) + { + printf ("Enabling DPMS\n"); + DPMSEnable(mDisplay); // restoring power saving settings + DPMSQueryExtension(mDisplay, ¬hing, ¬hing); + } } - + if (timeout_save) { - int dummy, interval, prefer_blank, allow_exp; - XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank, &allow_exp); - XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank, allow_exp); - XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp); + int dummy, interval, prefer_blank, allow_exp; + XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank, &allow_exp); + XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank, allow_exp); + XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp); } } @@ -204,20 +200,20 @@ if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) { - BOOL onoff; - CARD16 state; - DPMSInfo(mDisplay, &state, &onoff); - if (onoff) - { - printf ("Disabling DPMS\n"); - dpms_disabled=1; - DPMSDisable(mDisplay); // monitor powersave off - } + BOOL onoff; + CARD16 state; + DPMSInfo(mDisplay, &state, &onoff); + if (onoff) + { + printf ("Disabling DPMS\n"); + dpms_disabled=1; + DPMSDisable(mDisplay); // monitor powersave off + } } XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp); if (timeout_save) - XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp); - // turning off screensaver + XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp); + // turning off screensaver } #endif
--- a/mplayer.c Sun Apr 15 23:10:05 2001 +0000 +++ b/mplayer.c Sun Apr 15 23:22:01 2001 +0000 @@ -88,7 +88,7 @@ #define ABS(x) (((x)>=0)?(x):(-(x))) //**************************************************************************// -// .SUB +// .SUB //**************************************************************************// static current_sub=0; @@ -127,29 +127,29 @@ } static int cfg_include(struct config *conf, char *filename){ - return parse_config_file(conf, filename); + return parse_config_file(conf, filename); } char *get_path(char *filename){ - char *homedir; - char *buff; - static char *config_dir = "/.mplayer"; - int len; + char *homedir; + char *buff; + static char *config_dir = "/.mplayer"; + int len; - if ((homedir = getenv("HOME")) == NULL) - return NULL; - len = strlen(homedir) + strlen(config_dir) + 1; - if (filename == NULL) { - if ((buff = (char *) malloc(len)) == NULL) - return NULL; - sprintf(buff, "%s%s", homedir, config_dir); - } else { - len += strlen(filename) + 1; - if ((buff = (char *) malloc(len)) == NULL) - return NULL; - sprintf(buff, "%s%s/%s", homedir, config_dir, filename); - } - return buff; + if ((homedir = getenv("HOME")) == NULL) + return NULL; + len = strlen(homedir) + strlen(config_dir) + 1; + if (filename == NULL) { + if ((buff = (char *) malloc(len)) == NULL) + return NULL; + sprintf(buff, "%s%s", homedir, config_dir); + } else { + len += strlen(filename) + 1; + if ((buff = (char *) malloc(len)) == NULL) + return NULL; + sprintf(buff, "%s%s/%s", homedir, config_dir, filename); + } + return buff; } static int max_framesize=0; @@ -274,15 +274,15 @@ // callback, the opendivx decoder calls this for each frame: void convert_linux(unsigned char *puc_y, int stride_y, - unsigned char *puc_u, unsigned char *puc_v, int stride_uv, - unsigned char *bmp, int width_y, int height_y){ + unsigned char *puc_u, unsigned char *puc_v, int stride_uv, + unsigned char *bmp, int width_y, int height_y){ // printf("convert_yuv called %dx%d stride: %d,%d\n",width_y,height_y,stride_y,stride_uv); opendivx_src[0]=puc_y; opendivx_src[1]=puc_u; opendivx_src[2]=puc_v; - + opendivx_stride[0]=stride_y; opendivx_stride[1]=stride_uv; opendivx_stride[2]=stride_uv; @@ -430,10 +430,7 @@ float sub_delay=0; float sub_fps=0; //int user_bpp=0; -extern int vo_dbpp; -// --- NEW -#include "mixer.h" -// --- + #include "cfg-mplayer.h" printf("%s",banner_text); @@ -473,7 +470,7 @@ i=0; while (video_out_drivers[i]) { const vo_info_t *info = video_out_drivers[i++]->get_info (); - printf("\t%s\t%s\n", info->short_name, info->name); + printf("\t%s\t%s\n", info->short_name, info->name); } printf("\n"); exit(0); @@ -560,7 +557,7 @@ if(id==mmioFOURCC('R','I','F','F')){ stream_read_dword_le(demuxer->stream); //filesize id=stream_read_dword_le(demuxer->stream); // "AVI " - if(id==formtypeAVI){ + if(id==formtypeAVI){ printf("Detected AVI file format!\n"); file_format=DEMUXER_TYPE_AVI; } @@ -644,7 +641,7 @@ if(verbose) printf("AVI index offset: %d\n",avi_header.idx_offset); } demuxer->endpos=avi_header.movi_end; - + if(avi_header.idx_size>0){ // check that file is non-interleaved: int i; @@ -674,7 +671,7 @@ if(force_ni || abs(a_pos-v_pos)>0x100000){ // distance > 1MB printf("Detected NON-INTERLEAVED AVI file-format!\n"); demuxer->type=DEMUXER_TYPE_AVI_NI; // HACK!!!! - pts_from_bps=1; // force BPS sync! + pts_from_bps=1; // force BPS sync! } } } else { @@ -682,9 +679,9 @@ if(force_ni){ printf("Using NON-INTERLEAVED Broken AVI file-format!\n"); demuxer->type=DEMUXER_TYPE_AVI_NINI; // HACK!!!! - avi_header.idx_pos_a= - avi_header.idx_pos_v=avi_header.movi_start; - pts_from_bps=1; // force BPS sync! + avi_header.idx_pos_a= + avi_header.idx_pos_v=avi_header.movi_start; + pts_from_bps=1; // force BPS sync! } } if(!ds_fill_buffer(d_video)){ @@ -910,7 +907,7 @@ printf("Or you should disable DShow support: make distclean;make -f Makefile.No-DS\n"); exit(1); } - + if(out_fmt==IMGFMT_YUY2) DS_VideoDecoder_SetDestFmt(16,mmioFOURCC('Y', 'U', 'Y', '2')); // DS_VideoDecoder_SetDestFmt(16,mmioFOURCC('Y', 'V', '1', '2')); @@ -921,7 +918,7 @@ printf("DivX setting result = %d\n", DS_SetAttr_DivX("Quality",divx_quality) ); // printf("DivX setting result = %d\n", DS_SetValue_DivX("Brightness",60) ); - + if(verbose) printf("INFO: Win32/DShow video codec init OK!\n"); break; #endif @@ -1046,7 +1043,7 @@ if(verbose) printf("INFO: Video OUT driver init OK!\n"); fflush(stdout); - + //================== MAIN: ========================== { int audio_fd=-1; @@ -1295,7 +1292,7 @@ if(1) while(v_frame<a_frame || force_redraw){ - + float frame_time=1; float pts1=d_video->pts; @@ -1314,9 +1311,9 @@ if(in_size>max_framesize) max_framesize=in_size; // let's decode dec_frame.length = in_size; - dec_frame.bitstream = start; - dec_frame.render_flag = 1; - decore(0x123, 0, &dec_frame, NULL); + dec_frame.bitstream = start; + dec_frame.render_flag = 1; + decore(0x123, 0, &dec_frame, NULL); t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f; if(opendivx_src[0]){ @@ -1352,6 +1349,7 @@ int in_size=ds_get_packet(d_video,&start); if(in_size<0){ eof=1;break;} if(in_size>max_framesize) max_framesize=in_size; + if(in_size){ sh_video->bih->biSizeImage = in_size; // ret = ICDecompress(avi_header.hic, ICDECOMPRESS_NOTKEYFRAME|(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL), @@ -1391,19 +1389,19 @@ if(i>=0x101 && i<0x1B0) in_frame=1; // picture startcode else if(!i){ eof=1; break;} // EOF } - if(grab_frames==2 && (i==0x1B3 || i==0x1B8)) grab_frames=1; + if(grab_frames==2 && (i==0x1B3 || i==0x1B8)) grab_frames=1; if(!read_video_packet(d_video)){ eof=1; break;} // EOF //printf("read packet 0x%X, len=%d\n",i,videobuf_len); } - + if(videobuf_len>max_framesize) max_framesize=videobuf_len; // debug //printf("--- SEND %d bytes\n",videobuf_len); - if(grab_frames==1){ - FILE *f=fopen("grab.mpg","ab"); - fwrite(videobuffer,videobuf_len-4,1,f); - fclose(f); - } - + if(grab_frames==1){ + FILE *f=fopen("grab.mpg","ab"); + fwrite(videobuffer,videobuf_len-4,1,f); + fclose(f); + } + t-=GetTimer(); mpeg2_decode_data(video_out, videobuffer, videobuffer+videobuf_len); t+=GetTimer(); video_time_usage+=t*0.000001; @@ -1414,7 +1412,7 @@ sh_video->fps=newfps; sh_video->frametime=10000.0f/(float)frameratecode2framerate[picture->frame_rate_code]; } - + frame_time=(100+picture->repeat_count)*0.01f; picture->repeat_count=0; @@ -1527,7 +1525,7 @@ lirc_mp_getinput()<=0 && #endif getch2(20)<=0 && mplayer_get_key()<=0){ - video_out->check_events(); + video_out->check_events(); } osd_function=OSD_PLAY; } @@ -1580,20 +1578,6 @@ case 'o': // toggle OSD osd_level=(osd_level+1)%3; break; -// --- NEW - case '*': - mixer_incvolume(); - break; - case '/': - mixer_decvolume(); - break; - case 'm': - mixer_usemaster=1; - break;; - case 'c': - mixer_usemaster=0; - break; -// --- } if(rel_seek_secs) if(file_format==DEMUXER_TYPE_AVI && avi_header.idx_size<=0){ @@ -1605,7 +1589,7 @@ // 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; @@ -1617,7 +1601,7 @@ int curr_audio_pos=0; int audio_chunk_pos=-1; int video_chunk_pos=d_video->pos; - + skip_video_frames=0; // SEEK streams @@ -1737,7 +1721,7 @@ // now: audio_chunk_pos=pos in index // skip_audio_bytes=bytes to skip from that chunk // skip_audio_secs=time to play audio before video (if can't skip) - + // calc skip_video_frames & adjust video pts counter: // i=last; i=avi_header.idx_pos; @@ -1751,7 +1735,7 @@ } ++i; } - + } if(verbose) printf("SEEK: idx=%d (a:%d v:%d) v.skip=%d a.skip=%d/%4.3f \n", @@ -1784,7 +1768,7 @@ stream_seek(demuxer->stream,newpos); } break; - + case DEMUXER_TYPE_MPEG_ES: case DEMUXER_TYPE_MPEG_PS: { //================= seek in MPEG ========================== @@ -1818,7 +1802,7 @@ demux_read_data(d_audio,NULL,skip_audio_bytes); d_audio->pts=0; // PTS is outdated because of the raw data skipping } - + current_module="resync_audio"; switch(sh_audio->codec->driver){ @@ -1843,7 +1827,7 @@ if(file_format==DEMUXER_TYPE_MPEG_PS) if(d_video->pts && d_audio->pts){ if (d_video->pts < d_audio->pts){ - + } else { while(d_video->pts > d_audio->pts){ switch(sh_audio->codec->driver){ @@ -1885,7 +1869,7 @@ } // for(i=1;i<=11;i++) osd_text_buffer[10+i]=i;osd_text_buffer[10+i]=0; // vo_osd_text=osd_text_buffer; - + // find sub if(subtitles){ if(sub_fps==0) sub_fps=sh_video->fps;