lib/xiph/VorbisComments: pass struct vorbis_comment instead of char**

Use the "comments" attribute instead of relying on the nullptr
terminator.
This commit is contained in:
Max Kellermann
2019-08-14 11:21:35 +02:00
parent 9ae9b2c18f
commit 2c2efaa91f
3 changed files with 43 additions and 23 deletions

View File

@@ -157,10 +157,10 @@ VorbisDecoder::OnOggBeginning(const ogg_packet &_packet)
}
static void
vorbis_send_comments(DecoderClient &client, InputStream &is,
char **comments)
SubmitVorbisComment(DecoderClient &client, InputStream &is,
const vorbis_comment &vc)
{
auto tag = vorbis_comments_to_tag(comments);
auto tag = VorbisCommentToTag(vc);
if (!tag)
return;
@@ -269,10 +269,10 @@ VorbisDecoder::OnOggPacket(const ogg_packet &_packet)
} else
SubmitInit();
vorbis_send_comments(client, input_stream, vc.user_comments);
SubmitVorbisComment(client, input_stream, vc);
ReplayGainInfo rgi;
if (vorbis_comments_to_replay_gain(rgi, vc.user_comments))
if (VorbisCommentToReplayGain(rgi, vc))
client.SubmitReplayGain(&rgi);
} else {
if (!dsp_initialized) {
@@ -404,7 +404,7 @@ vorbis_scan_stream(InputStream &is, TagHandler &handler) noexcept
/* visit the Vorbis comments we just read */
vorbis_comments_scan(vc.user_comments, handler);
VorbisCommentScan(vc, handler);
/* check the song duration by locating the e_o_s packet */