summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-29 04:58:22 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-29 04:58:22 +0000
commit258e4fcdf22745ce2b119df63458790461a6fbf0 (patch)
tree779f2a232d11bd2cbd4efca72f450e1af2640320 /lib/class
parentdb47bcb6c018fecae71b8b7120c70d7ef9c7bcf6 (diff)
downloadampache-258e4fcdf22745ce2b119df63458790461a6fbf0.tar.gz
ampache-258e4fcdf22745ce2b119df63458790461a6fbf0.tar.bz2
ampache-258e4fcdf22745ce2b119df63458790461a6fbf0.zip
fixed downsampling, renamed to transcoding default or always are now the options
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/song.class.php37
-rw-r--r--lib/class/user.class.php2
2 files changed, 17 insertions, 22 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index 1dd7aa20..9e2e5da2 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -789,20 +789,19 @@ class Song {
} // get_url
- /*!
- @function native_stream
- @discussion returns true if the $song->type streams ok, false if it must be transcoded to stream
- */
- function native_stream() {
+ /**
+ * native_stream
+ * This returns true/false if this can be nativly streamed
+ */
+ public function native_stream() {
if ($this->_transcode) { return false; }
$conf_var = 'transcode_' . $this->type;
$conf_type = 'transcode_' . $this->type . '_target';
-
+
if (Config::get($conf_var)) {
$this->_transcode = true;
- $this->format_type(Config::get($conf_type));
debug_event('auto_transcode','Transcoding to ' . $this->type,'5');
return false;
}
@@ -820,21 +819,19 @@ class Song {
*/
function stream_cmd() {
- $parts = pathinfo($this->file);
+ // Find the target for this transcode
+ $conf_type = 'transcode_' . $this->type . '_target';
+ $this->format_type(Config::get($conf_type));
+ $stream_cmd = 'transcode_cmd_' . $this->type;
+ if (Config::get($stream_cmd)) {
+ return $stream_cmd;
+ }
+ else {
+ debug_event('Downsample','Error: Transcode ' . $stream_cmd . ' for ' . $this->type . ' not found, using downsample','2');
+ }
-
- if (!$this->native_stream()) {
- $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 'downsample_cmd';
+ return false;
} // end stream_cmd
diff --git a/lib/class/user.class.php b/lib/class/user.class.php
index 5924eec1..5867a4bb 100644
--- a/lib/class/user.class.php
+++ b/lib/class/user.class.php
@@ -397,11 +397,9 @@ class User {
if (empty($data['username'])) {
Error::add('username',_('Error Username Required'));
-echo "WOO";
}
if ($data['password1'] != $data['password2'] AND !empty($data['password1'])) {
-echo "WOO";
Error::add('password',_("Error Passwords don't match"));
}