Browse Source

sndfile: only write bpm info if available

master
Alexandros Theodotou 3 months ago
parent
commit
46f5aa0431
Signed by: alex GPG Key ID: 022EAE42313D70F3
  1. 2
      src/ad_plugin.c
  2. 9
      src/ad_soundfile.c

2
src/ad_plugin.c

@ -145,7 +145,7 @@ audec_info (
AudecHandle * handle,
AudecInfo * nfo)
{
memset (nfo, 0, sizeof (AudecInfo));
audec_clear_nfo (nfo);
adecoder * decoder = (adecoder *) handle;
if (!decoder)
return -1;

9
src/ad_soundfile.c

@ -73,9 +73,12 @@ ad_info_sndfile (
nfo->meta_data = NULL;
SF_LOOP_INFO loop;
sf_command (
priv->sffile, SFC_GET_LOOP_INFO, &loop, sizeof (loop));
nfo->bpm = loop.bpm;
if (sf_command (
priv->sffile, SFC_GET_LOOP_INFO,
&loop, sizeof (loop)) == SF_TRUE)
{
nfo->bpm = loop.bpm;
}
}
return 0;
}

Loading…
Cancel
Save