Commit 709a202a authored by Michael Smith's avatar Michael Smith
Browse files

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
parent e3ad5dd4
......@@ -12,7 +12,7 @@
********************************************************************
function: libvorbis codec headers
last mod: $Id: codec.h,v 1.33 2000/11/06 00:06:55 xiphmont Exp $
last mod: $Id: codec.h,v 1.34 2001/01/18 10:54:31 msmith Exp $
********************************************************************/
......@@ -178,6 +178,7 @@ extern void vorbis_dsp_clear(vorbis_dsp_state *v);
/* Vorbis PRIMITIVES: analysis/DSP layer ****************************/
extern int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi);
extern int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op);
extern int vorbis_analysis_headerout(vorbis_dsp_state *v,
vorbis_comment *vc,
ogg_packet *op,
......
......@@ -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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment