summaryrefslogtreecommitdiff
path: root/lib/info.c
diff options
context:
space:
mode:
authorMike Smith <msmith@xiph.org>2001-01-18 10:54:32 +0000
committerMike Smith <msmith@xiph.org>2001-01-18 10:54:32 +0000
commit709a202ad5a8a5d6c26319852e48f4a4ed4d3420 (patch)
treece5b9cef2b9da3f3d50aa4b2c3523e7b162cd8d1 /lib/info.c
parente3ad5dd42cb53bd577d184ce97132d1a10845314 (diff)
downloadlibvorbis-git-709a202ad5a8a5d6c26319852e48f4a4ed4d3420.tar.gz
Added vorbis_commentheader_out() to vorbis
Added ogg_packet_clear to ogg Updated vcedit.c to use them. There's now enough source there to build a working and useful comment editor. svn path=/trunk/vorbis/; revision=1172
Diffstat (limited to 'lib/info.c')
-rw-r--r--lib/info.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/info.c b/lib/info.c
index 4ed357b7..6d0535db 100644
--- a/lib/info.c
+++ b/lib/info.c
@@ -12,7 +12,7 @@
********************************************************************
function: maintain the info structure, info <-> header packets
- last mod: $Id: info.c,v 1.33 2000/11/14 00:05:31 xiphmont Exp $
+ last mod: $Id: info.c,v 1.34 2001/01/18 10:54:32 msmith Exp $
********************************************************************/
@@ -494,6 +494,25 @@ err_out:
return(-1);
}
+int vorbis_commentheader_out(vorbis_comment *vc,
+ ogg_packet *op){
+
+ oggpack_buffer opb;
+
+ oggpack_writeinit(&opb);
+ if(_vorbis_pack_comment(&opb,vc)) return OV_EIMPL;
+
+ op->packet = _ogg_malloc(oggpack_bytes(&opb));
+ memcpy(op->packet, opb.buffer, oggpack_bytes(&opb));
+
+ op->bytes=oggpack_bytes(&opb);
+ op->b_o_s=0;
+ op->e_o_s=0;
+ op->granulepos=0;
+
+ return 0;
+}
+
int vorbis_analysis_headerout(vorbis_dsp_state *v,
vorbis_comment *vc,
ogg_packet *op,