Changeset 1009

Show
Ignore:
Timestamp:
01/05/09 11:17:06 (1 year ago)
Author:
gbooker
Message:

Corrected VobSub? codec to use new data structure in ffmpeg

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/VobSubCodec.c

    r1001 r1009  
    118118                if (glob->subtitle.rects) { 
    119119                        for (i = 0; i < glob->subtitle.num_rects; i++) { 
    120                                 av_free(glob->subtitle.rects[i].rgba_palette); 
    121                                 av_free(glob->subtitle.rects[i].bitmap); 
     120                                av_freep(glob->subtitle.rects[i]->pict.data[0]); 
     121                                av_freep(glob->subtitle.rects[i]->pict.data[1]); 
     122                                av_freep(glob->subtitle.rects[i]); 
    122123                        } 
    123124                        av_free(glob->subtitle.rects); 
     
    348349         
    349350        for (i = 0; i < glob->subtitle.num_rects; i++) { 
    350                 AVSubtitleRect *rect = &glob->subtitle.rects[i]; 
     351                AVSubtitleRect *rect = glob->subtitle.rects[i]; 
    351352                uint8_t *line = (uint8_t *)drp->baseAddr + drp->rowBytes * rect->y + rect->x*4; 
    352                 uint8_t *sub = rect->bitmap
     353                uint8_t *sub = rect->pict.data[0]
    353354                unsigned int w = FFMIN(rect->w, myDrp->width  - rect->x); 
    354355                unsigned int h = FFMIN(rect->h, myDrp->height - rect->y); 
     356                uint32_t *palette = (uint32_t *)rect->pict.data[1]; 
    355357                 
    356358                if (usePalette) { 
    357359                        for (j = 0; j < 4; j++) 
    358                                 rect->rgba_palette[j] = controlData.pixelColor[j]; 
     360                                palette[j] = controlData.pixelColor[j]; 
    359361                } 
    360362                 
     
    363365                         
    364366                        for (x = 0; x < w; x++) 
    365                                 pixel[x] = rect->rgba_palette[sub[x]]; 
     367                                pixel[x] = palette[sub[x]]; 
    366368                         
    367369                        line += drp->rowBytes; 
    368                         sub += rect->linesize
     370                        sub += rect->pict.linesize[0]
    369371                } 
    370372        }