]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvbsub.c
libopenh264: Log debug messages to a non-null context
[ffmpeg] / libavcodec / dvbsub.c
index 49bad217d9a5b539f4a2f54c7fd1678a2fad238b..720e78669a6711adc59ebca3ae7032a1c4086cef 100644 (file)
@@ -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 */
@@ -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,
 };