~ubuntu-branches/ubuntu/trusty/gst-libav1.0/trusty-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/dvdsubdec.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-09-24 17:07:00 UTC
  • mfrom: (1.1.17) (7.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20130924170700-4dg62s3pwl0pdakz
Tags: 1.2.0-1
* New upstream stable release:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
                          uint8_t *alpha,
121
121
                          uint32_t subtitle_color)
122
122
{
123
 
    uint8_t color_used[16];
 
123
    uint8_t color_used[16] = { 0 };
124
124
    int nb_opaque_colors, i, level, j, r, g, b;
125
125
 
126
126
    for(i = 0; i < 4; i++)
127
127
        rgba_palette[i] = 0;
128
128
 
129
 
    memset(color_used, 0, 16);
130
129
    nb_opaque_colors = 0;
131
130
    for(i = 0; i < 4; i++) {
132
131
        if (alpha[i] != 0 && !color_used[colormap[i]]) {
371
370
/* return 0 if empty rectangle, 1 if non empty */
372
371
static int find_smallest_bounding_rectangle(AVSubtitle *s)
373
372
{
374
 
    uint8_t transp_color[256];
 
373
    uint8_t transp_color[256] = { 0 };
375
374
    int y1, y2, x1, x2, y, w, h, i;
376
375
    uint8_t *bitmap;
377
376
 
378
377
    if (s->num_rects == 0 || s->rects == NULL || s->rects[0]->w <= 0 || s->rects[0]->h <= 0)
379
378
        return 0;
380
379
 
381
 
    memset(transp_color, 0, 256);
382
380
    for(i = 0; i < s->rects[0]->nb_colors; i++) {
383
381
        if ((((uint32_t*)s->rects[0]->pict.data[1])[i] >> 24) == 0)
384
382
            transp_color[i] = 1;
489
487
AVCodec ff_dvdsub_decoder = {
490
488
    .name           = "dvdsub",
491
489
    .type           = AVMEDIA_TYPE_SUBTITLE,
492
 
    .id             = CODEC_ID_DVD_SUBTITLE,
 
490
    .id             = AV_CODEC_ID_DVD_SUBTITLE,
493
491
    .decode         = dvdsub_decode,
494
 
    .long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"),
 
492
    .long_name      = NULL_IF_CONFIG_SMALL("DVD subtitles"),
495
493
};