diff options
Diffstat (limited to 'src/flac_decode.c')
-rw-r--r-- | src/flac_decode.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/flac_decode.c b/src/flac_decode.c index 559721c21..de59001f1 100644 --- a/src/flac_decode.c +++ b/src/flac_decode.c @@ -282,6 +282,15 @@ int flac_getAudioFormatAndTime(char * file, AudioFormat * format, float * time) return ret; } +int getFlacTotalTime(char * file) { + float totalTime; + AudioFormat af; + + if(flac_getAudioFormatAndTime(file,&af,&totalTime)<0) return -1; + + return (int)(totalTime+0.5); +} + int flac_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) { if(flac_getAudioFormatAndTime(dc->file,af,&(cb->totalTime))<0) { ERROR("\"%s\" doesn't seem to be a flac\n",dc->file); |