Commit 39530272 authored by Sven C. Dack's avatar Sven C. Dack Committed by Carl Eugen Hoyos

Remove a memory allocation and the associated memcpy.

parent 007b1f04
...@@ -386,10 +386,9 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt) ...@@ -386,10 +386,9 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
nanosleep(&ts, NULL); nanosleep(&ts, NULL);
} }
if (av_new_packet(pkt, s->frame_size) < 0) { av_init_packet(pkt);
return AVERROR(EIO); pkt->data = image->data;
} pkt->size = s->frame_size;
pkt->pts = curtime; pkt->pts = curtime;
if(s->use_shm) { if(s->use_shm) {
...@@ -406,9 +405,6 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt) ...@@ -406,9 +405,6 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
paint_mouse_pointer(image, s); paint_mouse_pointer(image, s);
} }
/* XXX: avoid memcpy */
memcpy(pkt->data, image->data, s->frame_size);
return s->frame_size; return s->frame_size;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment