Reply To: iTunes internals

#14972
rpedde
Participant

@turbo wrote:

So if I understand you correct about the mdat atom, this file should be streamable… Correct?

No. The mdat atom is the one called “mdat” — the third one in, after a small amount of unused space, and a header. That has to be *after* all the other atoms. If it isn’t it won’t stream. It will play on a local fs, but it won’t stream. Not from iTunes, not from mt-daapd. Not from anything.

Specifically, things like sample rate and that sort of thing come from moov:trak:mdia:minf:stbl:stsd:mp4a (and mp4v). If it can’t pull sample rates and codectypes from that *before* it sees the mdat, then it can’t stream it.

different codec type? How do you mean?

I’ve faked the codec type in the DB so that the AVI looks like an MP4 – update songs set codectype=’mp4v’,type=’m4v’ where path like ‘%.avi’ and patch FireFly to send the codectype as Content-Type. Also tried codectype=’mp4a’,type=’m4a’ which would lead to Content-Type: audio/m4a (which is the same Content-Type as streaming the Filename_mp4-mp4 (SpecOpts).mp4 file) to no avail.

That’s exactly what I mean. If you tell iTunes it’s a mp4 file and then give it an avi file to decode, it will barf. No less than if you try and play a flac file with an mp3 decoder. It won’t work.