[Mplayer-cvslog] CVS: main codec-cfg.c,1.12,1.13 codec-cfg.h,1.7,1.8 mplayer.c,1.39,1.40

Szabolcs Berecz szabii at users.sourceforge.net
Wed Apr 11 01:18:04 CEST 2001


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

Modified Files:
	codec-cfg.c codec-cfg.h mplayer.c 
Log Message:
find_codec() modified

Index: codec-cfg.c
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** codec-cfg.c	2001/04/10 20:47:37	1.12
--- codec-cfg.c	2001/04/10 23:18:01	1.13
***************
*** 391,395 ****
  			}
  		        if (!(*codecsp = (codecs_t *) realloc(*codecsp,
! 				sizeof(codecs_t) * (*nr_codecsp + 1)))) {
  			    perror("can't realloc '*codecsp'");
  			    goto err_out;
--- 391,395 ----
  			}
  		        if (!(*codecsp = (codecs_t *) realloc(*codecsp,
! 				sizeof(codecs_t) * (*nr_codecsp + 2)))) {
  			    perror("can't realloc '*codecsp'");
  			    goto err_out;
***************
*** 404,408 ****
  				goto err_out_parse_error;
  			for (i = 0; i < *nr_codecsp - 1; i++) {
- #warning audio meg videocodecnek lehet ugyanaz a neve? (most lehet...)
  				if (!strcmp(token[0], (*codecsp)[i].name)) {
  					PRINT_LINENUM;
--- 404,407 ----
***************
*** 482,492 ****
  			if (get_token(1, 1) < 0)
  				goto err_out_parse_error;
! 			if (!strcasecmp(token[0], ":-)"))
  				codec->status = CODECS_STATUS_WORKING;
! 			else if (!strcasecmp(token[0], ":-("))
  				codec->status = CODECS_STATUS_NOT_WORKING;
! 			else if (!strcasecmp(token[0], "X-("))
  				codec->status = CODECS_STATUS_UNTESTED;
! 			else if (!strcasecmp(token[0], ":-|"))
  				codec->status = CODECS_STATUS_PROBLEMS;
  			else
--- 481,491 ----
  			if (get_token(1, 1) < 0)
  				goto err_out_parse_error;
! 			if (!strcasecmp(token[0], "working"))
  				codec->status = CODECS_STATUS_WORKING;
! 			else if (!strcasecmp(token[0], "crashing"))
  				codec->status = CODECS_STATUS_NOT_WORKING;
! 			else if (!strcasecmp(token[0], "untested"))
  				codec->status = CODECS_STATUS_UNTESTED;
! 			else if (!strcasecmp(token[0], "buggy"))
  				codec->status = CODECS_STATUS_PROBLEMS;
  			else
***************
*** 497,500 ****
--- 496,501 ----
  	if (!validate_codec(codec, codec_type))
  		goto err_out_not_valid;
+ 	video_codecs[nr_vcodecs].name = NULL;
+ 	audio_codecs[nr_acodecs].name = NULL;
  	ret_codecs[0] = video_codecs;
  	ret_codecs[1] = audio_codecs;
***************
*** 521,551 ****
  }
  
! codecs_t *find_audio_codec(unsigned int fourcc, unsigned int *fourccmap)
  {
! 	return find_codec(fourcc, fourccmap, 1);
  }
  
! codecs_t *find_video_codec(unsigned int fourcc, unsigned int *fourccmap)
  {
! 	return find_codec(fourcc, fourccmap, 0);
  }
  
! codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap,int audioflag)
  {
  	int i, j;
  	codecs_t *c;
  
! 	if (audioflag) {
! 		i = nr_acodecs;
! 		c = audio_codecs;
  	} else {
! 		i = nr_vcodecs;
! 		c = video_codecs;
! 	}
! 	for (/* NOTHING */; i--; c++) {
! 		for (j = 0; j < CODECS_MAX_FOURCC; j++) {
! 			if (c->fourcc[j] == fourcc) {
! 				if (fourccmap) *fourccmap = c->fourccmap[j];
! 				return c;
  			}
  		}
--- 522,568 ----
  }
  
! codecs_t *find_audio_codec(unsigned int fourcc, unsigned int *fourccmap,
! 		codecs_t *start)
  {
! 	return find_codec(fourcc, fourccmap, start, 1);
  }
  
! codecs_t *find_video_codec(unsigned int fourcc, unsigned int *fourccmap,
! 		codecs_t *start)
  {
! 	return find_codec(fourcc, fourccmap, start, 0);
  }
  
! codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap,
! 		codecs_t *start, int audioflag)
  {
  	int i, j;
  	codecs_t *c;
  
! 	if (start) {
! 		for (/* NOTHING */; start->name; start++) {
! 			for (j = 0; j < CODECS_MAX_FOURCC; j++) {
! 				if (start->fourcc[j] == fourcc) {
! 					if (fourccmap)
! 						*fourccmap = start->fourccmap[j];
! 					return start;
! 				}
! 			}
! 		}
  	} else {
! 		if (audioflag) {
! 			i = nr_acodecs;
! 			c = audio_codecs;
! 		} else {
! 			i = nr_vcodecs;
! 			c = video_codecs;
! 		}
! 		for (/* NOTHING */; i--; c++) {
! 			for (j = 0; j < CODECS_MAX_FOURCC; j++) {
! 				if (c->fourcc[j] == fourcc) {
! 					if (fourccmap)
! 						*fourccmap = c->fourccmap[j];
! 					return c;
! 				}
  			}
  		}
***************
*** 553,557 ****
  	return NULL;
  }
- 
  
  #ifdef TESTING
--- 570,573 ----

Index: codec-cfg.h
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** codec-cfg.h	2001/04/10 20:09:23	1.7
--- codec-cfg.h	2001/04/10 23:18:01	1.8
***************
*** 51,55 ****
  
  codecs_t** parse_codec_cfg(char *cfgfile);
! codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap,int audioflag);
  
  #endif
--- 51,57 ----
  
  codecs_t** parse_codec_cfg(char *cfgfile);
! codecs_t* find_video_codec(unsigned int fourcc, unsigned int *fourccmap, codecs_t *start);
! codecs_t* find_audio_codec(unsigned int fourcc, unsigned int *fourccmap, codecs_t *start);
! codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap,codecs_t *start,int audioflag);
  
  #endif

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** mplayer.c	2001/04/07 21:42:40	1.39
--- mplayer.c	2001/04/10 23:18:01	1.40
***************
*** 793,797 ****
  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);
--- 793,797 ----
  if(has_audio){
    // Go through the codec.conf and find the best codec...
!   sh_audio->codec=find_codec(sh_audio->format,NULL,NULL,1);
    if(!sh_audio->codec){
      printf("Can't find codec for audio format 0x%X !\n",sh_audio->format);
***************
*** 816,820 ****
  
  // 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);
--- 816,820 ----
  
  // Go through the codec.conf and find the best codec...
! sh_video->codec=find_codec(sh_video->format,(unsigned int*) &sh_video->bih.biCompression,NULL,0);
  if(!sh_video->codec){
      printf("Can't find codec for video format 0x%X !\n",sh_video->format);


_______________________________________________
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