]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/xsubenc.c
libopenh264: Log debug messages to a non-null context
[ffmpeg] / libavcodec / xsubenc.c
index bd66f86501a7fb31ed02e1d695c37ed29b5754bd..fc46fb8651ede5642fc3ea516fcc554854bc4b55 100644 (file)
@@ -111,9 +111,8 @@ static int make_tc(uint64_t ms, int *tc)
 }
 
 static int xsub_encode(AVCodecContext *avctx, unsigned char *buf,
-                       int bufsize, void *data)
+                       int bufsize, const AVSubtitle *h)
 {
-    AVSubtitle *h = data;
     uint64_t startTime = h->pts / 1000; // FIXME: need better solution...
     uint64_t endTime = startTime + h->end_display_time - h->start_display_time;
     int start_tc[4], end_tc[4];
@@ -211,10 +210,10 @@ static av_cold int xsub_encoder_init(AVCodecContext *avctx)
 }
 
 AVCodec ff_xsub_encoder = {
-    .name      = "xsub",
-    .type      = AVMEDIA_TYPE_SUBTITLE,
-    .id        = CODEC_ID_XSUB,
-    .init      = xsub_encoder_init,
-    .encode    = xsub_encode,
-    .long_name = NULL_IF_CONFIG_SMALL("DivX subtitles (XSUB)"),
+    .name       = "xsub",
+    .long_name  = NULL_IF_CONFIG_SMALL("DivX subtitles (XSUB)"),
+    .type       = AVMEDIA_TYPE_SUBTITLE,
+    .id         = AV_CODEC_ID_XSUB,
+    .init       = xsub_encoder_init,
+    .encode_sub = xsub_encode,
 };