ofxStreamer
ofxStreamer copied to clipboard
Sender example compiles but crashes
Erratic. I managed to make it work just a few times. I can't see any consistent reason why. When it works it sends correctly the stream to the Receiver.
It consistently fails at streamerSenderExampleDebug`swscale at swscale.c:304: 0x537585: movl %esi, %eax
It crashes at the first frame, but sometimes a few frames later, even a few seconds later.
see similar crashes here on swscale:

glancing over the code i think it's possible that QTKitGrabber could return the wrong size until the first frame arrives, maybe something like this could do the trick:
grabber.initGrabber(...); grabber.update(); // fetch a frame sender.setup(grabber.getWidth(), grabber.getHeight(),...); // now set up the sender
fun fact: if you take the crash address minus the start address of _data, you get exactly 640_480*3.
that's a fun fact :) I tried that but it seems to be ok. I suspect it maybe has to do with pixel alignment ? http://stackoverflow.com/questions/34450151/ffmpeg-bmp-to-yuv-crash-at-sws-scale I don't know enough here, but poking around...
Uh... this issues gives me flashbacks of nightmares from when i created this addon... ffmpeg.......
Same issue around here. Would anyone have a light on how to solve this?
This issue still persists.
using height-1
in the crashing line seems to be working more or less.
sws_scale(imgctx, (const uint8_t* const*) &data, &stride, 0, height-1, frame->data, frame->linesize);