summaryrefslogtreecommitdiffstats
path: root/lib/class/song.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-01-27 03:05:35 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-01-27 03:05:35 +0000
commitbb372c24ff948c7b3e8c0c10f56ae55349fadd4f (patch)
treef4359dea642a6deccd138752ede399d1f4a21d8d /lib/class/song.class.php
parente1b4e203f7546499ae85d8caa0b0b924a225b96a (diff)
downloadampache-bb372c24ff948c7b3e8c0c10f56ae55349fadd4f.tar.gz
ampache-bb372c24ff948c7b3e8c0c10f56ae55349fadd4f.tar.bz2
ampache-bb372c24ff948c7b3e8c0c10f56ae55349fadd4f.zip
hopefully the final commit before the 3.3.3 stable release
Diffstat (limited to 'lib/class/song.class.php')
-rw-r--r--lib/class/song.class.php31
1 files changed, 14 insertions, 17 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index c7fcd658..36785a36 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -869,29 +869,26 @@ class Song {
* stream_cmd
* test if the song type streams natively and
* if not returns a transcoding command from the config
+ * we can't use this->type because its been formated for the
+ * downsampling
*/
function stream_cmd() {
-
- $return = 'downsample_cmd';
+
+ $parts = pathinfo($this->file);
+
+
if (!$this->native_stream()) {
- switch ($this->type) {
- case 'm4a':
- $return = 'stream_cmd_m4a';
- break;
- case 'flac':
- $return = 'stream_cmd_flac';
- break;
- case 'mpc':
- $return = 'stream_cmd_mpc';
- break;
- default:
- $return = 'downsample_cmd';
- break;
- } // end switch
+ $stream_cmd = 'stream_cmd_' . $parts['extension'];
+ if (conf($stream_cmd)) {
+ return $stream_cmd;
+ }
+ else {
+ debug_event('Downsample','Error: Stream command for ' . $parts['extension'] . ' not found, using downsample','2');
+ }
} // end if not native_stream
- return $return;
+ return 'downsample_cmd';
} // end stream_cmd