Revision 39530272

View differences:

libavdevice/x11grab.c
386 386
        nanosleep(&ts, NULL);
387 387
    }
388 388

  
389
    if (av_new_packet(pkt, s->frame_size) < 0) {
390
        return AVERROR(EIO);
391
    }
392

  
389
    av_init_packet(pkt);
390
    pkt->data = image->data;
391
    pkt->size = s->frame_size;
393 392
    pkt->pts = curtime;
394 393

  
395 394
    if(s->use_shm) {
......
406 405
        paint_mouse_pointer(image, s);
407 406
    }
408 407

  
409

  
410
    /* XXX: avoid memcpy */
411
    memcpy(pkt->data, image->data, s->frame_size);
412 408
    return s->frame_size;
413 409
}
414 410

  

Also available in: Unified diff