albino.c: fix playout with SDL on Mac OS X
[melted] / src / framework / mlt_field.c
index 1a93cd9..924eee9 100644 (file)
@@ -3,19 +3,19 @@
  * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
  * Author: Charles Yates <charles.yates@pandora.be>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #include "mlt_field.h"
@@ -191,3 +191,27 @@ void mlt_field_close( mlt_field this )
        }
 }
 
+void mlt_field_disconnect_service( mlt_field self, mlt_service service )
+{
+       mlt_service p = mlt_service_producer( service );
+       mlt_service c = mlt_service_consumer( service);
+       int i;
+       switch ( mlt_service_identify(c) )
+       {
+               case filter_type:
+                       i = mlt_filter_get_track( MLT_FILTER(c) );
+                       mlt_service_connect_producer( c, p, i );
+                       break;
+               case transition_type:
+                       i = mlt_transition_get_a_track ( MLT_TRANSITION(c) );
+                       mlt_service_connect_producer( c, p, i );
+                       MLT_TRANSITION(c)->producer = p;
+                       break;
+               case tractor_type:
+                       self->producer = p;
+                       mlt_tractor_connect( MLT_TRACTOR(c), p );
+               default:
+                       break;
+       }
+       mlt_events_fire( mlt_field_properties( self ), "service-changed", NULL );
+}