On Wed, Apr 15, 2009 at 11:55:48PM +0200, Michael Niedermayer wrote:
[....]
the first sample file i picked has 87 palette chunks and a duration of 7.8 seconds (at 12fps) are you sure that 3600*30 stsd chunks in mov will work?
Well it will work for sure.
how exactly would the libvaformat mov demuxer pass these palettes to the decoder?
Using the same way it does currently ?
You mean the one that causes race conditions and doesnt work with threaded players like ffplay ... The one why we try to change because it doesnt work ...
ffmpeg kinda works. Yes there is a race problem and there are some ways to fix it. I strongly believe we can reach an agreement here.
[...]
[...]
IIRC the race condition happens because demuxer sets palette to AVCodecContext _directly_.
Storing it in AVFormatContext should avoid this race, or is there something I'm forgetting ?
you forget that the palette from AVFormatContext must reach the decoder and what you do is that you would just remove the code that does that that fixes the race condition but it removes palette support pretty much
I don't forget, application will update AVCodecContext palette accordingly, of course. This does not remove palette support at all, and avoids changing decoders and fixes the race condition IMHO since now AVCodecContext does not get updated by the demuxer but the application.
Which application?
One you don't know about ? ;) This is still one solution. There are at least 3 solutions: - append palette to pkt->data - use pkt->palette_data - use AVFormatContext palette If the third is not ok for anybody then fine. I find the second reasonable and should satisfy everybody IMHO. Palette is passed through AVPacket and it avoids parsing in pkt->data, though it grows a bit AVPacket struct. It's not like we are afraid of growing structs usually ;) Besides, avcodec_decode_video2 now uses AVPacket. -- Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA checking for life_signs in -lkenny... no FFmpeg maintainer http://www.ffmpeg.org