sub read_config
{
- my $config_file = "~/.gst";
+ my $config_file = `echo -n ~`."/.gst";
if (-e $config_file)
{
open CONFIG, $config_file;
else
{
print "No configuration file $config_file found. You might want to create one.\n";
- $cfg{AUDIOSINK} = "osssink";
- $cfg{VIDEOSINK} = "xvideosink";
- $cfg{CVS_PATH} = "~/gst/cvs";
- }
-
- # check for gst-launch in cvs dir
- $GST_LAUNCH=$cfg{CVS_PATH}."/gstreamer/tools/gst-launch";
- if (! -x $GST_LAUNCH)
- {
- # let's hope it's installed ...
- $GST_LAUNCH="gst-launch";
}
+ if (!defined $cfg{AUDIOSINK}) { $cfg{AUDIOSINK} = "osssink"; }
+ if (!defined $cfg{VIDEOSINK}) { $cfg{VIDEOSINK} = "sdlvideosink"; }
+ if (!defined $cfg{CVS_PATH}) { $cfg{CVS_PATH} = `echo -n ~`."/gst/cvs"; }
}
### main
my %pipes = (
"mp3", "mad ! $cfg{AUDIOSINK}",
"ogg", "vorbisdec ! $cfg{AUDIOSINK}",
- "mpg", "mpegdemux video_00! { queue ! mpeg2dec ! $cfg{VIDEOSINK} } audio_00! { queue ! mad ! $cfg{AUDIOSINK} }",
+ "mpg", "mpegdemux audio_00! { queue ! mad ! $cfg{AUDIOSINK} } mpegdemux0.video_00! { queue ! mpeg2dec ! $cfg{VIDEOSINK} }",
"avi", "avidemux video_00! { queue ! windec ! $cfg{VIDEOSINK} }",
"vob", "mpegdemux video_00! { queue ! mpeg2dec ! $cfg{VIDEOSINK} }",
if ($pipe = $pipes{$ext})
{
- $command = "$GST_LAUNCH filesrc location=\"$file\" ! $pipe";
+ $command = "gst-launch filesrc location=\"$file\" ! $pipe";
print "Running $command\n";
- system ($command);
+ system ("PATH=\$PATH:".$cfg{CVS_PATH}."/gstreamer/tools/gst-launch $command");
}
else
{