tags 338813 + patch thanks bts control programm mp32ogg does very little error checking, indeed, and assumes that any file *.mp? (where ? is any digit) is an mp3 file and converts it unconditiconally. The attached patch adds very basic error checking. I tried it on all my mp4-files (which are not so many) and it seems to work. An improved version should be written (later) with an eye on the mp3 spec to determine, which fields need to have which values for mp32ogg to work (i.e., on my mp4-files all of Version, Layer, Bitrate, Secs and Mode where empty, and this (is Version empty) is what the patch checks. But are there valid mp3 files which have, e.g., an empty Version but a non empty Layer? Is any Version / any Layer allowed? These checks are trivial, but I do not have mp3 docs laying around to tell me).
Also I strongly suggest to refuse overwriting existing files, i.e., to check if the output file exists and either die in this case or determine an unused filename (e.g., .ogg.1). The former is easier and if you'd like I can write a patch. I'd also add a --force option, which would skip the check in case the user wants to overwrite existing files. But as a minimum you should add an warning in the man page, that existing files are unconditionally overwritten! Also I could provide you with a german man page. Greetings Helge --- mp32ogg.orig 2005-08-07 19:24:59.000000000 +0200 +++ mp32ogg 2005-11-13 09:16:26.000000000 +0100 @@ -165,6 +165,8 @@ $info = get_mp3tag($mp3file); $fileinfo = get_mp3info($mp3file); + # Sanity checking: Is this file really an MP3 file? + die "Could not determine MP3 version, aborting" if ($fileinfo->{VERSION}==""); # get_mp3info returns magical Perl UTF-8 strings, but this script # really wants to deal with plain old sequences-of-octets, so encode -- Dr. Helge Kreutzmann, Dipl.-Phys. [EMAIL PROTECTED] gpg signed mail preferred 64bit GNU powered http://www.itp.uni-hannover.de/~kreutzm Help keep free software "libre": http://www.ffii.de/
pgpWES9GMt2Hg.pgp
Description: PGP signature