[Mplayer-cvslog] CVS: main mplayer.c,1.68,1.69

Zoltan Ponekker pontscho at users.sourceforge.net
Mon Apr 16 00:34:11 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv20103

Modified Files:
	mplayer.c 
Log Message:
add mixer support

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -r1.68 -r1.69
*** mplayer.c	2001/04/15 20:31:57	1.68
--- mplayer.c	2001/04/15 22:34:09	1.69
***************
*** 89,93 ****
  
  //**************************************************************************//
! //             .SUB 
  //**************************************************************************//
  
--- 89,93 ----
  
  //**************************************************************************//
! //             .SUB
  //**************************************************************************//
  
***************
*** 128,154 ****
  
  static int cfg_include(struct config *conf, char *filename){
! 	return parse_config_file(conf, filename);
  }
  
  char *get_path(char *filename){
! 	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;
  }
  
--- 128,154 ----
  
  static int cfg_include(struct config *conf, char *filename){
!         return parse_config_file(conf, filename);
  }
  
  char *get_path(char *filename){
!         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;
  }
  
***************
*** 275,280 ****
  // 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){
  
  //    printf("convert_yuv called  %dx%d  stride: %d,%d\n",width_y,height_y,stride_y,stride_uv);
--- 275,280 ----
  // 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){
  
  //    printf("convert_yuv called  %dx%d  stride: %d,%d\n",width_y,height_y,stride_y,stride_uv);
***************
*** 283,287 ****
      opendivx_src[1]=puc_u;
      opendivx_src[2]=puc_v;
!     
      opendivx_stride[0]=stride_y;
      opendivx_stride[1]=stride_uv;
--- 283,287 ----
      opendivx_src[1]=puc_u;
      opendivx_src[2]=puc_v;
! 
      opendivx_stride[0]=stride_y;
      opendivx_stride[1]=stride_uv;
***************
*** 431,435 ****
  float sub_fps=0;
  //int user_bpp=0;
! 
  #include "cfg-mplayer.h"
  
--- 431,438 ----
  float sub_fps=0;
  //int user_bpp=0;
! extern int vo_dbpp;
! // --- NEW
! #include "mixer.h"
! // ---
  #include "cfg-mplayer.h"
  
***************
*** 471,475 ****
    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("\n");
--- 474,478 ----
    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("\n");
***************
*** 558,562 ****
      stream_read_dword_le(demuxer->stream); //filesize
      id=stream_read_dword_le(demuxer->stream); // "AVI "
!     if(id==formtypeAVI){ 
        printf("Detected AVI file format!\n");
        file_format=DEMUXER_TYPE_AVI;
--- 561,565 ----
      stream_read_dword_le(demuxer->stream); //filesize
      id=stream_read_dword_le(demuxer->stream); // "AVI "
!     if(id==formtypeAVI){
        printf("Detected AVI file format!\n");
        file_format=DEMUXER_TYPE_AVI;
***************
*** 642,646 ****
    }
    demuxer->endpos=avi_header.movi_end;
!   
    if(avi_header.idx_size>0){
        // check that file is non-interleaved:
--- 645,649 ----
    }
    demuxer->endpos=avi_header.movi_end;
! 
    if(avi_header.idx_size>0){
        // check that file is non-interleaved:
***************
*** 672,676 ****
            printf("Detected NON-INTERLEAVED AVI file-format!\n");
            demuxer->type=DEMUXER_TYPE_AVI_NI; // HACK!!!!
! 	  pts_from_bps=1; // force BPS sync!
          }
        }
--- 675,679 ----
            printf("Detected NON-INTERLEAVED AVI file-format!\n");
            demuxer->type=DEMUXER_TYPE_AVI_NI; // HACK!!!!
!           pts_from_bps=1; // force BPS sync!
          }
        }
***************
*** 680,686 ****
            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!
        }
    }
--- 683,689 ----
            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!
        }
    }
***************
*** 908,912 ****
          exit(1);
     }
!    
     if(out_fmt==IMGFMT_YUY2)
       DS_VideoDecoder_SetDestFmt(16,mmioFOURCC('Y', 'U', 'Y', '2'));
--- 911,915 ----
          exit(1);
     }
! 
     if(out_fmt==IMGFMT_YUY2)
       DS_VideoDecoder_SetDestFmt(16,mmioFOURCC('Y', 'U', 'Y', '2'));
***************
*** 919,923 ****
     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;
--- 922,926 ----
     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;
***************
*** 1044,1048 ****
  
     fflush(stdout);
!    
  //================== MAIN: ==========================
  {
--- 1047,1051 ----
  
     fflush(stdout);
! 
  //================== MAIN: ==========================
  {
***************
*** 1293,1297 ****
  if(1)
    while(v_frame<a_frame || force_redraw){
!   
      float frame_time=1;
      float pts1=d_video->pts;
--- 1296,1300 ----
  if(1)
    while(v_frame<a_frame || force_redraw){
! 
      float frame_time=1;
      float pts1=d_video->pts;
***************
*** 1312,1318 ****
      // let's decode
          dec_frame.length = in_size;
! 	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;
  
--- 1315,1321 ----
      // let's decode
          dec_frame.length = in_size;
!         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;
  
***************
*** 1350,1354 ****
      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;
--- 1353,1356 ----
***************
*** 1390,1406 ****
              else if(!i){ eof=1; break;} // EOF
            }
! 	  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);
! 	}
!         
          t-=GetTimer();
            mpeg2_decode_data(video_out, videobuffer, videobuffer+videobuf_len);
--- 1392,1408 ----
              else if(!i){ eof=1; break;} // EOF
            }
!           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);
!         }
! 
          t-=GetTimer();
            mpeg2_decode_data(video_out, videobuffer, videobuffer+videobuf_len);
***************
*** 1413,1417 ****
              sh_video->frametime=10000.0f/(float)frameratecode2framerate[picture->frame_rate_code];
          }
!         
          frame_time=(100+picture->repeat_count)*0.01f;
          picture->repeat_count=0;
--- 1415,1419 ----
              sh_video->frametime=10000.0f/(float)frameratecode2framerate[picture->frame_rate_code];
          }
! 
          frame_time=(100+picture->repeat_count)*0.01f;
          picture->repeat_count=0;
***************
*** 1526,1530 ****
  #endif
            getch2(20)<=0 && mplayer_get_key()<=0){
! 	  video_out->check_events();
        }
        osd_function=OSD_PLAY;
--- 1528,1532 ----
  #endif
            getch2(20)<=0 && mplayer_get_key()<=0){
!           video_out->check_events();
        }
        osd_function=OSD_PLAY;
***************
*** 1579,1582 ****
--- 1581,1598 ----
        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)
***************
*** 1590,1594 ****
      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;
--- 1606,1610 ----
      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;
***************
*** 1602,1606 ****
      int audio_chunk_pos=-1;
      int video_chunk_pos=d_video->pos;
!     
      skip_video_frames=0;
  
--- 1618,1622 ----
      int audio_chunk_pos=-1;
      int video_chunk_pos=d_video->pos;
! 
      skip_video_frames=0;
  
***************
*** 1722,1726 ****
            //      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;
--- 1738,1742 ----
            //      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;
***************
*** 1736,1740 ****
              ++i;
            }
!           
        }
  
--- 1752,1756 ----
              ++i;
            }
! 
        }
  
***************
*** 1769,1773 ****
    }
    break;
!   
    case DEMUXER_TYPE_MPEG_ES:
    case DEMUXER_TYPE_MPEG_PS: {
--- 1785,1789 ----
    }
    break;
! 
    case DEMUXER_TYPE_MPEG_ES:
    case DEMUXER_TYPE_MPEG_PS: {
***************
*** 1803,1807 ****
            d_audio->pts=0; // PTS is outdated because of the raw data skipping
          }
!         
          current_module="resync_audio";
  
--- 1819,1823 ----
            d_audio->pts=0; // PTS is outdated because of the raw data skipping
          }
! 
          current_module="resync_audio";
  
***************
*** 1828,1832 ****
          if(d_video->pts && d_audio->pts){
            if (d_video->pts < d_audio->pts){
!           
            } else {
              while(d_video->pts > d_audio->pts){
--- 1844,1848 ----
          if(d_video->pts && d_audio->pts){
            if (d_video->pts < d_audio->pts){
! 
            } else {
              while(d_video->pts > d_audio->pts){
***************
*** 1870,1874 ****
  //  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){
--- 1886,1890 ----
  //  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){


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list