forked from FFmpeg/FFmpeg
x11grab: remove a memory allocation and the associated memcpy.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
151c584188
commit
2f2c60400a
1 changed files with 3 additions and 7 deletions
|
@ -410,10 +410,9 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
|
|||
nanosleep(&ts, NULL);
|
||||
}
|
||||
|
||||
if (av_new_packet(pkt, s->frame_size) < 0) {
|
||||
return AVERROR(EIO);
|
||||
}
|
||||
|
||||
av_init_packet(pkt);
|
||||
pkt->data = image->data;
|
||||
pkt->size = s->frame_size;
|
||||
pkt->pts = curtime;
|
||||
|
||||
if(s->use_shm) {
|
||||
|
@ -430,9 +429,6 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
|
|||
paint_mouse_pointer(image, s);
|
||||
}
|
||||
|
||||
|
||||
/* XXX: avoid memcpy */
|
||||
memcpy(pkt->data, image->data, s->frame_size);
|
||||
return s->frame_size;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue