cvs: pecl /oggvorbis oggvorbis.c
| From: | Sara Golemon | Date: | Tue, 16 Sep 2003 14:52:54 +0000 |
| Subject: | cvs: pecl /oggvorbis oggvorbis.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-442@lists.php.net to get a copy of this message | ||
pollita Tue Sep 16 10:52:54 2003 EDT
Modified files:
/pecl/oggvorbis oggvorbis.c
Log:
Miscellaneous fixed
Index: pecl/oggvorbis/oggvorbis.c
diff -u pecl/oggvorbis/oggvorbis.c:1.4 pecl/oggvorbis/oggvorbis.c:1.5
--- pecl/oggvorbis/oggvorbis.c:1.4 Wed Sep 10 19:23:25 2003
+++ pecl/oggvorbis/oggvorbis.c Tue Sep 16 10:52:54 2003
@@ -190,7 +190,7 @@
vorbis_comment_add_tag(&(data->vcomment), key, Z_STRVAL_PP(cmtval));
break;
case IS_LONG:
- spprintf(&tmpstr, 12, "%ld", Z_LVAL_PP(cmtval));
+ spprintf(&tmpstr, 36, "%ld", Z_LVAL_PP(cmtval));
vorbis_comment_add_tag(&(data->vcomment), key, tmpstr);
efree(tmpstr);
break;
@@ -201,6 +201,8 @@
break;
default:
/* Do nothing with other types */
+ convert_to_string_ex(cmtval);
+ vorbis_comment_add_tag(&(data->vcomment), key, Z_STRVAL_PP(cmtval));
}
}
}
@@ -273,9 +275,9 @@
if (val > 127) {
val -= 256;
}
- samples[i][j] = (float)( val / 127.0);
+ samples[i][j] = ((float)val / 127.0);
} else {
- samples[i][j] = (float)( val / 127.0) - 1.0;
+ samples[i][j] = ((float)val / 127.0) - 1.0;
}
break;
case OGGVORBIS_PCM_16BIT:
@@ -288,9 +290,9 @@
if (val > 32767) {
val -= 65536;
}
- samples[i][j] = (float)(val / 32767.0);
+ samples[i][j] = ((float)val / 32767.0);
} else {
- samples[i][j] = (float)(val / 32767.0) - 1.0;
+ samples[i][j] = ((float)val / 32767.0) - 1.0;
}
break;
default:
@@ -575,14 +577,14 @@
}
}
- flt += 0.000001;
+ flt = flt + 0.000001;
switch (data->pcm_mode & OGGVORBIS_PCM_MASK) {
case OGGVORBIS_PCM_8BIT:
*ptr = (char) (flt * 127.0);
break;
case OGGVORBIS_PCM_16BIT:
- val = flt * 32767.0;
+ val = (unsigned long) (flt * 32767.0);
if (data->pcm_mode & OGGVORBIS_PCM_LE) {
*ptr = (char)(val & 0xFF);
*(ptr+1) = (char)(val >> 8);
@@ -775,10 +777,12 @@
NULL, /* stat_url */
NULL, /* opendir */
"OGG",
+#if PHP_MAJOR_VERSION >= 5
NULL /* unlink */
+#endif
};
-PHPAPI php_stream_wrapper php_stream_oggvorbis_wrapper = {
+static php_stream_wrapper php_stream_oggvorbis_wrapper = {
&oggvorbis_stream_wops,
NULL,
0 /* is_url */
@@ -793,7 +797,7 @@
REGISTER_LONG_CONSTANT("OGGVORBIS_PCM_S16_BE", OGGVORBIS_PCM_S16_BE, CONST_CS |
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OGGVORBIS_PCM_S16_LE", OGGVORBIS_PCM_S16_LE, CONST_CS |
CONST_PERSISTENT);
- return php_register_url_stream_wrapper("ogg", &php_stream_oggvorbis_wrapper
TSRMLS_CC);;
+ return php_register_url_stream_wrapper("ogg", &php_stream_oggvorbis_wrapper
TSRMLS_CC);
}
PHP_MSHUTDOWN_FUNCTION(oggvorbis)