]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvbsub.c
libopenh264: Log debug messages to a non-null context
[ffmpeg] / libavcodec / dvbsub.c
index ed128234e8da95226598d1ae2f7b8f562ed7c4c3..720e78669a6711adc59ebca3ae7032a1c4086cef 100644 (file)
@@ -1,21 +1,21 @@
 /*
- * DVB subtitle encoding for ffmpeg
+ * DVB subtitle encoding
  * Copyright (c) 2005 Fabrice Bellard
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "avcodec.h"
@@ -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);
@@ -403,11 +403,10 @@ static int dvbsub_encode(AVCodecContext *avctx,
 }
 
 AVCodec ff_dvbsub_encoder = {
-    "dvbsub",
-    AVMEDIA_TYPE_SUBTITLE,
-    CODEC_ID_DVB_SUBTITLE,
-    sizeof(DVBSubtitleContext),
-    NULL,
-    dvbsub_encode,
-    .long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"),
+    .name           = "dvbsub",
+    .long_name      = NULL_IF_CONFIG_SMALL("DVB subtitles"),
+    .type           = AVMEDIA_TYPE_SUBTITLE,
+    .id             = AV_CODEC_ID_DVB_SUBTITLE,
+    .priv_data_size = sizeof(DVBSubtitleContext),
+    .encode_sub     = dvbsub_encode,
 };