summaryrefslogtreecommitdiff
path: root/libavdevice/x11grab.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavdevice/x11grab.c')
-rw-r--r--libavdevice/x11grab.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index aaad7292c6..6a674ee6f9 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -1,9 +1,9 @@
/*
* X11 video grab interface
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav integration:
+ * FFmpeg integration:
* Copyright (C) 2006 Clemens Fruhwirth <clemens@endorphin.org>
* Edouard Gomez <ed.gomez@free.fr>
*
@@ -14,18 +14,18 @@
* Copyright (C) 1997-1998 Rasca, Berlin
* 2003-2004 Karl H. Beckers, Frankfurt
*
- * Libav is free software; you can redistribute it and/or modify
+ * FFmpeg is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Libav; if not, write to the Free Software
+ * along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -386,10 +386,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) {
@@ -406,9 +405,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;
}