From: Frank M. Kromann Date: Thu, 9 Nov 2006 09:24:18 +0000 (+0000) Subject: MFB 5_2: X-Git-Tag: RELEASE_1_0_0RC1~1093 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d774a429d64478ca6ab549ab5805774fc389bb09;p=php MFB 5_2: Revert patch for warnings about missing headers. These are fixed in the latest version of libming. Sync code for SWFMovie::streamMP3. This function will now return the number of frames in the file. --- diff --git a/ext/ming/config.m4 b/ext/ming/config.m4 index 4cf3d9c5c2..bc92e239a9 100644 --- a/ext/ming/config.m4 +++ b/ext/ming/config.m4 @@ -84,9 +84,6 @@ int main(void) { SWFMovie_output(NULL, NULL, NULL, 0); return 0; } ], []) CPPFLAGS=$old_CPPFLAGS - AC_CHECK_HEADERS([ming/displaylist.h]) - AC_CHECK_HEADERS([ming/movie.h]) - PHP_NEW_EXTENSION(ming, ming.c, $ext_shared) PHP_SUBST(MING_SHARED_LIBADD) fi diff --git a/ext/ming/ming.c b/ext/ming/ming.c index c2d3758d8e..88ac1bc418 100644 --- a/ext/ming/ming.c +++ b/ext/ming/ming.c @@ -36,12 +36,6 @@ #include #include #include -#ifdef HAVE_MING_DISPLAYLIST_H -# include -#endif -#ifdef HAVE_MING_MOVIE_H -# include -#endif #define FLOAT_Z_DVAL_PP(x) ((float)Z_DVAL_PP(x)) #define BYTE_Z_LVAL_PP(x) ((byte)Z_LVAL_PP(x)) @@ -2480,17 +2474,31 @@ PHP_METHOD(swfmovie, setFrames) /* }}} */ #ifdef HAVE_NEW_MING -/* {{{ proto void swfmovie::streamMP3(mixed file) - Sets sound stream of the SWF movie. The parameter can be stream or string. */ +/* {{{ proto int swfmovie::streamMP3(mixed file [, float skip]) + Sets sound stream of the SWF movie. The parameter can be stream or string. Retuens the number of frames. */ PHP_METHOD(swfmovie, streamMP3) { - zval **zfile; + zval **zfile, **zskip; + float skip; SWFSoundStream sound; SWFInput input; SWFMovie movie = getMovie(getThis() TSRMLS_CC); - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zfile) == FAILURE) { - WRONG_PARAM_COUNT; + switch (ZEND_NUM_ARGS()) { + case 1: + if(zend_get_parameters_ex(1, &zfile) == FAILURE) + WRONG_PARAM_COUNT; + skip = 0; + break; + case 2: + if(zend_get_parameters_ex(2, &zfile, &zskip) == FAILURE) + WRONG_PARAM_COUNT; + convert_to_double_ex(zskip); + skip = Z_DVAL_PP(zskip); + break; + default: + WRONG_PARAM_COUNT; + break; } if (Z_TYPE_PP(zfile) != IS_RESOURCE) { @@ -2502,7 +2510,8 @@ PHP_METHOD(swfmovie, streamMP3) } sound = newSWFSoundStream_fromInput(input); - SWFMovie_setSoundStream(movie, sound); + SWFMovie_setSoundStreamAt(movie, sound, skip); + RETURN_LONG(SWFSoundStream_getFrames(sound)); } /* }}} */