diff --git a/linphone/mediastreamer2/src/msvideo.c b/linphone/mediastreamer2/src/msvideo.c index e70387c35..6ccad863a 100644 --- a/linphone/mediastreamer2/src/msvideo.c +++ b/linphone/mediastreamer2/src/msvideo.c @@ -156,12 +156,12 @@ MSPixFmt ms_fourcc_to_pix_fmt(uint32_t fourcc){ void rgb24_revert(uint8_t *buf, int w, int h, int linesize){ uint8_t *p,*pe; int i,j; - uint8_t *end=buf+(h*linesize); + uint8_t *end=buf+((h-1)*linesize); uint8_t exch; p=buf; pe=end-1; for(i=0;ipix_fmt==MS_RGB24){ s->invert_rgb=(videoformat.bmiHeader.biHeight>0); }else s->invert_rgb=FALSE; + if (!capSetCallbackOnVideoStream(s->capvideo, VideoStreamCallback)) { ms_error("v4w: fail to set capture callback"); @@ -664,10 +665,10 @@ static void ms_v4w_detect(MSWebCamManager *obj){ DestroyWindow(hwnd); break; }else{ + capGetDriverDescription(i, dev, sizeof (dev),ver, sizeof (ver)); capDriverDisconnect(hwnd); DestroyWindow(hwnd); } - capGetDriverDescription(i, dev, sizeof (dev),ver, sizeof (ver)); snprintf(name, sizeof(name), "%s/%s",dev,ver); cam=ms_web_cam_new(&ms_v4w_cam_desc); cam->data=(void*)i;/*store the device index */