Wouldn't an exception be better than returning 0 (raised after closing the file of course) ?
[EMAIL PROTECTED] wrote: > Revision: 5558 > http://savonet.svn.sourceforge.net/savonet/?rev=5558&view=rev > Author: metamorph68 > Date: 2008-05-17 09:19:01 -0700 (Sat, 17 May 2008) > > Log Message: > ----------- > Close file descriptor after duration computation > fixes #141 > > Modified Paths: > -------------- > trunk/ocaml-mad/CHANGES > trunk/ocaml-mad/src/mad.ml > > Modified: trunk/ocaml-mad/CHANGES > =================================================================== > --- trunk/ocaml-mad/CHANGES 2008-05-17 15:48:08 UTC (rev 5557) > +++ trunk/ocaml-mad/CHANGES 2008-05-17 16:19:01 UTC (rev 5558) > @@ -1,3 +1,8 @@ > +0.3.4 () > +===== > +* Close file descriptor after duration computation > + Fixes #141 > + > 0.3.3 (16-04-2008) > ===== > * More portable make invokation > > Modified: trunk/ocaml-mad/src/mad.ml > =================================================================== > --- trunk/ocaml-mad/src/mad.ml 2008-05-17 15:48:08 UTC (rev 5557) > +++ trunk/ocaml-mad/src/mad.ml 2008-05-17 16:19:01 UTC (rev 5558) > @@ -122,9 +122,13 @@ > assert false > with _ -> !bytes > in > + let mf = openfile file in > + let ret = > try > - let mf = openfile file in > let samplefreq = samplefreq file in > (float (8 * bytes mf)) /. > (float (wav_output_channels*wav_output_sample_size*samplefreq)) > with _ -> 0. > + in > + close mf ; > + ret > > > This was sent by the SourceForge.net collaborative development platform, the > world's largest Open Source development site. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Savonet-cvs mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/savonet-cvs ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Savonet-devl mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/savonet-devl
