Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ices 0.4 perl problem

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Source Clients
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Sat May 06, 2006 12:27 am    Post subject: ices 0.4 perl problem Reply with quote

I wrote a perl playlist handler but ices pukes on it with the following:

DEBUG: Sending following information to libshout:
DEBUG: Stream: 0
DEBUG: Host: localhost:8000 (protocol: http)
DEBUG: Mount: /rp, Password: *****
DEBUG: Name: RPMedia Radio URL: ****
DEBUG: Genre: Independent Recordings Desc: RPMedia Radio streams the work of recording artists at RecordingProject.com
DEBUG: Bitrate: 64 Public: 0
DEBUG: Dump file: (null)
DEBUG: Initializing playlist handler...
DEBUG: Importing perl module: ices
DEBUG: perl_parse() error: parse problem
Initialization of playlist handler failed. []
Ices Exiting...


The script itself runs fine manually.

So I took the ices.pm.dist file and tried to use it, and I get the exact same perl_parse() error: parse problem message.

What could be wrong?
Back to top
Anonymous
Guest





PostPosted: Sat May 06, 2006 9:12 pm    Post subject: Reply with quote

Update, the python script works, but I still get the error when trying to use a perl script. Anyone?
Back to top
Anonymous
Guest





PostPosted: Sun May 07, 2006 7:26 pm    Post subject: Reply with quote

I'm not too familiar with Perl modules but I've made a little progress. It's still not working though.

For anyone who is interested, the package name and file name must be the same, and this should match the module name in the ices.conf file (I believe).

My code now looks something like this:

Code:

package ices;

use strict;
use DBI qw(:sql_types);

require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(ices_get_next);

.
.
.

sub ices_get_next {
    return $nextSongFile;
}

1;


However, I'm now getting the error:

DEBUG: Importing perl module: ices
Initialization of playlist handler failed. [The playlist module must define at least the ices_get_next method]
[/code]
Back to top
Anonymous
Guest





PostPosted: Sun May 07, 2006 7:46 pm    Post subject: Reply with quote

Ok, I got it working. Have to use EXPORT instead of EXPORT_OK.

For anyone looking to write a perl playlist handler for ices, the supplied ices.pm.dist file is less than adequate. Your module code at a minimum should look like this:

Code:

# package name must be the same as the file name. 
# So this package is called ices, and the file name must be ices.pm
# Also, the package name should be the same as the Module definition
# in the ices.conf file: <Module>ices</Module>
package ices; 

use strict;

# Export ices_get_next function.
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(ices_get_next);

sub ices_get_next {
    return "someFileName";
}

1; # all modules must return true


If you want to use more of the methods that ices allows you to define, then you must add them to your export array, like this:

our @EXPORT = qw(ices_get_next ices_init ices_shutdown);
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Source Clients All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber