[Mplayer-cvslog] CVS: main/libaf af.c,1.27,1.28 af.h,1.18,1.19

Alex Beregszaszi syncmail at mplayerhq.hu
Fri Jun 25 21:02:55 CEST 2004


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/main/libaf
In directory mail:/var2/tmp/cvs-serv1098

Modified Files:
	af.c af.h 
Log Message:
Send a command throught the filter chain until some item returns AF_OK. Patch by Reimar Doeffinger

Index: af.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- af.c	27 Jan 2004 06:45:43 -0000	1.27
+++ af.c	25 Jun 2004 19:02:53 -0000	1.28
@@ -82,7 +82,6 @@
 af_instance_t* af_create(af_stream_t* s, char* name)
 {
   char* cmdline = name;
-  char* delim   = "=";
 
   // Allocate space for the new filter and reset all pointers
   af_instance_t* new=malloc(sizeof(af_instance_t));
@@ -93,7 +92,7 @@
   memset(new,0,sizeof(af_instance_t));
 
   // Check for commandline parameters
-  strsep(&cmdline, delim);
+  strsep(&cmdline, "=");
 
   // Find filter from name
   if(NULL == (new->info=af_find(name)))
@@ -598,3 +597,16 @@
   af->data->len=len;
   return AF_OK;
 }
+
+// send control to all filters, starting with the last until
+// one responds with AF_OK
+int af_control_any_rev (af_stream_t* s, int cmd, void* arg) {
+  int res = AF_UNKNOWN;
+  af_instance_t* filt = s->last;
+  while (filt && res != AF_OK) {
+    res = filt->control(filt, cmd, arg);
+    filt = filt->prev;
+  }
+  return (res == AF_OK);
+}
+

Index: af.h
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- af.h	17 Jan 2003 01:00:07 -0000	1.18
+++ af.h	25 Jun 2004 19:02:53 -0000	1.19
@@ -151,6 +151,11 @@
 // Filter data chunk through the filters in the list
 af_data_t* af_play(af_stream_t* s, af_data_t* data);
 
+// send control to all filters, starting with the last until
+// one accepts the command with AF_OK.
+// Returns true if accepting filter was found.
+int af_control_any_rev (af_stream_t* s, int cmd, void* arg);
+
 /* Calculate how long the output from the filters will be given the
    input length "len". The calculated length is >= the actual
    length */




More information about the MPlayer-cvslog mailing list