Re: [coreAudio] Detecting corrupted files
Re: [coreAudio] Detecting corrupted files
- Subject: Re: [coreAudio] Detecting corrupted files
- From: Brian Whitman <email@hidden>
- Date: Tue, 7 Mar 2006 20:45:01 -0500
I just want to mention that I had the exact same problem back in
December and brought it up here:
http://lists.apple.com/archives/Coreaudio-api/2005/Dec/msg00148.html
I did file a bug under 4379707. The thread and bug report includes an
example .mp3
We're hoping to 'ship' an app using CAAudioFile but we haven't found
a solution yet.
On Mar 7, 2006, at 8:34 PM, William Stewart wrote:
On 07/03/2006, at 4:27 PM, Alexander v. Below wrote:
Thanks a lot for your quick replies!
Firstly, can you please file a bug report (http://
bugreporter.apple.com) with the MP3 file that is giving you
problems so we can look at this.
Absolutely, I have done so and the rdar number is 4470243.
- if you are opening an MP3 file, then you should first ask it
for the number of packets in the file. This will cause the parser
to parse the contents of the file (so it can take some time), but
it also does workaround the problem of this code hanging when
doing some operations with MP3 files. I don't know if your hang
is caused by this bug, but it is certainly worth investigating.
Unfortunately, we are trying to convert a fair large amount of
files. If I understand you correctly, asking each file for the
number of packets would add a time-penalty to each conversion,
Yes - but this would only be necessary for MP3.
and that is something I would like to avoid. The number of files
that will be converted can easily be thousands, so unless "some
time" is very, very small it may be a noticeable performance hit.
No, it would be a noticeable perf hit as the whole file is scanned
in some detail.
If anybody knows of a fast way to determine if it is a legal file,
I would be more than happy to hear about this.
We'll take a look at the file and see if we can offer any suggestions.
Thanks
Bill
Alex
On 07/03/2006, at 12:14 PM, Alexander v. Below wrote:
In my converter, I have discovered that the CoreAudio hangs in
err = AudioFileGetProperty(inAudioFile,
kAudioFilePropertyMaximumPacketSize,
&propertySize, &fileMaxPacketSize);
Almost forever, returning only after a serious, serious amount
of time. I then tried to open the file (mp3) in QuickTime,
which reports an error -2048.
So, fair enough, let us assume that file is junk. But how would
I tell? I can successfully call:
err = AudioFileOpen(&ref, fsRdPerm, 0, &inAudioFile);
and
err = AudioFileGetProperty(inAudioFile,
kAudioFilePropertyDataFormat, &propertySize, &srcFmt);
on it, each time getting "no error". The returned source format is:
mSampleRate 12000
mFormatID '.mp3'
mFormatFlags 0
mBytesPerPacket 0
mFramesPerPacket 576
mBytesPerFrame 0
mChannelsPerFrame 2
mBitsPerChannel 0
Should this be giving me a hint, i.e. mBytesPerPacket == 0 and
mBytesPerFrame == 0, that this file is potentially junk and I
should discontinue to work with it?
Could someone briefly add up which parameters have to be set to
make something a valid file?
For the experts, this is the stack trace where the call hangs:
#0 0x9004a86c in pread ()
#1 0x90b45bcc in BasicRead ()
#2 0x90b45904 in PBReadForkSync ()
#3 0x90b45864 in FSReadFork ()
#4 0x94101fec in MacFile_DataSource::ReadBytes ()
#5 0x941026f8 in Cached_DataSource::ReadBytes ()
#6 0x9415cfc8 in MP3AudioFile::UpdatePacketTable ()
#7 0x94103ce8 in MP3AudioFile::GetProperty ()
#8 0x940f1564 in AudioFileGetProperty ()
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
--
mailto:email@hidden
tel: +1 408 974 4056
____________________________________________________________________
______
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry
Pratchett
____________________________________________________________________
______
--
mailto:email@hidden
tel: +1 408 974 4056
______________________________________________________________________
____
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
______________________________________________________________________
____
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40media.mit.edu
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden