Ticket #8965: pgssubdec.2.patch

File pgssubdec.2.patch, 1.6 KB (added by anonymous, 9 years ago)
  • external/FFmpeg/libavcodec/pgssubdec.c

     
    4646    int x;
    4747    int y;
    4848    int id_number;
     49    int blank;
    4950} PGSSubPresentation;
    5051
    5152typedef struct PGSSubPicture {
     
    255256 * @param buf_size size of packet to process
    256257 * @todo TODO: Implement cropping
    257258 * @todo TODO: Implement forcing of subtitles
    258  * @todo TODO: Blanking of subtitle
    259259 */
    260260static void parse_presentation_segment(AVCodecContext *avctx,
    261261                                       const uint8_t *buf, int buf_size)
     
    280280
    281281    /* Next byte is the state. */
    282282    block = bytestream_get_byte(&buf);;
    283     if (block == 0x80) {
     283    if (block == 0x80 || block == 0x40) {
    284284        /*
    285285         * Skip 7 bytes of unknown:
    286286         *     palette_update_flag (0x80),
     
    308308        /* Fill in dimensions */
    309309        ctx->presentation.x = x;
    310310        ctx->presentation.y = y;
    311     } else if (block == 0x00) {
    312         /* TODO: Blank context as subtitle should not be displayed.
    313          *       If the subtitle is blanked now the subtitle is not
    314          *       on screen long enough to read, due to a delay in
    315          *       initial display timing.
    316          */
    317311    }
     312    ctx->presentation.blank = block == 0x00;
    318313}
    319314
    320315/**
     
    345340     */
    346341
    347342    memset(sub, 0, sizeof(*sub));
     343    if (ctx->presentation.blank) {
     344        return 1;
     345    }
    348346    sub->start_display_time = 0;
    349347    sub->end_display_time   = 20000;
    350348    sub->format             = 0;