Changeset 1749
- Timestamp:
- 2006-01-04 20:29:00 (3 years ago)
- Files:
-
- phpannodex/trunk/phpsrc/AnxInterval/AnxSMPTE.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
phpannodex/trunk/phpsrc/AnxInterval/AnxSMPTE.php
r1748 r1749 13 13 /* Split it into start and end */ 14 14 $fragments = explode( "-", $timespec ); 15 16 if( false === strpos( $timespec, "drop" ) ) { 17 $drop = false; 18 } else { 19 $drop = true; 20 } 15 21 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 } 18 28 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 */ 21 37 $start_seconds = 60*60*$start_hmsf[1] + 60*$start_hmsf[2] 22 38 + $start_hmsf[3] + $start_hmsf[4]/$fps; 23 39 24 40 /* 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 } 26 46 $end_seconds = 60*60*$end_hmsf[0] + 60*$end_hmsf[1] 27 47 + $end_hmsf[2] + $end_hmsf[3]/$fps;