|
From: Alex C. <ac...@no...> - 2006-11-22 22:07:02
|
There's a bug in SWFDisplayList_writeBlocks() in displaylist.c which causes
objects after a non-embedded video stream to not be written out. The
problematic bit is
/* for each videostream in movie add VideoFrame */
if(character && ((SWFBlock)character)->type ==
SWF_DEFINEVIDEOSTREAM) {
SWFBlock video =
SWFVideoStream_getVideoFrame((SWFVideoStream)character);
if(!video)
break;
/* well it isn't really clear why we need the place-block here
* its not metioned in the flash-specs
* but its not working without */
if((item->flags & ITEM_NEW) == 0)
{
frame =
SWFVideoStream_getFrameNumber((SWFVideoFrame)video);
placeVideo = newSWFPlaceObject2Block(item->depth);
SWFPlaceObject2Block_setRatio(placeVideo, frame);
SWFPlaceObject2Block_setMove(placeVideo);
SWFBlockList_addBlock(blocklist, (SWFBlock)placeVideo);
}
SWFBlockList_addBlock(blocklist, video);
}
What happens if you're using NetStream instead of including the video
directly is that SWFVideoStream_getVideoFrame() returns NULL, and the
consequent break stops anything after the video canvas getting added.
An easy fix is simply not breaking on NULL.
if (NULL != video) // which it will be for streaming video
{
/* well it isn't really clear why we need the place-block
here
* its not metioned in the flash-specs
* but its not working without */
if((item->flags & ITEM_NEW) == 0)
{
frame =
SWFVideoStream_getFrameNumber((SWFVideoFrame)video);
placeVideo = newSWFPlaceObject2Block(item->depth);
SWFPlaceObject2Block_setRatio(placeVideo, frame);
SWFPlaceObject2Block_setMove(placeVideo);
SWFBlockList_addBlock(blocklist, (SWFBlock)placeVideo);
}
SWFBlockList_addBlock(blocklist, video);
}
I presume a proper fix would involve figuring out whether the video stream
is embedded or not to know if NULL is an expected return value, but it's not
clear to me how to do that.
|