<font size=2 face="sans-serif">Hello,</font><br><br><font size=2 face="sans-serif">I hope this is the right place for this
kind of question.</font><br><br><font size=2 face="sans-serif">As developper, i'm actually writing
java interface to use libFLAC with JNA, to reproduce "flac -t"
function, needed to validate/unvalidate flac files before sending them
in our preservation system.</font><br><font size=2 face="sans-serif">.</font><br><font size=2 face="sans-serif">Everything is working fine between java
and libFLAC.so. Callback are called, C API is smart with void* client_data
parameter, which is useful to keep custom structure.</font><br><br><font size=2 face="sans-serif">My problem is : with JNA and libFLAC,
I can't identify if error callback has been called, due to variable visibility
restriction, because error_callback implementation in java cannot communicate
with java main code (not without an ugly trick).</font><br><font size=2 face="sans-serif">With native implementaiton of FLAC (decoder.c
or other samples), client_data sent to FLAC__stream_decoder_init_file is
updated by error_callback. But java keep initial reference of this parameter
and java main code never see this update after this step.</font><br><font size=2 face="sans-serif">Note : when error_callback is called,
I update client_data sent in parameter, well received updated by native
code stored in decoder variable.</font><br><br><font size=2 face="sans-serif">The only thing is missing to me, is
a function to return client_data from decoder.</font><br><br><font size=2 face="sans-serif"><u>This simple patch do the job for
me :</u></font><br><br><font size=2 face="sans-serif">StreamDecoder.h :</font><br><font size=2 face="sans-serif">FLAC_API void *get_client_data_from_decoder(FLAC__StreamDecoder
*decoder);</font><br><br><font size=2 face="sans-serif">StreamDecoder.c :</font><br><font size=2 face="sans-serif">void *get_client_data_from_decoder(FLAC__StreamDecoder
*decoder) {</font><br><font size=2 face="sans-serif"> return
decoder->private_->client_data;</font><br><font size=2 face="sans-serif">}</font><br><br><font size=2 face="sans-serif">I finally can use this function after
FLAC__stream_decoder_process_until_end_of_stream call to check client_data
and assert no error happened.</font><br><br><font size=2 face="sans-serif"><b>My question / suggestion :</b></font><br><font size=2 face="sans-serif">I would like to know if it could be
insteresting to you (and us) to add this client_data return function in
libFLAC ? Maybe some other developpers will have to use libFLAC with JNA,
and continue to update the lib without having to patch it.</font><br><br><br><font size=2 face="sans-serif">Thanks for your attention and for your
great work with flac development,</font><br><font size=2 face="sans-serif">Best regards,</font><br><br><font size=2 face="sans-serif">--</font><br><font size=2 face="sans-serif">Christophe Dumont</font><br><font size=2 face="sans-serif">Bibliothèque nationale de France</font><br><font size=2 face="sans-serif">DSI</font><font face="sans-serif"><hr />
<p>Exposition <strong><em><a href="http://www.bnf.fr/fr/evenements_et_culture/anx_expositions/f.paysages_francais.html">Paysages français – Une aventure photographique (1984 - 2017)</a></em></strong> - du 24 octobre 2017 au 4 février 2018 - BnF - François-Mitterrand</p>
<p style="color:#008000"><strong>Avant d'imprimer, pensez à l'environnement.</strong></p></font>