[xiph-commits] r7247 - in trunk/py-ogg2: examples src

arc at dactyl.lonelymoon.com arc
Wed Jul 21 13:38:57 PDT 2004


Author: arc
Date: Wed Jul 21 13:38:57 2004
New Revision: 7247

Modified:
trunk/py-ogg2/examples/writ_encoder.py
trunk/py-ogg2/src/_ogg2module.c
Log:
A few minor fixes, added ogg2.Ogg_Cont and ogg2.Ogg_Discont



Modified: trunk/py-ogg2/examples/writ_encoder.py
===================================================================
--- trunk/py-ogg2/examples/writ_encoder.py	2004-07-21 20:36:09 UTC (rev 7246)
+++ trunk/py-ogg2/examples/writ_encoder.py	2004-07-21 20:38:56 UTC (rev 7247)
@@ -55,6 +55,7 @@
class OggStream :
def __init__(self) :
self.os = ogg2.OggStreamState(random.randrange(2**24))
+      self.os.setmode(ogg2.Ogg_Discont)
self.oy = ogg2.OggSyncState()
self.fd = open('test.writ.ogg','w')
self.pn = 0

Modified: trunk/py-ogg2/src/_ogg2module.c
===================================================================
--- trunk/py-ogg2/src/_ogg2module.c	2004-07-21 20:36:09 UTC (rev 7246)
+++ trunk/py-ogg2/src/_ogg2module.c	2004-07-21 20:38:56 UTC (rev 7247)
@@ -23,8 +23,6 @@

static char docstring[] = "";

-/* This stuff is useful to py-ogg2 submodules */
-
void
init_ogg2(void)
{
@@ -51,9 +49,12 @@
PyDict_SetItemString(dict, "OggPacketError", PyOggPacket_Error);
Py_INCREF(PyOggPacket_Error);

-  PyDict_SetItemString(dict, "__doc__", PyString_FromString(docstring));
-  PyDict_SetItemString(dict, "__version__", PyString_FromString("2.0-pre_20040224"));
+  PyModule_AddStringConstant(module, "__doc__", docstring);
+  PyModule_AddStringConstant(module, "__version__", "2.0-pre_20040721");

+  PyModule_AddIntConstant(module, "Ogg_Cont", OGG_CONT);
+  PyModule_AddIntConstant(module, "Ogg_Discont", OGG_DISCONT);
+
if (PyErr_Occurred())
PyErr_SetString(PyExc_ImportError, "_ogg2: init failed");
}



More information about the commits mailing list