[MPlayer-cvslog] CVS: main/libaf af.c,1.35,1.36

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Dec 26 15:14:31 CET 2004


Hi,
> > CVS change done by Reimar Döffinger CVS
> >
> > Update of /cvsroot/mplayer/main/libaf
> > In directory mail:/var2/tmp/cvs-serv8321/libaf
> >
> > Modified Files:
> >  af.c
> > Log Message:
> > Use lavcresample when accuracy-optimized audio filter chain is requested.
> shouldn't it be dependant on wether lavc is compiled in?

Yes, you are right... Actually on thinking once again it was quite a
stupid patch. What do you think about the attached one?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: cfg-common.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-common.h,v
retrieving revision 1.137
diff -u -r1.137 cfg-common.h
--- cfg-common.h	18 Oct 2004 20:41:05 -0000	1.137
+++ cfg-common.h	26 Dec 2004 13:57:10 -0000
@@ -460,6 +460,7 @@
 m_option_t audio_filter_conf[]={       
 	{"list", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
         {"force", &af_cfg.force, CONF_TYPE_INT, CONF_RANGE, 0, 7, NULL},
+        {"resampler", &af_cfg.resampler, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
 
Index: libaf/af.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.c,v
retrieving revision 1.36
diff -u -r1.36 af.c
--- libaf/af.c	26 Dec 2004 11:58:07 -0000	1.36
+++ libaf/af.c	26 Dec 2004 13:57:12 -0000
@@ -378,21 +378,22 @@
   // Check output format
   if((AF_INIT_TYPE_MASK & s->cfg.force) != AF_INIT_FORCE){
     af_instance_t* af = NULL; // New filter
+    char *resampler = s->cfg.resampler;
+    if (!resampler) resampler = "resample";
     // Check output frequency if not OK fix with resample
     if(s->last->data->rate!=s->output.rate){
-      if(NULL==(af=af_get(s,"lavcresample")) &&
-          NULL==(af=af_get(s,"resample"))){
+      if(NULL==(af=af_get(s, resampler))){
 	if((AF_INIT_TYPE_MASK & s->cfg.force) == AF_INIT_SLOW){
 	  if(!strcmp(s->first->info->name,"format"))
-	    af = af_append(s,s->first,"lavcresample");
+	    af = af_append(s,s->first,resampler);
 	  else
-	    af = af_prepend(s,s->first,"lavcresample");
+	    af = af_prepend(s,s->first,resampler);
 	}		
 	else{
 	  if(!strcmp(s->last->info->name,"format"))
-	    af = af_prepend(s,s->last,"resample");
+	    af = af_prepend(s,s->last,resampler);
 	  else
-	    af = af_append(s,s->last,"resample");
+	    af = af_append(s,s->last,resampler);
 	}
       }
       // Init the new filter
Index: libaf/af.h
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.h,v
retrieving revision 1.21
diff -u -r1.21 af.h
--- libaf/af.h	6 Sep 2004 22:27:08 -0000	1.21
+++ libaf/af.h	26 Dec 2004 13:57:13 -0000
@@ -87,6 +91,7 @@
   int force;	// Initialization type
   char** list;	/* list of names of filters that are added to filter
 		   list during first initialization of stream */
+  char *resampler;
 }af_cfg_t;
 
 // Current audio stream


More information about the MPlayer-cvslog mailing list