OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
151c584
)
x11grab: remove a memory allocation and the associated memcpy.
author
Sven C. Dack
<sven.c.dack@virginmedia.com>
Wed, 30 Mar 2011 15:02:29 +0000
(17:02 +0200)
committer
Anton Khirnov
<anton@khirnov.net>
Sun, 12 Jun 2011 10:18:05 +0000
(12:18 +0200)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavdevice/x11grab.c
patch
|
blob
|
history
diff --git
a/libavdevice/x11grab.c
b/libavdevice/x11grab.c
index
c6dc673
..
6e77a5c
100644
(file)
--- a/
libavdevice/x11grab.c
+++ b/
libavdevice/x11grab.c
@@
-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;
}