On 04/16/2017 10:58 AM, fredvs wrote:
K, the function seems to work because the result = 0 (no error).
But how to retrieve the data icy_meta (PPChar) ?
var
theicytag : PPChar;
resu : integer;
...
resu := mpg123_icy(ahandle, theicytag);
if resu = 0 then writeln(theicytag^); --> raise exception + crash
resu := mpg123_icy(ahandle, theicytag);
if resu = 0 then writeln(theicytag^^); --> also raise exception + crash
You haven't checked if theicytag is nil. The call to mpg123_icy may
succeed but still the tag may be nil.
resu := mpg123_icy(ahandle, theicytag);
if (resu = 0) and Assigned(theicytag) and Assigned(theicytag^)
then writeln(theicytag^);
Regards,
Andrew
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal