[MPlayer-cvslog] CVS: main/libaf af.c,1.36,1.37 af.h,1.21,1.22

Reimar Döffinger CVS syncmail at mplayerhq.hu
Sat Jan 1 19:46:59 CET 2005


CVS change done by Reimar Döffinger CVS

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

Modified Files:
	af.c af.h 
Log Message:
Make af_control_any_rev return the matching filter


Index: af.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- af.c	26 Dec 2004 11:58:07 -0000	1.36
+++ af.c	1 Jan 2005 18:46:56 -0000	1.37
@@ -615,16 +615,21 @@
   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) {
+/**
+ * \brief send control to all filters, starting with the last, until
+ *        one responds with AF_OK
+ * \return The instance that accepted the command or NULL if none did.
+ */
+af_instance_t *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) {
+  while (filt) {
     res = filt->control(filt, cmd, arg);
+    if (res == AF_OK)
+      return filt;
     filt = filt->prev;
   }
-  return (res == AF_OK);
+  return NULL;
 }
 
 void af_help (void) {

Index: af.h
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- af.h	6 Sep 2004 22:27:08 -0000	1.21
+++ af.h	1 Jan 2005 18:46:56 -0000	1.22
@@ -153,8 +153,8 @@
 
 // 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);
+// Returns the accepting filter or NULL if none was found.
+af_instance_t *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




More information about the MPlayer-cvslog mailing list