[flac-dev] libflac doesn't find more than one metadata block

Hadrien Lacour hadrien.lacour at posteo.net
Sun Nov 25 23:20:46 UTC 2018


Hello, I'm currently doing a little music player using libflac and libao. What
I've currently done works as it should, but I have a problem where only one
metadata block is detected, even if there are more (it doesn't have the last
attribute set to true).

This is using flac 1.3.2 on Gentoo amd64.

The main code file is attached, it mainly follows the examples given with the
libflac and libao doc (using the stream_decoder with all the relevant
callbacks; including metadata, the one causing me problems here).
And here's what metaflac --list gives me on a test file:

METADATA block #0
  type: 0 (STREAMINFO)
  is last: false
  length: 34
  minimum blocksize: 4608 samples
  maximum blocksize: 4608 samples
  minimum framesize: 2291 bytes
  maximum framesize: 10321 bytes
  sample_rate: 44100 Hz
  channels: 2
  bits-per-sample: 16
  total samples: 8800596
  MD5 signature: 9e471211972413ceb8febcdc77ef9d68
METADATA block #1
  type: 4 (VORBIS_COMMENT)
  is last: false
  length: 439
  vendor string: Lavf57.83.100
  comments: 14
    comment[0]: REPLAYGAIN_ALGORITHM=ITU-R BS.1770
    comment[1]: REPLAYGAIN_REFERENCE_LOUDNESS=-18.00
    comment[2]: REPLAYGAIN_TRACK_GAIN=8.53 dB
    comment[3]: REPLAYGAIN_TRACK_PEAK=0.218024
    comment[4]: REPLAYGAIN_ALBUM_GAIN=-0.03 dB
    comment[5]: REPLAYGAIN_ALBUM_PEAK=0.695334
    comment[6]: encoder=Lavf57.83.100
    comment[7]: ARTIST=Hirilorn
    comment[8]: TITLE=Return of the Druids
    comment[9]: TRACKNUMBER=01
    comment[10]: TRACKTOTAL=9
    comment[11]: ALBUMARTIST=Hirilorn / Nasav
    comment[12]: ALBUM=A Hymn to the Ancient Souls / Umr at tawil
    comment[13]: DATE=2000
METADATA block #2
  type: 1 (PADDING)
  is last: true
  length: 8192


If anyone has the solution or some clues, I'd be glad to hear it.

Regards,
Hadrien Lacour


PS: sorry for posting this also on flac at xiph.org, I confused the two lists
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-c
Size: 5809 bytes
Desc: not available
URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20181126/ed65a897/attachment.bin>


More information about the flac-dev mailing list