[xiph-commits] r17994 - in trunk/theora: examples include/theora
tterribe at svn.xiph.org
tterribe at svn.xiph.org
Fri May 20 14:27:08 PDT 2011
Author: tterribe
Date: 2011-05-20 14:27:08 -0700 (Fri, 20 May 2011)
New Revision: 17994
Modified:
trunk/theora/examples/player_example.c
trunk/theora/include/theora/theora.h
Log:
Update the documentation for theora_encode_comment().
It wrongly claimed the returned buffer was owned by libtheora, when
in reality libtheora was creating a temporary buffer and not
storing the pointer to the returned packet anywhere.
Since there's no encoder parameter passed to this function, it
doesn't even have a place to store it.
This situation is sub-optimal, but can be solved by migrating to
the 1.0 API, which does require an encoder instance to encode a
comment, and thus does not have this problem.
Fixes #726.
Modified: trunk/theora/examples/player_example.c
===================================================================
--- trunk/theora/examples/player_example.c 2011-05-20 21:04:42 UTC (rev 17993)
+++ trunk/theora/examples/player_example.c 2011-05-20 21:27:08 UTC (rev 17994)
@@ -654,14 +654,14 @@
th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level,sizeof(pp_level));
pp_inc=0;
- /*{
+ {
int arg = 0xffff;
th_decode_ctl(td,TH_DECCTL_SET_TELEMETRY_MBMODE,&arg,sizeof(arg));
th_decode_ctl(td,TH_DECCTL_SET_TELEMETRY_MV,&arg,sizeof(arg));
th_decode_ctl(td,TH_DECCTL_SET_TELEMETRY_QI,&arg,sizeof(arg));
arg=10;
th_decode_ctl(td,TH_DECCTL_SET_TELEMETRY_BITS,&arg,sizeof(arg));
- }*/
+ }
}else{
/* tear down the partial theora setup */
th_info_clear(&ti);
@@ -766,8 +766,8 @@
keyframing. Soon enough libtheora will be able to deal
with non-keyframe seeks. */
- if(videobuf_time>=get_time())
videobuf_ready=1;
+ if(videobuf_time>=get_time());
else{
/*If we are too slow, reduce the pp level.*/
pp_inc=pp_level>0?-1:0;
Modified: trunk/theora/include/theora/theora.h
===================================================================
--- trunk/theora/include/theora/theora.h 2011-05-20 21:04:42 UTC (rev 17993)
+++ trunk/theora/include/theora/theora.h 2011-05-20 21:27:08 UTC (rev 17994)
@@ -496,7 +496,11 @@
* \param op An ogg_packet structure to fill. libtheora will set all
* elements of this structure, including a pointer to the encoded
* comment data. The memory for the comment data is owned by
- * libtheora.
+ * the application, and must be freed by it using _ogg_free().
+ * On some systems (such as Windows when using dynamic linking), this
+ * may mean the free is executed in a different module from the
+ * malloc, which will crash; there is no way to free this memory on
+ * such systems.
* \retval 0 Success
*/
extern int theora_encode_comment(theora_comment *tc, ogg_packet *op);
More information about the commits
mailing list