summaryrefslogtreecommitdiffstats
path: root/lib/class/vainfo.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-02-09 23:04:15 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-02-09 23:04:15 +0000
commit58900248ccdb00f5f6f591d4fe9cda3cd607be55 (patch)
treeb4273a5903105c3f1245f10c6a06bcaf3e0d5b81 /lib/class/vainfo.class.php
parentf694c28b6331ce772dc06107209d09e466d82cad (diff)
downloadampache-58900248ccdb00f5f6f591d4fe9cda3cd607be55.tar.gz
ampache-58900248ccdb00f5f6f591d4fe9cda3cd607be55.tar.bz2
ampache-58900248ccdb00f5f6f591d4fe9cda3cd607be55.zip
tweak it so that flv is a valid video type and correctly(??) get the codec from it
Diffstat (limited to 'lib/class/vainfo.class.php')
-rw-r--r--lib/class/vainfo.class.php36
1 files changed, 35 insertions, 1 deletions
diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php
index ffbd1b92..0ce1f44a 100644
--- a/lib/class/vainfo.class.php
+++ b/lib/class/vainfo.class.php
@@ -266,7 +266,12 @@ class vainfo {
*/
if ($type = $this->_raw['video']['dataformat']) {
// Manually set the tag information
- $this->_raw['tags']['avi'] = array();
+ if ($type == 'flv') {
+ $this->_raw['tags']['flv'] = array();
+ }
+ else {
+ $this->_raw['tags']['avi'] = array();
+ }
$this->_clean_type($type);
return $type;
}
@@ -330,6 +335,9 @@ class vainfo {
case 'riff':
$results[$key] = $this->_parse_riff($tag_array);
break;
+ case 'flv':
+ $results[$key] = $this->_parse_flv($this->_raw2);
+ break;
case 'avi':
$results[$key] = $this->_parse_avi($this->_raw2);
break;
@@ -408,6 +416,9 @@ class vainfo {
case 'vorbis':
return 'ogg';
break;
+ case 'flv':
+ return 'flv';
+ break;
case 'avi':
return 'avi';
break;
@@ -623,6 +634,29 @@ class vainfo {
} // _parse_avi
/**
+ * _parse_flv
+ * This attempts to parse our the information on an flv file and present it in some
+ * kind of sane format, this is a little hard as these files don't have tags
+ */
+ private function _parse_flv($tags) {
+
+ $array = array();
+
+ $info = pathinfo($this->filename);
+
+ $array['title'] = $info['filename'];
+ $array['video_codec'] = $tags['video']['codec'];
+ $array['audio_codec'] = $tags['audio']['dataformat'];
+ $array['resolution_x'] = $tags['video']['resolution_x'];
+ $array['resolution_y'] = $tags['video']['resolution_y'];
+ $array['mime'] = $tags['mime_type'];
+ $array['comment'] = $tags['video']['codec'];
+
+ return $array;
+
+ } // _parse_flv
+
+ /**
* _parse_filename
* This function uses the passed file and dir patterns
* To pull out extra tag information and populate it into