From 62297a36f75d159e04f5f79c9356310ee9dc8255 Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Mon, 23 Aug 2004 19:15:02 +0000 Subject: [PATCH] Added play.pl git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@386 d19143bc-622f-0410-bfdd-b5b2a6649095 --- mlt++/swig/perl/play.pl | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) create mode 100755 mlt++/swig/perl/play.pl diff --git a/mlt++/swig/perl/play.pl b/mlt++/swig/perl/play.pl new file mode 100755 index 0000000..1b2e5ac --- /dev/null +++ b/mlt++/swig/perl/play.pl @@ -0,0 +1,38 @@ +#!/bin/env perl + +# Import required modules +use mltpp; + +# Not sure why the mltpp::Factory.init method fails... +mltpp::mlt_factory_init( undef ); + +# Create the producer +$p = new mltpp::Producer( $ARGV[0] ); + +if ( $p->is_valid( ) ) +{ + # Loop the video + $p->set( "eof", "loop" ); + + # Create the consumer + $c = new mltpp::Consumer( "sdl" ); + + # Turn of the default rescaling + $c->set( "rescale", "none" ); + + # Connect the producer to the consumer + $c->connect( $p ); + + # Start the consumer + $c->start; + + # Wait until the user stops the consumer + while ( !$c->is_stopped ) { + sleep( 1 ); + } +} +else +{ + print "Unable to open $ARGV[0]\n"; +} + -- 1.7.4.4