mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-19 13:30:03 +01:00
dvbsubdec: dirty handkling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
eea064aea6
commit
b522d2a3b7
@@ -209,6 +209,7 @@ typedef struct DVBSubRegion {
|
|||||||
|
|
||||||
uint8_t *pbuf;
|
uint8_t *pbuf;
|
||||||
int buf_size;
|
int buf_size;
|
||||||
|
int dirty;
|
||||||
|
|
||||||
DVBSubObjectDisplay *display_list;
|
DVBSubObjectDisplay *display_list;
|
||||||
|
|
||||||
@@ -781,6 +782,7 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
pbuf = region->pbuf;
|
pbuf = region->pbuf;
|
||||||
|
region->dirty = 1;
|
||||||
|
|
||||||
x_pos = display->x_pos;
|
x_pos = display->x_pos;
|
||||||
y_pos = display->y_pos;
|
y_pos = display->y_pos;
|
||||||
@@ -1044,6 +1046,7 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
|
|||||||
region->pbuf = av_malloc(region->buf_size);
|
region->pbuf = av_malloc(region->buf_size);
|
||||||
|
|
||||||
fill = 1;
|
fill = 1;
|
||||||
|
region->dirty = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
region->depth = 1 << (((*buf++) >> 2) & 7);
|
region->depth = 1 << (((*buf++) >> 2) & 7);
|
||||||
@@ -1356,6 +1359,10 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
|
|||||||
if (!region)
|
if (!region)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (!region->dirty)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
rect = sub->rects[i];
|
||||||
rect->x = display->x_pos + offset_x;
|
rect->x = display->x_pos + offset_x;
|
||||||
rect->y = display->y_pos + offset_y;
|
rect->y = display->y_pos + offset_y;
|
||||||
rect->w = region->width;
|
rect->w = region->width;
|
||||||
|
|||||||
Reference in New Issue
Block a user