Issues, advice needed...
Issues, advice needed...
- Subject: Issues, advice needed...
- From: Jean-Yves Avenard <email@hidden>
- Date: Mon, 13 Jun 2011 17:54:35 +1000
Hello
I've been pulling my hair for that one for a while...
Trying to have a media player (here free program MythTV) , to output
reliably digital audio (either DTS or AC3).
After finding and selecting my AudioStream that has a
kAudioFormat60958AC3 format. I then set the IOProc callback to my
rendering function.
So far so good. It works the first time I play an audio stream it
works perfectly. Subsequent calls however make the applications
behaving strangely.
(between the two attempts, the system has been reset. Closing the
application and restarting it make it works again)
Basically, after selecting the stream/format: outputFormat being the
AudioStreamBasicDescription matching my requirements in the stream.
outputFormat.mBytesPerPacket is 6144 bytes.
The first time round, the IOProc is indeed called requesting 6144
bytes (value found in outOutputData.mDataByteSize)...
The 2nd time round however (that is, after the audio unit has been
closed, then re-opened).
While the stream is identical to the first attempt, the IOProc is now
called for 12288 bytes (exactly twice as before), but it is called at
the same frequency as earlier.
Obviously, the audio buffer are being starved very quickly, and soon
enough my A/V Sync is broken.
What I don't understand is why if the stream has a mBytesPerPacket of
6144 bytes , with mFramesPerPacket being 1536 (which by the way is
exactly the size of an AC3 frame).
yet, the IOProc is called for twice the amount of data...
If I set outOutputData->mBuffers[index].mDataByteSize = 6144; in the
IOProc, then audio plays fine even though 12288 bytes were requested.
Sorry if I'm not always using the most descriptive terms
Is there an obvious thing I should look into ?
Is the amount requested with the IOProc supposed to match
mDataByteSize defined in the Stream / Format ? If it doesn't match,
why is it?
Hoping that I've missed something very obvious.
Best regards
Jean-Yves
_______________________________________________
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