[FFmpeg-devel] [PATCH 6/6] decklink: Add support for SCTE-104 to decklink capture

Derek Buitenhuis derek.buitenhuis at gmail.com
Fri Nov 17 02:35:45 EET 2017


On 11/16/2017 6:34 PM, Devin Heitmueller wrote:
> ---
>  libavcodec/avcodec.h            |  1 +
>  libavcodec/codec_desc.c         |  6 ++++
>  libavdevice/decklink_common.h   |  6 ++++
>  libavdevice/decklink_common_c.h |  1 +
>  libavdevice/decklink_dec.cpp    | 64 ++++++++++++++++++++++++++++++++++++++++-
>  libavdevice/decklink_dec_c.c    |  1 +
>  6 files changed, 78 insertions(+), 1 deletion(-)

Needs a version bump.

> +static int setup_data(AVFormatContext *avctx)
> +{
> +    struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
> +    struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx;
> +    AVStream *st;
> +    int ret = 0;
> +
> +    if (cctx->enable_scte_104) {
> +        st = avformat_new_stream(avctx, NULL);
> +        if (!st) {
> +            av_log(avctx, AV_LOG_ERROR, "Cannot add data stream\n");
> +            ret = AVERROR(ENOMEM);
> +            goto error;
> +        }

This is the only error path in the function, so the goto is superfluous.

- Derek


More information about the ffmpeg-devel mailing list