[Mplayer-cvslog] CVS: main Makefile,1.11,1.12 cfg-mplayer.h,1.11,1.12 codec-cfg.c,1.5,1.6 codec-cfg.h,1.3,1.4 dec_audio.c,1.2,1.3 dll_init.c,1.4,1.5 mplayer.c,1.37,1.38 stheader.h,1.2,1.3

GEREOFFY arpi_esp at users.sourceforge.net
Sat Apr 7 23:27:59 CEST 2001


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

Modified Files:
	Makefile cfg-mplayer.h codec-cfg.c codec-cfg.h dec_audio.c 
	dll_init.c mplayer.c stheader.h 
Log Message:
codecs.conf support

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** Makefile	2001/04/06 23:20:46	1.11
--- Makefile	2001/04/07 21:27:57	1.12
***************
*** 23,28 ****
  BINDIR = ${prefix}/bin
  # BINDIR = /usr/local/bin
! SRCS = subreader.c linux/getch2.c linux/timer-lx.c linux/shmem.c xa/xa_gsm.c lirc_mp.c cfgparser.c
! OBJS = subreader.o linux/getch2.o linux/timer-lx.o linux/shmem.o xa/xa_gsm.o lirc_mp.o cfgparser.o
  CFLAGS = $(OPTFLAGS) -Iloader -Ilibvo # -Wall
  A_LIBS = -Lmp3lib -lMP3 -Llibac3 -lac3
--- 23,28 ----
  BINDIR = ${prefix}/bin
  # BINDIR = /usr/local/bin
! SRCS = codec-cfg.c subreader.c linux/getch2.c linux/timer-lx.c linux/shmem.c xa/xa_gsm.c lirc_mp.c cfgparser.c
! OBJS = codec-cfg.o subreader.o linux/getch2.o linux/timer-lx.o linux/shmem.o xa/xa_gsm.o lirc_mp.o cfgparser.o
  CFLAGS = $(OPTFLAGS) -Iloader -Ilibvo # -Wall
  A_LIBS = -Lmp3lib -lMP3 -Llibac3 -lac3
***************
*** 78,82 ****
  
  $(PRG_CFG):        codec-cfg.c codec-cfg.h
! 	$(CC) $(CFLAGS) codec-cfg.c -o $(PRG_CFG) -DTESTING
  
  install: $(PRG)
--- 78,82 ----
  
  $(PRG_CFG):        codec-cfg.c codec-cfg.h
! 	$(CC) $(CFLAGS) -g codec-cfg.c -o $(PRG_CFG) -DTESTING
  
  install: $(PRG)

Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** cfg-mplayer.h	2001/03/30 03:07:45	1.11
--- cfg-mplayer.h	2001/04/07 21:27:57	1.12
***************
*** 35,40 ****
  	{"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},
--- 35,40 ----
  	{"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},

Index: codec-cfg.c
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** codec-cfg.c	2001/04/07 01:03:24	1.5
--- codec-cfg.c	2001/04/07 21:27:57	1.6
***************
*** 1,2 ****
--- 1,8 ----
+ 
+ //#define DEBUG
+ #define PRINT_LINENUM
+ //	printf("%s(%d): ", cfgfile, line_num)
+ 
+ 
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 29,42 ****
  #define RET_OK		0
  
! FILE *fp;
! int line_num = 0;
! int line_pos;	/* line pos */
! int firstdef = 1;
! char *line;
! char *token;
  
! int nr_codecs = 0;
  
! int get_token(void)
  {
  	static int read_nextline = 1;
--- 35,49 ----
  #define RET_OK		0
  
! static FILE *fp;
! static int line_num = 0;
! static int line_pos;	/* line pos */
! static int firstdef = 1;
! static char *line;
! static char *token;
  
! static codecs_t *codecs=NULL;
! static int nr_codecs = 0;
  
! static int get_token(void)
  {
  	static int read_nextline = 1;
***************
*** 89,93 ****
  }
  
! int add_to_fourcc(char *s, char *alias, unsigned int *fourcc,
  		unsigned int *map)
  {
--- 96,100 ----
  }
  
! static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc,
  		unsigned int *map)
  {
***************
*** 134,138 ****
  }
  
! int add_to_format(char *s, unsigned int *fourcc, unsigned int *fourccmap)
  {
  //        printf("\n-----[%s][%s]-----\n",s,format);
--- 141,145 ----
  }
  
! static int add_to_format(char *s, unsigned int *fourcc, unsigned int *fourccmap)
  {
  //        printf("\n-----[%s][%s]-----\n",s,format);
***************
*** 154,158 ****
  
  
! int add_to_out(char *sfmt, char *sflags, unsigned int *outfmt,
  		unsigned char *outflags)
  {
--- 161,165 ----
  
  
! static int add_to_out(char *sfmt, char *sflags, unsigned int *outfmt,
  		unsigned char *outflags)
  {
***************
*** 230,234 ****
  }
  
! short get_driver(char *s,int audioflag)
  {
  	static char *audiodrv[] = {
--- 237,241 ----
  }
  
! static short get_driver(char *s,int audioflag)
  {
  	static char *audiodrv[] = {
***************
*** 257,267 ****
  }
  
- //#define DEBUG
  
  codecs_t *parse_codec_cfg(char *cfgfile)
  {
- #define PRINT_LINENUM	printf("%s(%d): ", cfgfile, line_num)
  
! 	codecs_t *codecs = NULL;  // array of codecs
  	codecs_t *codec = NULL;   // currect codec
  	int free_slots = 0;
--- 264,272 ----
  }
  
  
  codecs_t *parse_codec_cfg(char *cfgfile)
  {
  
! //	codecs_t *codecs = NULL;  // array of codecs
  	codecs_t *codec = NULL;   // currect codec
  	int free_slots = 0;
***************
*** 310,317 ****
                          
  			if (*token == 'a') {		/* audiocodec */
! 				printf("audio");
  				codec->flags |= CODECS_FLAG_AUDIO;
  			} else if (*token == 'v') {	/* videocodec */
! 				printf("video");
  				codec->flags &= !CODECS_FLAG_AUDIO;
  			} else {
--- 315,322 ----
                          
  			if (*token == 'a') {		/* audiocodec */
! 				//printf("audio");
  				codec->flags |= CODECS_FLAG_AUDIO;
  			} else if (*token == 'v') {	/* videocodec */
! 				//printf("video");
  				codec->flags &= !CODECS_FLAG_AUDIO;
  			} else {
***************
*** 323,342 ****
  			codec->name = strdup(token);
  			state |= GOT_NAME;
! 			printf(" %s\n", codec->name);
  		} else if (!strcmp(token, "info")) {
  			if (!(state & GOT_NAME))
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			printf("info");
  			if (state & GOT_INFO || get_token() < 0)
  				goto parse_error_out;
  			codec->info = strdup(token);
  			state |= GOT_INFO;
! 			printf(" %s\n", codec->info);
  		} else if (!strcmp(token, "comment")) {
  			if (!(state & GOT_NAME))
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			printf("comment");
  			if (get_token() < 0)
  				goto parse_error_out;
--- 328,347 ----
  			codec->name = strdup(token);
  			state |= GOT_NAME;
! 			//printf(" %s\n", codec->name);
  		} else if (!strcmp(token, "info")) {
  			if (!(state & GOT_NAME))
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			//printf("info");
  			if (state & GOT_INFO || get_token() < 0)
  				goto parse_error_out;
  			codec->info = strdup(token);
  			state |= GOT_INFO;
! 			//printf(" %s\n", codec->info);
  		} else if (!strcmp(token, "comment")) {
  			if (!(state & GOT_NAME))
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			//printf("comment");
  			if (get_token() < 0)
  				goto parse_error_out;
***************
*** 344,348 ****
  			if (!codec->comment)
  				codec->comment = strdup(token);
! 			printf(" %s\n", codec->comment);
  #else
  			add_comment(token, &codec->comment);
--- 349,353 ----
  			if (!codec->comment)
  				codec->comment = strdup(token);
! 			//printf(" %s\n", codec->comment);
  #else
  			add_comment(token, &codec->comment);
***************
*** 353,361 ****
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			printf("fourcc");
! 			if (codec->flags & CODECS_FLAG_AUDIO) {
! 				printf("\n'fourcc' in audiocodec definition!\n");
! 				goto err_out;
! 			}
  			if (get_token() < 0)
  				goto parse_error_out;
--- 358,366 ----
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			//printf("fourcc");
! //			if (codec->flags & CODECS_FLAG_AUDIO) {
! //				printf("\n'fourcc' in audiocodec definition!\n");
! //				goto err_out;
! //			}
  			if (get_token() < 0)
  				goto parse_error_out;
***************
*** 367,371 ****
  				goto err_out;
  			state |= GOT_FOURCC;
! 			printf(" %s: %s\n", param1, token);
  			free(param1);
  		} else if (!strcmp(token, "format")) {
--- 372,376 ----
  				goto err_out;
  			state |= GOT_FOURCC;
! 			//printf(" %s: %s\n", param1, token);
  			free(param1);
  		} else if (!strcmp(token, "format")) {
***************
*** 373,381 ****
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			printf("format");
! 			if (!(codec->flags & CODECS_FLAG_AUDIO)) {
! 				printf("\n'format' in videocodec definition!\n");
! 				goto err_out;
! 			}
  			if (get_token() < 0)
  				goto parse_error_out;
--- 378,386 ----
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			//printf("format");
! //			if (!(codec->flags & CODECS_FLAG_AUDIO)) {
! //				printf("\n'format' in videocodec definition!\n");
! //				goto err_out;
! //			}
  			if (get_token() < 0)
  				goto parse_error_out;
***************
*** 383,413 ****
  				goto err_out;
  			state |= GOT_FORMAT;
! 			printf(" %s\n", token);
  		} else if (!strcmp(token, "driver")) {
  			if (!(state & GOT_NAME))
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			printf("driver");
  			if (get_token() < 0)
  				goto parse_error_out;
  			if ((codec->driver = get_driver(token,codec->flags&CODECS_FLAG_AUDIO)) == -1)
  				goto err_out;
! 			printf(" %s\n", token);
  		} else if (!strcmp(token, "dll")) {
  			if (!(state & GOT_NAME))
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			printf("dll");
  			if (get_token() < 0)
  				goto parse_error_out;
  			codec->dll = strdup(token);
! 			printf(" %s\n", codec->dll);
  		} else if (!strcmp(token, "guid")) {
  			if (!(state & GOT_NAME))
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			printf("guid");
  			if (get_token() < 0) goto parse_error_out;
!                         printf("'%s'",token);
                          codec->guid.f1=strtoul(token,NULL,0);
  			if (get_token() < 0) goto parse_error_out;
--- 388,418 ----
  				goto err_out;
  			state |= GOT_FORMAT;
! 			//printf(" %s\n", token);
  		} else if (!strcmp(token, "driver")) {
  			if (!(state & GOT_NAME))
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			//printf("driver");
  			if (get_token() < 0)
  				goto parse_error_out;
  			if ((codec->driver = get_driver(token,codec->flags&CODECS_FLAG_AUDIO)) == -1)
  				goto err_out;
! 			//printf(" %s\n", token);
  		} else if (!strcmp(token, "dll")) {
  			if (!(state & GOT_NAME))
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			//printf("dll");
  			if (get_token() < 0)
  				goto parse_error_out;
  			codec->dll = strdup(token);
! 			//printf(" %s\n", codec->dll);
  		} else if (!strcmp(token, "guid")) {
  			if (!(state & GOT_NAME))
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			//printf("guid");
  			if (get_token() < 0) goto parse_error_out;
!                         //printf("'%s'",token);
                          codec->guid.f1=strtoul(token,NULL,0);
  			if (get_token() < 0) goto parse_error_out;
***************
*** 423,427 ****
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			printf("out");
  			if (get_token() < 0)
  				goto parse_error_out;
--- 428,432 ----
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			//printf("out");
  			if (get_token() < 0)
  				goto parse_error_out;
***************
*** 431,435 ****
  						codec->outflags))
  				goto err_out;
! 			printf(" %s: %s\n", param1, token);
  			free(param1);
  		} else if (!strcmp(token, "flags")) {
--- 436,440 ----
  						codec->outflags))
  				goto err_out;
! 			//printf(" %s: %s\n", param1, token);
  			free(param1);
  		} else if (!strcmp(token, "flags")) {
***************
*** 437,444 ****
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			printf("flags");
  			if (get_token() < 0)
  				goto parse_error_out;
! 			printf(" %s\n", token);
  		} else
  			goto parse_error_out;
--- 442,449 ----
  				goto parse_error_out;
  			PRINT_LINENUM;
! 			//printf("flags");
  			if (get_token() < 0)
  				goto parse_error_out;
! 			//printf(" %s\n", token);
  		} else
  			goto parse_error_out;
***************
*** 461,464 ****
--- 466,486 ----
  	goto out;
  }
+ 
+ codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap,int audioflag){
+   int i,j;
+   for(i=0;i<nr_codecs;i++){
+     codecs_t *c=&codecs[i];
+     if(!audioflag && (c->flags&CODECS_FLAG_AUDIO)) continue;
+     if(audioflag && !(c->flags&CODECS_FLAG_AUDIO)) continue;
+     for(j=0;j<CODECS_MAX_FOURCC;j++){
+       if(c->fourcc[j]==fourcc){
+         if(fourccmap) *fourccmap=c->fourccmap[j];
+         return c;
+       }
+     }
+   }
+   return NULL;
+ }
+ 
  
  #ifdef TESTING

Index: codec-cfg.h
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** codec-cfg.h	2001/04/07 00:51:38	1.3
--- codec-cfg.h	2001/04/07 21:27:57	1.4
***************
*** 16,21 ****
--- 16,24 ----
  #define CODECS_MAX_OUTFMT	16
  
+ // Global flags:
  #define CODECS_FLAG_AUDIO	(1<<0)
+ #define CODECS_FLAG_SEEKABLE	(1<<1)
  
+ // Outfmt flags:
  #define CODECS_FLAG_FLIP	(1<<0)
  #define CODECS_FLAG_NOFLIP	(1<<1)
***************
*** 23,27 ****
  
  
! #warning nem kellene ket typedef GUID-nak...
  typedef struct {
  	unsigned long f1;
--- 26,30 ----
  
  
! //#warning nem kellene ket typedef GUID-nak...
  typedef struct {
  	unsigned long f1;
***************
*** 45,49 ****
  } codecs_t;
  
! codecs_t *parse_codec_cfg(char *cfgfile);
  
  #endif
--- 48,53 ----
  } codecs_t;
  
! codecs_t* parse_codec_cfg(char *cfgfile);
! codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap,int audioflag);
  
  #endif

Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_audio.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** dec_audio.c	2001/04/06 16:31:18	1.2
--- dec_audio.c	2001/04/07 21:27:57	1.3
***************
*** 1,50 ****
  
- // FIXME: use codec.conf struct here!!!
- int detect_audio_format(sh_audio_t *sh_audio){
-     int has_audio=0;
- // Decide audio format:
-     switch(sh_audio->wf.wFormatTag){
-       case 0:
-         has_audio=0;break; // disable/no audio
-       case 6:
-         avi_header.audio_seekable=1;
-         has_audio=5;break; // aLaw
-       case 0x31:
-       case 0x32:
-         has_audio=6;break; // MS-GSM
-       case 0x50:
- #ifdef DEFAULT_MPG123
-       case 0x55:
- #endif
-         avi_header.audio_seekable=1;
-         has_audio=1;break; // MPEG
-       case 0x01:
-         avi_header.audio_seekable=1;
-         has_audio=2;break; // PCM
-       case 0x2000:
-         avi_header.audio_seekable=1;
-         has_audio=3;break; // AC3
-       default:
-         avi_header.audio_seekable=0;
-         has_audio=4;       // Win32/ACM
-     }
-   if(has_audio==4){
-     if(!avi_header.audio_codec) avi_header.audio_codec=get_auds_codec_name(sh_audio);
-     if(avi_header.auds_guid) has_audio=7; // force DShow
-     if(!avi_header.audio_codec) has_audio=0; // unknown win32 codec
-     if(verbose) printf("win32 audio codec: '%s'\n",avi_header.audio_codec);
-   }
-   if(verbose) printf("detected audio format: %d\n",has_audio);
-   return has_audio;
- }
- 
  int init_audio(sh_audio_t *sh_audio){
! int has_audio=sh_audio->codec.driver;
  
  sh_audio->samplesize=2;
  sh_audio->pcm_bswap=0;
  sh_audio->a_buffer_size=16384;  // default size, maybe not enough for Win32/ACM
  
! if(has_audio==4){
    // Win32 ACM audio codec:
    if(init_acm_audio_codec(sh_audio)){
--- 1,15 ----
  
  int init_audio(sh_audio_t *sh_audio){
! 
! int driver=sh_audio->codec->driver;
  
  sh_audio->samplesize=2;
+ sh_audio->samplerate=0;
  sh_audio->pcm_bswap=0;
+ 
  sh_audio->a_buffer_size=16384;  // default size, maybe not enough for Win32/ACM
+ sh_audio->a_buffer=NULL;
  
! if(driver==4){
    // Win32 ACM audio codec:
    if(init_acm_audio_codec(sh_audio)){
***************
*** 55,103 ****
    } else {
      printf("Could not load/initialize Win32/ACM AUDIO codec (missing DLL file?)\n");
!     if((sh_audio->wf.wFormatTag)==0x55){
!       printf("Audio format is MP3 -> fallback to internal mp3lib/mpg123\n");
!       has_audio=1;  // fallback to mp3lib
!     } else
!       has_audio=0;  // nosound
    }
  }
  
! if(has_audio==7){
  #ifndef USE_DIRECTSHOW
    printf("Compiled without DirectShow support -> force nosound :(\n");
!   has_audio=0;
  #else
    // Win32 DShow audio codec:
!     WAVEFORMATEX *in_fmt=&sh_audio->wf;
!     sh_audio->o_wf.nChannels=in_fmt->nChannels;
!     sh_audio->o_wf.nSamplesPerSec=in_fmt->nSamplesPerSec;
!     sh_audio->o_wf.nAvgBytesPerSec=2*sh_audio->o_wf.nSamplesPerSec*sh_audio->o_wf.nChannels;
!     sh_audio->o_wf.wFormatTag=WAVE_FORMAT_PCM;
!     sh_audio->o_wf.nBlockAlign=2*in_fmt->nChannels;
!     sh_audio->o_wf.wBitsPerSample=16;
!     sh_audio->o_wf.cbSize=0;
! 
!   if(!DS_AudioDecoder_Open(avi_header.audio_codec,avi_header.auds_guid,in_fmt)){
!     sh_audio->channels=sh_audio->o_wf.nChannels;
!     sh_audio->samplerate=sh_audio->o_wf.nSamplesPerSec;
  
!     sh_audio->audio_in_minsize=2*sh_audio->o_wf.nBlockAlign;
      if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192;
      sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize;
      sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size);
      sh_audio->a_in_buffer_len=0;
- 
-   } else {
-     printf("ERROR: Could not load/initialize Win32/DirctShow AUDIO codec: %s\n",avi_header.audio_codec);
-     if((in_fmt->wFormatTag)==0x55){
-       printf("Audio format is MP3 -> fallback to internal mp3lib/mpg123\n");
-       has_audio=1;  // fallback to mp3lib
-     } else
-       printf("Audio disabled! Try to upgrade your w32codec.zip package!!!\n");
-       has_audio=0;  // nosound
    }
  #endif
  }
  
  
  // allocate audio out buffer:
--- 20,51 ----
    } else {
      printf("Could not load/initialize Win32/ACM AUDIO codec (missing DLL file?)\n");
!     driver=0;
    }
  }
  
! if(driver==7){
  #ifndef USE_DIRECTSHOW
    printf("Compiled without DirectShow support -> force nosound :(\n");
!   driver=0;
  #else
    // Win32 DShow audio codec:
!   printf("DShow_audio: channs=%d  rate=%d\n",sh_audio->channels,sh_audio->samplerate);
  
!   if(DS_AudioDecoder_Open(sh_audio->codec->dll,&sh_audio->codec->guid,&sh_audio->wf)){
!     printf("ERROR: Could not load/initialize Win32/DirctShow AUDIO codec: %s\n",sh_audio->codec->dll);
!     driver=0;
!   } else {
!     sh_audio->channels=sh_audio->wf.nChannels;
!     sh_audio->samplerate=sh_audio->wf.nSamplesPerSec;
!     sh_audio->audio_in_minsize=2*sh_audio->wf.nBlockAlign;
      if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192;
      sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize;
      sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size);
      sh_audio->a_in_buffer_len=0;
    }
  #endif
  }
  
+ if(!driver) return 0;
  
  // allocate audio out buffer:
***************
*** 106,121 ****
  sh_audio->a_buffer_len=0;
  
! if(has_audio==4){
      int ret=acm_decode_audio(sh_audio,sh_audio->a_buffer,sh_audio->a_buffer_size);
      if(ret<0){
!         printf("ACM error %d -> switching to nosound...\n",ret);
!         has_audio=0;
!     } else {
!         sh_audio->a_buffer_len=ret;
!         printf("ACM decoding test: %d bytes\n",ret);
      }
  }
! 
! if(has_audio==2){
  //  if(file_format==DEMUXER_TYPE_AVI){    // FIXME!!!!!!!
      // AVI PCM Audio:
--- 54,67 ----
  sh_audio->a_buffer_len=0;
  
! switch(driver){
! case 4: {
      int ret=acm_decode_audio(sh_audio,sh_audio->a_buffer,sh_audio->a_buffer_size);
      if(ret<0){
!         printf("ACM decoding error: %d\n",ret);
!         driver=0;
      }
+     break;
  }
! case 2: {
  //  if(file_format==DEMUXER_TYPE_AVI){    // FIXME!!!!!!!
      // AVI PCM Audio:
***************
*** 130,135 ****
  //    sh_audio->pcm_bswap=1;
  //  }
! } else
! if(has_audio==3){
    // Dolby AC3 audio:
    ac3_config.fill_buffer_callback = ac3_fill_buffer;
--- 76,82 ----
  //    sh_audio->pcm_bswap=1;
  //  }
!     break;
! }
! case 3: {
    // Dolby AC3 audio:
    ac3_config.fill_buffer_callback = ac3_fill_buffer;
***************
*** 147,166 ****
      sh_audio->samplerate=sh_audio->ac3_frame->sampling_rate;
      sh_audio->channels=2;
!   } else has_audio=0; // bad frame -> disable audio
! } else
! if(has_audio==5){
    // aLaw audio codec:
    Gen_aLaw_2_Signed(); // init table
    sh_audio->channels=sh_audio->wf.nChannels;
    sh_audio->samplerate=sh_audio->wf.nSamplesPerSec;
! } else
! if(has_audio==6){
    // MS-GSM audio codec:
    GSM_Init();
    sh_audio->channels=sh_audio->wf.nChannels;
    sh_audio->samplerate=sh_audio->wf.nSamplesPerSec;
  }
! // must be here for Win32->mp3lib fallbacks
! if(has_audio==1){
    // MPEG Audio:
    MP3_Init();
--- 94,117 ----
      sh_audio->samplerate=sh_audio->ac3_frame->sampling_rate;
      sh_audio->channels=2;
!   } else {
!     driver=0; // bad frame -> disable audio
!   }
!   break;
! }
! case 5: {
    // aLaw audio codec:
    Gen_aLaw_2_Signed(); // init table
    sh_audio->channels=sh_audio->wf.nChannels;
    sh_audio->samplerate=sh_audio->wf.nSamplesPerSec;
!   break;
! }
! case 6: {
    // MS-GSM audio codec:
    GSM_Init();
    sh_audio->channels=sh_audio->wf.nChannels;
    sh_audio->samplerate=sh_audio->wf.nSamplesPerSec;
+   break;
  }
! case 1: {
    // MPEG Audio:
    MP3_Init();
***************
*** 171,184 ****
    sh_audio->channels=2; // hack
    sh_audio->samplerate=MP3_samplerate;
  }
  
  if(!sh_audio->channels || !sh_audio->samplerate){
    printf("Unknown/missing audio format, using nosound\n");
!   has_audio=0;
  }
  
!   sh_audio->o_bps=sh_audio->channels*sh_audio->samplerate*sh_audio->samplesize;
  
!   return has_audio;
  }
  
--- 122,142 ----
    sh_audio->channels=2; // hack
    sh_audio->samplerate=MP3_samplerate;
+   break;
+ }
  }
  
  if(!sh_audio->channels || !sh_audio->samplerate){
    printf("Unknown/missing audio format, using nosound\n");
!   driver=0;
  }
  
!   if(!driver){
!       if(sh_audio->a_buffer) free(sh_audio->a_buffer);
!       sh_audio->o_bps=0;
!       return 0;
!   }
  
!   sh_audio->o_bps=sh_audio->channels*sh_audio->samplerate*sh_audio->samplesize;
!   return driver;
  }
  
***************
*** 187,191 ****
  int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int maxlen){
      int len=-1;
!     switch(sh_audio->codec.driver){
        case 1: // MPEG layer 2 or 3
          len=MP3_DecodeFrame(buf,-1);
--- 145,149 ----
  int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int maxlen){
      int len=-1;
!     switch(sh_audio->codec->driver){
        case 1: // MPEG layer 2 or 3
          len=MP3_DecodeFrame(buf,-1);

Index: dll_init.c
===================================================================
RCS file: /cvsroot/mplayer/main/dll_init.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** dll_init.c	2001/04/06 16:31:18	1.4
--- dll_init.c	2001/04/07 21:27:57	1.5
***************
*** 22,26 ****
      sh_audio->o_wf.cbSize=0;
  
!     win32_codec_name = avi_header.audio_codec;
      ret=acmStreamOpen(&sh_audio->srcstream,(HACMDRIVER)NULL,
                      in_fmt,&sh_audio->o_wf,
--- 22,26 ----
      sh_audio->o_wf.cbSize=0;
  
!     win32_codec_name = sh_audio->codec->dll;
      ret=acmStreamOpen(&sh_audio->srcstream,(HACMDRIVER)NULL,
                      in_fmt,&sh_audio->o_wf,
***************
*** 101,106 ****
  
  
! int init_video_codec(int outfmt){
    HRESULT ret;
  
    if(verbose) printf("======= Win32 (VFW) VIDEO Codec init =======\n");
--- 101,107 ----
  
  
! int init_video_codec(){
    HRESULT ret;
+   unsigned int outfmt=sh_video->codec->outfmt[sh_video->outfmtidx];
  
    if(verbose) printf("======= Win32 (VFW) VIDEO Codec init =======\n");
***************
*** 109,113 ****
    sh_video->o_bih.biSize = sizeof(BITMAPINFOHEADER);
  
!   win32_codec_name = avi_header.video_codec;
    sh_video->hic = ICOpen( 0x63646976, sh_video->bih.biCompression, ICMODE_FASTDECOMPRESS);
  //  sh_video->hic = ICOpen( 0x63646976, sh_video->bih.biCompression, ICMODE_DECOMPRESS);
--- 110,114 ----
    sh_video->o_bih.biSize = sizeof(BITMAPINFOHEADER);
  
!   win32_codec_name = sh_video->codec->dll;
    sh_video->hic = ICOpen( 0x63646976, sh_video->bih.biCompression, ICMODE_FASTDECOMPRESS);
  //  sh_video->hic = ICOpen( 0x63646976, sh_video->bih.biCompression, ICMODE_DECOMPRESS);
***************
*** 143,152 ****
      sh_video->o_bih.biBitCount=outfmt&0xFF;//   //24;
  
    sh_video->o_bih.biSizeImage=sh_video->o_bih.biWidth*sh_video->o_bih.biHeight*(sh_video->o_bih.biBitCount/8);
  
!   if(!avi_header.flipped)
      sh_video->o_bih.biHeight=-sh_video->bih.biHeight; // flip image!
  
!   if(outfmt==IMGFMT_YUY2 && !avi_header.yuv_hack_needed)
      sh_video->o_bih.biCompression = mmioFOURCC('Y','U','Y','2');
  
--- 144,155 ----
      sh_video->o_bih.biBitCount=outfmt&0xFF;//   //24;
  
+   if(sh_video->o_bih.biBitCount==15) ++sh_video->o_bih.biBitCount;
+ 
    sh_video->o_bih.biSizeImage=sh_video->o_bih.biWidth*sh_video->o_bih.biHeight*(sh_video->o_bih.biBitCount/8);
  
!   if(!(sh_video->codec->outflags[sh_video->outfmtidx]&CODECS_FLAG_FLIP))
      sh_video->o_bih.biHeight=-sh_video->bih.biHeight; // flip image!
  
!   if(outfmt==IMGFMT_YUY2 && !(sh_video->codec->outflags[sh_video->outfmtidx]&CODECS_FLAG_YUVHACK))
      sh_video->o_bih.biCompression = mmioFOURCC('Y','U','Y','2');
  
***************
*** 206,210 ****
    }
  
!   if(outfmt==IMGFMT_YUY2 && avi_header.yuv_hack_needed)
      sh_video->o_bih.biCompression = mmioFOURCC('Y','U','Y','2');
  
--- 209,213 ----
    }
  
!   if(outfmt==IMGFMT_YUY2 && (sh_video->codec->outflags[sh_video->outfmtidx]&CODECS_FLAG_YUVHACK))
      sh_video->o_bih.biCompression = mmioFOURCC('Y','U','Y','2');
  

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** mplayer.c	2001/04/06 16:31:18	1.37
--- mplayer.c	2001/04/07 21:27:57	1.38
***************
*** 52,62 ****
  #include "wine/avifmt.h"
  
! typedef struct
! {
!     long f1;
!     short f2;
!     short f3;
!     char f4[8];
! } GUID;
  
  #ifdef USE_DIRECTSHOW
--- 52,56 ----
  #include "wine/avifmt.h"
  
! #include "codec-cfg.h"
  
  #ifdef USE_DIRECTSHOW
***************
*** 187,202 ****
    // video:
    unsigned int bitrate;
-   //===== This stuff will be removed when codec.conf reader is finished! =====
-   // video codec info:  (filled by codecs.c)
-   char *video_codec;
-   char yuv_supported;   // 1 if codec support YUY2 output format
-   char yuv_hack_needed; // requires for divx & mpeg4
-   char no_32bpp_support; // requires for INDEO 3.x, 4.x
-   char flipped;         // image is upside-down
-   GUID* vids_guid;
-   // audio codec info:  (filled by codecs.c)
-   char *audio_codec;
-   int audio_seekable;
-   GUID* auds_guid;
  } avi_header_t;
  
--- 181,184 ----
***************
*** 240,245 ****
  };
  
- #include "codecs.c"
- 
  //**************************************************************************//
  //             Audio codecs:
--- 222,225 ----
***************
*** 410,414 ****
  int file_format=DEMUXER_TYPE_UNKNOWN;
  int has_audio=1; // audio  0=no 1=mpeg 2=pcm 3=ac3 4=ACM 5=alaw 6=msgsm 7=DShow
! int has_video=0; // video  0=no 1=mpeg 2=win32/VfW 3=OpenDivX 4=w32/DShow
  //
  int audio_format=0; // override
--- 390,394 ----
  int file_format=DEMUXER_TYPE_UNKNOWN;
  int has_audio=1; // audio  0=no 1=mpeg 2=pcm 3=ac3 4=ACM 5=alaw 6=msgsm 7=DShow
! int has_video=1; // video  0=no 1=mpeg 2=win32/VfW 3=OpenDivX 4=w32/DShow
  //
  int audio_format=0; // override
***************
*** 552,555 ****
--- 532,540 ----
  }
  
+ // check codec.conf
+ if(!parse_codec_cfg(get_path("codecs.conf"))){
+     printf("Warning! Couldn't load codecs.conf!");
+ }
+ 
  
  if(vcd_track){
***************
*** 601,605 ****
        printf("Detected ASF file format!\n");
        file_format=DEMUXER_TYPE_ASF;
- //      printf("!!! ASF files not (yet) supported !!!\n");exit(1);
    }
  }
--- 586,589 ----
***************
*** 699,703 ****
          if(force_ni || abs(a_pos-v_pos)>0x100000){  // distance > 1MB
            printf("Detected NON-INTERLEAVED AVI file-format!\n");
- //          file_format=DEMUXER_TYPE_AVI_NI; // HACK!!!!
            demuxer->type=DEMUXER_TYPE_AVI_NI; // HACK!!!!
  	  pts_from_bps=1; // force BPS sync!
--- 683,686 ----
***************
*** 708,712 ****
        if(force_ni){
            printf("Using NON-INTERLEAVED Broken AVI file-format!\n");
- //          file_format=DEMUXER_TYPE_AVI_NI; // HACK!!!!
            demuxer->type=DEMUXER_TYPE_AVI_NINI; // HACK!!!!
  	  avi_header.idx_pos_a=
--- 691,694 ----
***************
*** 720,728 ****
      exit(1);
    }
!   has_video=2;
!   // Decide audio format:
!   if(audio_format)
!     has_audio=audio_format; // override type
!   else if(has_audio) has_audio=detect_audio_format(sh_audio);
    if(has_audio){
      if(verbose) printf("AVI: Searching for audio stream (id:%d)\n",d_audio->id);
--- 702,706 ----
      exit(1);
    }
!   sh_video->format=sh_video->bih.biCompression;
    if(has_audio){
      if(verbose) printf("AVI: Searching for audio stream (id:%d)\n",d_audio->id);
***************
*** 732,735 ****
--- 710,714 ----
      }
    }
+   if(has_audio) sh_audio->format=sh_audio->wf.wFormatTag;
    default_fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
    break;
***************
*** 741,754 ****
    stream_seek(demuxer->stream,avi_header.movi_start);
    avi_header.idx_pos=0;
- #if 0
-   if(avi_header.idx_size>0){
-     // decide index format:
-     if(avi_header.idx[0].dwChunkOffset<avi_header.movi_start)
-       avi_header.idx_offset=avi_header.movi_start-4;
-     else
-       avi_header.idx_offset=0;
-     if(verbose) printf("ASF index offset: %d\n",avi_header.idx_offset);
-   }
- #endif
    demuxer->endpos=avi_header.movi_end;
    if(!ds_fill_buffer(d_video)){
--- 720,723 ----
***************
*** 756,764 ****
      exit(1);
    }
!   has_video=2;
!   // Decide audio format:
!   if(audio_format)
!     has_audio=audio_format; // override type
!   else if(has_audio) has_audio=detect_audio_format(sh_audio);
    if(has_audio){
      if(verbose) printf("ASF: Searching for audio stream (id:%d)\n",d_audio->id);
--- 725,729 ----
      exit(1);
    }
!   sh_video->format=sh_video->bih.biCompression;
    if(has_audio){
      if(verbose) printf("ASF: Searching for audio stream (id:%d)\n",d_audio->id);
***************
*** 768,778 ****
      }
    }
    break;
   }
   case DEMUXER_TYPE_MPEG_ES: {
!   demuxer->audio->type=0;
!   has_audio=0; // ES streams has no audio channel
!   has_video=1; // mpeg video
!   break;
   }
   case DEMUXER_TYPE_MPEG_PS: {
--- 733,756 ----
      }
    }
+   if(has_audio) sh_audio->format=sh_audio->wf.wFormatTag;
    break;
   }
   case DEMUXER_TYPE_MPEG_ES: {
!    demuxer->audio->type=0;
!    // Find sequence_header first:
!    if(verbose) printf("Searching for sequence header... ");fflush(stdout);
!    while(1){
!       int i=sync_video_packet(d_video);
!       if(i==0x1B3) break; // found it!
!       if(!i || !skip_video_packet(d_video)){
!         if(verbose)  printf("NONE :(\n");
!         printf("MPEG: FATAL: EOF while searching for sequence header\n");
!         exit(1);
!       }
!    }
!    if(verbose) printf("OK!\n");
!    sh_video->format=1; // mpeg video
!    has_audio=0; // ES streams has no audio channel
!    break;
   }
   case DEMUXER_TYPE_MPEG_PS: {
***************
*** 782,789 ****
      has_audio=0;
    } else {
!     has_audio=d_audio->type;
    }
!   if(verbose) printf("detected MPG-PS audio format: %d\n",has_audio);
!   has_video=1; // mpeg video
    break;
   }
--- 760,784 ----
      has_audio=0;
    } else {
!     switch(d_audio->type){
!       case 1: sh_audio->format=0x50;break; // mpeg
!       case 2: sh_audio->format=0x2;break;  // pcm
!       case 3: sh_audio->format=0x2000;break; // ac3
!       default: has_audio=0; // unknown type
!     }
    }
!   if(has_audio) if(verbose) printf("detected MPG-PS audio format: %d\n",sh_audio->format);
!    // Find sequence_header first:
!    if(verbose) printf("Searching for sequence header... ");fflush(stdout);
!    while(1){
!       int i=sync_video_packet(d_video);
!       if(i==0x1B3) break; // found it!
!       if(!i || !skip_video_packet(d_video)){
!         if(verbose)  printf("NONE :(\n");
!         printf("MPEG: FATAL: EOF while searching for sequence header\n");
!         exit(1);
!       }
!    }
!    if(verbose) printf("OK!\n");
!    sh_video->format=1; // mpeg video
    break;
   }
***************
*** 794,843 ****
  fflush(stdout);
  
  //================== Init VIDEO (codec & libvo) ==========================
  
! if(has_video==2){
!   if(sh_video->video.fccHandler==mmioFOURCC('d', 'v', 'x', '1')) has_video=3;
!   if(sh_video->video.fccHandler==mmioFOURCC('d', 'i', 'v', 'x')) has_video=3;
!   if(sh_video->bih.biCompression==mmioFOURCC('d', 'v', 'x', '1')) has_video=3;
!   if(sh_video->bih.biCompression==mmioFOURCC('d', 'i', 'v', 'x')) has_video=3;
! //  if(sh_video->bih.biCompression==mmioFOURCC('D', 'I', 'V', 'X')) has_video=3; // Gabucino
! }
! 
! if(has_video==2){
!    if(!avi_header.video_codec) avi_header.video_codec=get_vids_codec_name(sh_video);
!    if(verbose)
!      printf("win32 video codec: '%s' %s%s%s\n",avi_header.video_codec,
!        avi_header.yuv_supported?"[YUV]":"",
!        avi_header.yuv_hack_needed?"[hack]":"",
!        avi_header.flipped?"[FLIP]":""
!      );
!    if(!avi_header.video_codec) exit(1); // unknown video codec
!    if(avi_header.vids_guid){
! #ifdef USE_DIRECTSHOW
!        has_video=4; // switching to DirectShow
! #else
!         printf("MPlayer was compiled without DirectShow support!\n");exit(1);
! #endif
!    }
  }
  
  switch(has_video){
   case 2: {
-    if(avi_header.yuv_supported && video_out->query_format(IMGFMT_YUY2)) out_fmt=IMGFMT_YUY2; else
-    if(avi_header.no_32bpp_support && video_out->query_format(IMGFMT_BGR|32)) out_fmt=IMGFMT_BGR|24; else
-    if(video_out->query_format(IMGFMT_BGR|15)) out_fmt=IMGFMT_BGR|16; else
-    if(video_out->query_format(IMGFMT_BGR|16)) out_fmt=IMGFMT_BGR|16; else
-    if(video_out->query_format(IMGFMT_BGR|24)) out_fmt=IMGFMT_BGR|24; else
-    if(video_out->query_format(IMGFMT_BGR|32)) out_fmt=IMGFMT_BGR|32; else {
-      printf("Sorry, selected video_out device is incompatible with this codec.\n");
-      printf("(It can't show 24bpp or 32bpp RGB images. Try to run X at 24/32bpp!)\n");
- //     printf("(cannot convert between YUY2, YV12 and RGB colorspace formats)\n");
-      exit(1);
-    }
-    //if(verbose) printf("AVI out_fmt=%X\n",out_fmt);
-    if(verbose) if(out_fmt==IMGFMT_YUY2) printf("Using YUV/YUY2 video output format!\n");
     if(!init_video_codec(out_fmt)) exit(1);
     if(verbose) printf("INFO: Win32 video codec init OK!\n");
!    if(out_fmt==(IMGFMT_BGR|16)) out_fmt=IMGFMT_BGR|15; // fix bpp
     
     // calculating video bitrate:
--- 789,842 ----
  fflush(stdout);
  
+ //================== Init AUDIO (codec) ==========================
+ if(has_audio){
+   // Go through the codec.conf and find the best codec...
+   sh_audio->codec=find_codec(sh_audio->format,NULL,1);
+   if(!sh_audio->codec){
+     printf("Can't find codec for audio format 0x%X !\n",sh_audio->format);
+     has_audio=0;
+   } else {
+     printf("Found audio codec: %s drv=%d (%s)\n",sh_audio->codec->name,sh_audio->codec->driver,sh_audio->codec->info);
+     has_audio=sh_audio->codec->driver;
+   }
+ }
+ 
+ if(has_audio){
+   if(verbose) printf("Initializing audio codec...\n");
+   has_audio=init_audio(sh_audio);
+   if(!has_audio){
+     printf("Couldn't initialize audio codec! -> nosound\n");
+   } else {
+     printf("AUDIO: samplerate=%d  channels=%d  bps=%d\n",has_audio,sh_audio->samplerate,sh_audio->channels,sh_audio->samplesize);
+   }
+ }
+ 
  //================== Init VIDEO (codec & libvo) ==========================
  
! // Go through the codec.conf and find the best codec...
! sh_video->codec=find_codec(sh_video->format,(unsigned int*) &sh_video->bih.biCompression,0);
! if(!sh_video->codec){
!     printf("Can't find codec for video format 0x%X !\n",sh_video->format);
!     exit(1);
  }
+ has_video=sh_video->codec->driver;
+ 
+ printf("Found video codec: %s drv=%d (%s)\n",sh_video->codec->name,sh_video->codec->driver,sh_video->codec->info);
  
+ for(i=0;i<CODECS_MAX_OUTFMT;i++){
+     out_fmt=sh_video->codec->outfmt[i];
+     if(video_out->query_format(out_fmt)) break;
+ }
+ if(i>=CODECS_MAX_OUTFMT){
+     printf("Sorry, selected video_out device is incompatible with this codec.\n");
+     exit(1);
+ }
+ sh_video->outfmtidx=i;
+ 
  switch(has_video){
   case 2: {
     if(!init_video_codec(out_fmt)) exit(1);
     if(verbose) printf("INFO: Win32 video codec init OK!\n");
!    //if(out_fmt==(IMGFMT_BGR|16)) out_fmt=IMGFMT_BGR|15; // fix bpp  FIXME!
     
     // calculating video bitrate:
***************
*** 862,883 ****
     break;
   }
- #ifdef USE_DIRECTSHOW
   case 4: { // Win32/DirectShow
!    if(avi_header.yuv_supported && video_out->query_format(IMGFMT_YUY2)) out_fmt=IMGFMT_YUY2; else
! //   if(avi_header.no_32bpp_support && video_out->query_format(IMGFMT_BGR|32)) out_fmt=IMGFMT_BGR|24; else
!    if(video_out->query_format(IMGFMT_BGR|15)) out_fmt=IMGFMT_BGR|15; else
!    if(video_out->query_format(IMGFMT_BGR|16)) out_fmt=IMGFMT_BGR|16; else
!    if(video_out->query_format(IMGFMT_BGR|24)) out_fmt=IMGFMT_BGR|24; else
!    if(video_out->query_format(IMGFMT_BGR|32)) out_fmt=IMGFMT_BGR|32; else {
!      printf("Sorry, selected video_out device is incompatible with this codec.\n");
!      printf("(It can't show 24bpp or 32bpp RGB images. Try to run X at 24/32bpp!)\n");
! //     printf("(cannot convert between YUY2, YV12 and RGB colorspace formats)\n");
!      exit(1);
!    }
!    //if(verbose) printf("AVI out_fmt=%X\n",out_fmt);
!    if(verbose) if(out_fmt==IMGFMT_YUY2) printf("Using YUV/YUY2 video output format!\n");
     sh_video->our_out_buffer=NULL;
!    if(DS_VideoDecoder_Open(avi_header.video_codec,avi_header.vids_guid, &sh_video->bih, 0, &sh_video->our_out_buffer)){
!         printf("ERROR: Couldn't open required DirectShow codec: %s\n",avi_header.video_codec);
          printf("Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n");
          printf("package from:  ftp://thot.banki.hu/esp-team/linux/MPlayer/w32codec.zip  !\n");
--- 861,872 ----
     break;
   }
   case 4: { // Win32/DirectShow
! #ifndef USE_DIRECTSHOW
!    printf("MPlayer was compiled WITHOUT directshow support!\n");
!    exit(1);
! #else
     sh_video->our_out_buffer=NULL;
!    if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, &sh_video->bih, 0, &sh_video->our_out_buffer)){
!         printf("ERROR: Couldn't open required DirectShow codec: %s\n",sh_video->codec->dll);
          printf("Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n");
          printf("package from:  ftp://thot.banki.hu/esp-team/linux/MPlayer/w32codec.zip  !\n");
***************
*** 922,931 ****
  #endif
   case 3: {  // OpenDivX
-    out_fmt=IMGFMT_YV12;
-    if(!video_out->query_format(out_fmt)) {
-      printf("Sorry, selected video_out device is incompatible with this codec!\n");
-      exit(1);
-    }
- 
     if(verbose) printf("OpenDivX video codec\n");
     { DEC_PARAM dec_param;
--- 911,914 ----
***************
*** 957,961 ****
  
     // display info:
- //   movie_size_x=sh_video->bih.biWidth+(divx_quality?0:64);
     movie_size_x=sh_video->bih.biWidth;
     movie_size_y=abs(sh_video->bih.biHeight);
--- 940,943 ----
***************
*** 963,983 ****
   }
   case 1: {
-    out_fmt=IMGFMT_YV12;
-    if(!video_out->query_format(out_fmt)) {
-      printf("Sorry, selected video_out device is incompatible with this codec!\n");
-      exit(1);
-    }
-    // Find sequence_header first:
-    if(verbose) printf("Searching for sequence header... ");fflush(stdout);
-    while(1){
-       int i=sync_video_packet(d_video);
-       if(i==0x1B3) break; // found it!
-       if(!i || !skip_video_packet(d_video)){
-         if(verbose)  printf("NONE :(\n");
-         printf("MPEG: FATAL: EOF while searching for sequence header\n");
-         exit(1);
-       }
-    }
-    if(verbose) printf("FOUND!\n");
     // allocate some shared memory for the video packet buffer:
     videobuffer=shmem_alloc(VIDEOBUFFER_SIZE);
--- 945,948 ----
***************
*** 1018,1022 ****
      picture->bitrate/16.0f );
     // display info:
- //   movie_size_x=picture->coded_picture_width;
     movie_size_x=picture->display_picture_width;
     movie_size_y=picture->display_picture_height;
--- 983,986 ----
***************
*** 1168,1181 ****
  
  if(has_audio){
- 
-   if(verbose) printf("Initializing audio codec...\n");
-   
-   sh_audio->codec.driver=has_audio; // FIXME!
-   has_audio=init_audio(sh_audio);
-   sh_audio->codec.driver=has_audio; // FIXME!
- 
- if(verbose) printf("Audio: type: %d  samplerate=%d  channels=%d  bps=%d\n",has_audio,sh_audio->samplerate,sh_audio->channels,sh_audio->samplesize);
- 
- if(has_audio){
  #ifdef USE_XMMP_AUDIO
    xmm_Init( &xmm );
--- 1132,1135 ----
***************
*** 1248,1252 ****
  }
  
- } // has_audio
  
  if(has_audio){
--- 1202,1205 ----
***************
*** 1284,1296 ****
  printf("Start playing...\n");fflush(stdout);
  
- #if 0
-      // ACM debug code
- {   DWORD srcsize=0;
-     DWORD dstsize=16384*8;
-     int ret=acmStreamSize(avi_header.srcstream,dstsize, &srcsize, ACM_STREAMSIZEF_DESTINATION);
-     printf("acmStreamSize %d -> %d (err=%d)\n",dstsize,srcsize,ret);
- }
- #endif
- 
  InitTimer();
  
--- 1237,1240 ----
***************
*** 1304,1308 ****
    unsigned int t=GetTimer();
    current_module="decode_audio";   // Enter AUDIO decoder module
!   sh_audio->codec.driver=has_audio; // FIXME!
    while(sh_audio->a_buffer_len<OUTBURST && !d_audio->eof){
      int ret=decode_audio(sh_audio,&sh_audio->a_buffer[sh_audio->a_buffer_len],sh_audio->a_buffer_size-sh_audio->a_buffer_len);
--- 1248,1252 ----
    unsigned int t=GetTimer();
    current_module="decode_audio";   // Enter AUDIO decoder module
!   sh_audio->codec->driver=has_audio; // FIXME!
    while(sh_audio->a_buffer_len<OUTBURST && !d_audio->eof){
      int ret=decode_audio(sh_audio,&sh_audio->a_buffer[sh_audio->a_buffer_len],sh_audio->a_buffer_size-sh_audio->a_buffer_len);
***************
*** 1935,1939 ****
            avi_header.idx_pos=audio_chunk_pos;
  
!           if(!avi_header.audio_seekable){
  #if 0
  //             curr_audio_pos=apos; // selected audio codec can't seek in chunk
--- 1879,1883 ----
            avi_header.idx_pos=audio_chunk_pos;
  
!           if(!(sh_audio->codec->flags&CODECS_FLAG_SEEKABLE)){
  #if 0
  //             curr_audio_pos=apos; // selected audio codec can't seek in chunk

Index: stheader.h
===================================================================
RCS file: /cvsroot/mplayer/main/stheader.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** stheader.h	2001/04/06 16:31:18	1.2
--- stheader.h	2001/04/07 21:27:57	1.3
***************
*** 1,12 ****
  // Stream headers:
  
  typedef struct {
    int driver;
      // codec descriptor from codec.conf
  } codecinfo_t;
  
  typedef struct {
    demux_stream_t *ds;
!   codecinfo_t codec;
    // output format:
    int samplerate;
--- 1,15 ----
  // Stream headers:
  
+ /*
  typedef struct {
    int driver;
      // codec descriptor from codec.conf
  } codecinfo_t;
+ */
  
  typedef struct {
    demux_stream_t *ds;
!   unsigned int format;
!   codecs_t *codec;
    // output format:
    int samplerate;
***************
*** 37,45 ****
  typedef struct {
    demux_stream_t *ds;
!   codecinfo_t codec;
    // output format:
    float fps;
    float frametime;  // 1/fps
!   unsigned int outfmt;
  //  unsigned int bitrate;
    // buffers:
--- 40,49 ----
  typedef struct {
    demux_stream_t *ds;
!   unsigned int format;
!   codecs_t *codec;
    // output format:
    float fps;
    float frametime;  // 1/fps
!   unsigned int outfmtidx;
  //  unsigned int bitrate;
    // buffers:


_______________________________________________
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