changeset 32324:faf951bbfdfe

spudec: support "clear" packets that contain no data but instead clear the screen at a given time.
author reimar
date Wed, 29 Sep 2010 19:05:13 +0000
parents afb76e48fc32
children 0ba9d1a85eb4
files spudec.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/spudec.c	Wed Sep 29 18:53:39 2010 +0000
+++ b/spudec.c	Wed Sep 29 19:05:13 2010 +0000
@@ -1367,6 +1367,7 @@
   packet->start_col = x;
   packet->start_row = y;
   packet->data_len = 2 * stride * h;
+  if (packet->data_len) { // size 0 is a special "clear" packet
   packet->packet = malloc(packet->data_len);
   img  = packet->packet;
   aimg = packet->packet + stride * h;
@@ -1381,6 +1382,7 @@
   }
   pal2gray_alpha(g8a8_pal, pal_img, pal_stride,
                  img, aimg, stride, w, h);
+  }
   packet->start_pts = 0;
   packet->end_pts = 0x7fffffff;
   if (pts != MP_NOPTS_VALUE)