diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/encoder/vorbis_encoder.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/encoder/vorbis_encoder.c b/src/encoder/vorbis_encoder.c index af325cbaa..a1ff89388 100644 --- a/src/encoder/vorbis_encoder.c +++ b/src/encoder/vorbis_encoder.c @@ -302,17 +302,26 @@ copy_tag_to_vorbis_comment(vorbis_comment *vc, const struct tag *tag) static bool vorbis_encoder_tag(struct encoder *_encoder, const struct tag *tag, - GError **error) + G_GNUC_UNUSED GError **error) { struct vorbis_encoder *encoder = (struct vorbis_encoder *)_encoder; + vorbis_comment comment; + ogg_packet packet; - vorbis_encoder_clear(encoder); - if (!vorbis_encoder_reinit(encoder, error)) - return false; + /* write the vorbis_comment object */ - copy_tag_to_vorbis_comment(&encoder->vc, tag); + vorbis_comment_init(&comment); + copy_tag_to_vorbis_comment(&comment, tag); - vorbis_encoder_send_header(encoder); + /* convert that vorbis_comment into a ogg_packet */ + + vorbis_commentheader_out(&comment, &packet); + vorbis_comment_clear(&comment); + + /* .. and send it into the ogg_stream_state */ + + ogg_stream_packetin(&encoder->os, &packet); + ogg_packet_clear(&packet); return true; } |