36
36
#include <stdio.h>
37
37
#include <math.h>
38
38
#include <ming.h>
39
- #ifdef HAVE_MING_DISPLAYLIST_H
40
- # include <ming/displaylist.h>
41
- #endif
42
- #ifdef HAVE_MING_MOVIE_H
43
- # include <ming/movie.h>
44
- #endif
45
39
46
40
#define FLOAT_Z_DVAL_PP (x ) ((float)Z_DVAL_PP(x))
47
41
#define BYTE_Z_LVAL_PP (x ) ((byte)Z_LVAL_PP(x))
@@ -2482,17 +2476,31 @@ PHP_METHOD(swfmovie, setFrames)
2482
2476
/* }}} */
2483
2477
2484
2478
#ifdef HAVE_NEW_MING
2485
- /* {{{ proto void swfmovie::streamMP3(mixed file)
2486
- Sets sound stream of the SWF movie. The parameter can be stream or string. */
2479
+ /* {{{ proto int swfmovie::streamMP3(mixed file [, float skip] )
2480
+ Sets sound stream of the SWF movie. The parameter can be stream or string. Retuens the number of frames. */
2487
2481
PHP_METHOD (swfmovie , streamMP3 )
2488
2482
{
2489
- zval * * zfile ;
2483
+ zval * * zfile , * * zskip ;
2484
+ float skip ;
2490
2485
SWFSoundStream sound ;
2491
2486
SWFInput input ;
2492
2487
SWFMovie movie = getMovie (getThis () TSRMLS_CC );
2493
2488
2494
- if (ZEND_NUM_ARGS () != 1 || zend_get_parameters_ex (1 , & zfile ) == FAILURE ) {
2495
- WRONG_PARAM_COUNT ;
2489
+ switch (ZEND_NUM_ARGS ()) {
2490
+ case 1 :
2491
+ if (zend_get_parameters_ex (1 , & zfile ) == FAILURE )
2492
+ WRONG_PARAM_COUNT ;
2493
+ skip = 0 ;
2494
+ break ;
2495
+ case 2 :
2496
+ if (zend_get_parameters_ex (2 , & zfile , & zskip ) == FAILURE )
2497
+ WRONG_PARAM_COUNT ;
2498
+ convert_to_double_ex (zskip );
2499
+ skip = Z_DVAL_PP (zskip );
2500
+ break ;
2501
+ default :
2502
+ WRONG_PARAM_COUNT ;
2503
+ break ;
2496
2504
}
2497
2505
2498
2506
if (Z_TYPE_PP (zfile ) != IS_RESOURCE ) {
@@ -2504,7 +2512,8 @@ PHP_METHOD(swfmovie, streamMP3)
2504
2512
}
2505
2513
2506
2514
sound = newSWFSoundStream_fromInput (input );
2507
- SWFMovie_setSoundStream (movie , sound );
2515
+ SWFMovie_setSoundStreamAt (movie , sound , skip );
2516
+ RETURN_LONG (SWFSoundStream_getFrames (sound ));
2508
2517
}
2509
2518
/* }}} */
2510
2519
0 commit comments