]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvbsub.c
lavc: revert the Makefile part of 330177b
[ffmpeg] / libavcodec / dvbsub.c
index 713f91ed0cb9d3461ac754491bbeecb4002e5f89..548bae1ca0b9fbb216bc59628e2f21189241fad5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * DVB subtitle encoding for ffmpeg
+ * DVB subtitle encoding
  * Copyright (c) 2005 Fabrice Bellard
  *
  * This file is part of Libav.
@@ -195,7 +195,7 @@ static void dvb_encode_rle4(uint8_t **pq,
 }
 
 static int encode_dvb_subtitles(DVBSubtitleContext *s,
-                                uint8_t *outbuf, AVSubtitle *h)
+                                uint8_t *outbuf, const AVSubtitle *h)
 {
     uint8_t *q, *pseg_len;
     int page_id, region_id, clut_id, object_id, i, bpp_index, page_state;
@@ -205,7 +205,7 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
 
     page_id = 1;
 
-    if (h->num_rects == 0 || h->rects == NULL)
+    if (h->num_rects == 0 || !h->rects)
         return -1;
 
     *q++ = 0x00; /* subtitle_stream_id */
@@ -262,7 +262,7 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
                 *q++ = (1 << (7 - bpp_index)) | (0xf << 1) | 1; /* 2 bits/pixel full range */
                 {
                     int a, r, g, b;
-                    uint32_t x= ((uint32_t*)h->rects[clut_id]->pict.data[1])[i];
+                    uint32_t x= ((uint32_t*)h->rects[clut_id]->data[1])[i];
                     a = (x >> 24) & 0xff;
                     r = (x >> 16) & 0xff;
                     g = (x >>  8) & 0xff;
@@ -359,10 +359,10 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
                     dvb_encode_rle = dvb_encode_rle4;
 
                 top_ptr = q;
-                dvb_encode_rle(&q, h->rects[object_id]->pict.data[0], h->rects[object_id]->w * 2,
+                dvb_encode_rle(&q, h->rects[object_id]->data[0], h->rects[object_id]->w * 2,
                                     h->rects[object_id]->w, h->rects[object_id]->h >> 1);
                 bottom_ptr = q;
-                dvb_encode_rle(&q, h->rects[object_id]->pict.data[0] + h->rects[object_id]->w,
+                dvb_encode_rle(&q, h->rects[object_id]->data[0] + h->rects[object_id]->w,
                                     h->rects[object_id]->w * 2, h->rects[object_id]->w,
                                     h->rects[object_id]->h >> 1);
 
@@ -392,10 +392,10 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
 }
 
 static int dvbsub_encode(AVCodecContext *avctx,
-                       unsigned char *buf, int buf_size, void *data)
+                         unsigned char *buf, int buf_size,
+                         const AVSubtitle *sub)
 {
     DVBSubtitleContext *s = avctx->priv_data;
-    AVSubtitle *sub = data;
     int ret;
 
     ret = encode_dvb_subtitles(s, buf, sub);
@@ -404,9 +404,9 @@ static int dvbsub_encode(AVCodecContext *avctx,
 
 AVCodec ff_dvbsub_encoder = {
     .name           = "dvbsub",
+    .long_name      = NULL_IF_CONFIG_SMALL("DVB subtitles"),
     .type           = AVMEDIA_TYPE_SUBTITLE,
-    .id             = CODEC_ID_DVB_SUBTITLE,
+    .id             = AV_CODEC_ID_DVB_SUBTITLE,
     .priv_data_size = sizeof(DVBSubtitleContext),
-    .encode         = dvbsub_encode,
-    .long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"),
+    .encode_sub     = dvbsub_encode,
 };