From ec234e985563316d725c7a8b8873f2c34e4d4635 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Wed, 10 Mar 2004 02:38:31 +0000 Subject: move time from tag info to song info. also, if we can't get the time, then don't add the song to the db! git-svn-id: https://svn.musicpd.org/mpd/trunk@236 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/flac_decode.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/flac_decode.c') 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); -- cgit v1.2.3