Changeset 1740

Show
Ignore:
Timestamp:
2006-01-03 19:47:58 (3 years ago)
Author:
ctford
Message:

Outputs bitrate and duration info to the headers.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • phpannodex/trunk/phpsrc/nph-mod_annodex.php

    r1735 r1740  
    44        require_once("AnxInterval/AnxInterval.php"); 
    55         
    6         define( "BUFFER_SIZE",  1024); 
     6        define( "ANX_BUFFER_SIZE",  1024); 
    77         
    88        /* Attempt to stop browsers caching the output of the script. */ 
     
    9696        start_headers(); 
    9797        echo "Content-Type: application/x-annodex\n"; 
    98         //echo "Content-Type: text/plain\n"; 
    99         echo "\n"; 
    10098 
    10199        anx_init_importers( "*/*" ); 
     
    113111 
    114112        anx_write_import( $anx, $filename, $id, $content_type,  
    115                 $interval->get_start(), $interval->get_end(), (int) $flags );  
     113                $interval->get_start(), 57,//$interval->get_end(),  
     114                (int) $flags );  
    116115 
     116        /* Output bitrate and duration information to the headers. */ 
     117        echo "X-Bitrate: ", anx_get_bitrate( $anx ), "\n"; 
     118        echo "X-Duration: ", anx_get_duration( $anx ), "\n"; 
     119        echo "\n"; 
    117120 
    118121        /* Output the file as a series of binary strings, the size of which 
    119122         * is determined by BUFFER_SIZE.         
    120123         */ 
    121         while( $buffer = anx_write_output( $anx, BUFFER_SIZE ) ) { 
     124        while( $buffer = anx_write_output( $anx, ANX_BUFFER_SIZE ) ) { 
    122125                echo $buffer; 
    123126        } 
     
    128131} 
    129132?>       
    130