Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
JULIAN GARDNER authored on 2011/10/14 22:28:50... | ... |
@@ -209,6 +209,7 @@ typedef struct DVBSubRegion { |
209 | 209 |
|
210 | 210 |
uint8_t *pbuf; |
211 | 211 |
int buf_size; |
212 |
+ int dirty; |
|
212 | 213 |
|
213 | 214 |
DVBSubObjectDisplay *display_list; |
214 | 215 |
|
... | ... |
@@ -781,6 +782,7 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis |
781 | 781 |
return; |
782 | 782 |
|
783 | 783 |
pbuf = region->pbuf; |
784 |
+ region->dirty = 1; |
|
784 | 785 |
|
785 | 786 |
x_pos = display->x_pos; |
786 | 787 |
y_pos = display->y_pos; |
... | ... |
@@ -1044,6 +1046,7 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx, |
1044 | 1044 |
region->pbuf = av_malloc(region->buf_size); |
1045 | 1045 |
|
1046 | 1046 |
fill = 1; |
1047 |
+ region->dirty = 0; |
|
1047 | 1048 |
} |
1048 | 1049 |
|
1049 | 1050 |
region->depth = 1 << (((*buf++) >> 2) & 7); |
... | ... |
@@ -1356,6 +1359,10 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, |
1356 | 1356 |
if (!region) |
1357 | 1357 |
continue; |
1358 | 1358 |
|
1359 |
+ if (!region->dirty) |
|
1360 |
+ continue; |
|
1361 |
+ |
|
1362 |
+ rect = sub->rects[i]; |
|
1359 | 1363 |
rect->x = display->x_pos + offset_x; |
1360 | 1364 |
rect->y = display->y_pos + offset_y; |
1361 | 1365 |
rect->w = region->width; |