~ubuntu-branches/debian/sid/ampache/sid

« back to all changes in this revision

Viewing changes to modules/getid3/module.audio-video.bink.php

  • Committer: Package Import Robot
  • Author(s): Charlie Smotherman
  • Date: 2013-08-27 13:19:48 UTC
  • mfrom: (1.2.9)
  • Revision ID: package-import@ubuntu.com-20130827131948-1czew0zxn6u70dtv
Tags: 3.6-rzb2752+dfsg-1
* New upsteam snapshot.  Contains important bug fixes to the installer.
* Correct typo in ampache-common.postrm.
* Remove courtousy copy of php-getid3, during repack.  Closes: #701526
* Update package to use dh_linktree to make the needed sym links to the
  needed system libs that were removed during repack.
* Update debian/rules to reflect upstreams removing/moving of modules.
* Update debian/ampache-common.install to reflect upstreams removal of files.
* Updated to use new apache2.4 API. Closes: #669756
* Updated /debian/po/de.po thx David Prévot for the patch.  Closes:  #691963
* M3U import is now ordered, fixed upstream.  Closes: #684984
* Text input area has been resized so IPv6 addresses will now fit, fixed
  upstream.  Closes:  #716230
* Added ampache-common.preinst to make sure that the courtousy copies of code
  dirs are empty so dh_linktree can do it's magic on upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/////////////////////////////////////////////////////////////////
3
 
/// getID3() by James Heinrich <info@getid3.org>               //
4
 
//  available at http://getid3.sourceforge.net                 //
5
 
//            or http://www.getid3.org                         //
6
 
/////////////////////////////////////////////////////////////////
7
 
// See readme.txt for more details                             //
8
 
/////////////////////////////////////////////////////////////////
9
 
//                                                             //
10
 
// module.audio.bink.php                                       //
11
 
// module for analyzing Bink or Smacker audio-video files      //
12
 
// dependencies: NONE                                          //
13
 
//                                                            ///
14
 
/////////////////////////////////////////////////////////////////
15
 
 
16
 
 
17
 
class getid3_bink extends getid3_handler
18
 
{
19
 
 
20
 
        function Analyze() {
21
 
                $info = &$this->getid3->info;
22
 
 
23
 
$info['error'][] = 'Bink / Smacker files not properly processed by this version of getID3() ['.$this->getid3->version().']';
24
 
 
25
 
                fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
26
 
                $fileTypeID = fread($this->getid3->fp, 3);
27
 
                switch ($fileTypeID) {
28
 
                        case 'BIK':
29
 
                                return $this->ParseBink();
30
 
                                break;
31
 
 
32
 
                        case 'SMK':
33
 
                                return $this->ParseSmacker();
34
 
                                break;
35
 
 
36
 
                        default:
37
 
                                $info['error'][] = 'Expecting "BIK" or "SMK" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($fileTypeID).'"';
38
 
                                return false;
39
 
                                break;
40
 
                }
41
 
 
42
 
                return true;
43
 
 
44
 
        }
45
 
 
46
 
        function ParseBink() {
47
 
                $info = &$this->getid3->info;
48
 
                $info['fileformat']          = 'bink';
49
 
                $info['video']['dataformat'] = 'bink';
50
 
 
51
 
                $fileData = 'BIK'.fread($this->getid3->fp, 13);
52
 
 
53
 
                $info['bink']['data_size']   = getid3_lib::LittleEndian2Int(substr($fileData, 4, 4));
54
 
                $info['bink']['frame_count'] = getid3_lib::LittleEndian2Int(substr($fileData, 8, 2));
55
 
 
56
 
                if (($info['avdataend'] - $info['avdataoffset']) != ($info['bink']['data_size'] + 8)) {
57
 
                        $info['error'][] = 'Probably truncated file: expecting '.$info['bink']['data_size'].' bytes, found '.($info['avdataend'] - $info['avdataoffset']);
58
 
                }
59
 
 
60
 
                return true;
61
 
        }
62
 
 
63
 
        function ParseSmacker() {
64
 
                $info = &$this->getid3->info;
65
 
                $info['fileformat']          = 'smacker';
66
 
                $info['video']['dataformat'] = 'smacker';
67
 
 
68
 
                return true;
69
 
        }
70
 
 
71
 
}
72
 
 
73
 
?>
 
 
b'\\ No newline at end of file'