Changeset 1749

Show
Ignore:
Timestamp:
2006-01-04 20:29:00 (3 years ago)
Author:
ctford
Message:

"drop" supported, in a hackish way.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • phpannodex/trunk/phpsrc/AnxInterval/AnxSMPTE.php

    r1748 r1749  
    1313                /* Split it into start and end */ 
    1414                $fragments = explode( "-", $timespec ); 
     15                 
     16                if( false === strpos( $timespec, "drop" ) ) { 
     17                        $drop = false; 
     18                } else { 
     19                        $drop = true; 
     20                } 
    1521 
    16                 /* Get frames per second. */ 
    17                 $fps = $start_hmsf[0]; 
     22                /* Start to parse first half. */ 
     23                if( $drop ) { 
     24                        $start_hmsf = explode( ":", $fragments[1] ); 
     25                } else { 
     26                        $start_hmsf = explode( ":", $fragments[0] ); 
     27                } 
    1828 
    19                 /* Parse first half. */ 
    20                 $start_hmsf = explode( ":", $fragments[0] ); 
     29                /* Work out frames per second. */ 
     30                if( $drop ) { 
     31                        $fps = $fragments[0]/1.001; 
     32                } else { 
     33                        $fps = $start_hmsf[0]; 
     34                } 
     35 
     36                /* Finish first half */ 
    2137                $start_seconds = 60*60*$start_hmsf[1] + 60*$start_hmsf[2]  
    2238                        + $start_hmsf[3] + $start_hmsf[4]/$fps; 
    2339                         
    2440                /* Parse second half. */ 
    25                 $end_hmsf = explode( ":", $fragments[1] ); 
     41                if( $drop ) { 
     42                        $end_hmsf = explode( ":", $fragments[2] ); 
     43                } else { 
     44                        $end_hmsf = explode( ":", $fragments[1] ); 
     45                } 
    2646                $end_seconds = 60*60*$end_hmsf[0] + 60*$end_hmsf[1]  
    2747                        + $end_hmsf[2] + $end_hmsf[3]/$fps;