diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2024-03-23 09:43:30 +0100 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-04-17 23:41:30 +0200 |
commit | 73779a8c706cf5458260f44a9b5c5398a8683fb6 (patch) | |
tree | f0e325f072422425d2220086293f917b3cf6fc44 | |
parent | 1586ccc0c86ab23aad9e3f4b2b5986574ce266a7 (diff) | |
download | mpv-73779a8c706cf5458260f44a9b5c5398a8683fb6.tar.bz2 mpv-73779a8c706cf5458260f44a9b5c5398a8683fb6.tar.xz |
sub/lavc_conv: take sd context as a parameter for lavc_conv_create
Will be useful for future commits.
-rw-r--r-- | sub/lavc_conv.c | 9 | ||||
-rw-r--r-- | sub/sd.h | 3 | ||||
-rw-r--r-- | sub/sd_ass.c | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/sub/lavc_conv.c b/sub/lavc_conv.c index 532e91d508..9513dbf0bb 100644 --- a/sub/lavc_conv.c +++ b/sub/lavc_conv.c @@ -66,13 +66,12 @@ static void disable_styles(bstr header) } } -struct lavc_conv *lavc_conv_create(struct mp_log *log, - const struct mp_codec_params *mp_codec) +struct lavc_conv *lavc_conv_create(struct sd *sd) { struct lavc_conv *priv = talloc_zero(NULL, struct lavc_conv); - priv->log = log; + priv->log = sd->log; priv->cur_list = talloc_array(priv, char*, 0); - priv->codec = talloc_strdup(priv, mp_codec->codec); + priv->codec = talloc_strdup(priv, sd->codec->codec); AVCodecContext *avctx = NULL; AVDictionary *opts = NULL; const char *fmt = get_lavc_format(priv->codec); @@ -82,7 +81,7 @@ struct lavc_conv *lavc_conv_create(struct mp_log *log, avctx = avcodec_alloc_context3(codec); if (!avctx) goto error; - if (mp_set_avctx_codec_headers(avctx, mp_codec) < 0) + if (mp_set_avctx_codec_headers(avctx, sd->codec) < 0) goto error; priv->avpkt = av_packet_alloc(); @@ -51,8 +51,7 @@ struct sd_functions { // lavc_conv.c struct lavc_conv; -struct lavc_conv *lavc_conv_create(struct mp_log *log, - const struct mp_codec_params *mp_codec); +struct lavc_conv *lavc_conv_create(struct sd *sd); char *lavc_conv_get_extradata(struct lavc_conv *priv); char **lavc_conv_decode(struct lavc_conv *priv, struct demux_packet *packet, double *sub_pts, double *sub_duration); diff --git a/sub/sd_ass.c b/sub/sd_ass.c index 6fa4d1bb52..e10e7eea05 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -271,7 +271,7 @@ static int init(struct sd *sd) strcmp(sd->codec->codec, "null") != 0) { ctx->is_converted = true; - ctx->converter = lavc_conv_create(sd->log, sd->codec); + ctx->converter = lavc_conv_create(sd); if (!ctx->converter) return -1; |