diff options
| author | 2025-02-22 10:29:15 -0500 | |
|---|---|---|
| committer | 2025-02-22 10:29:15 -0500 | |
| commit | 000ce1f671d1f05b76202fd128e272e4ac9da683 (patch) | |
| tree | 315812307bd8c5b7ab0efedfd29a43e52c270989 /src/codec | |
| parent | c7f00bb4a70e94a5b0ded8255e34e094e884f7a0 (diff) | |
| download | camu-000ce1f671d1f05b76202fd128e272e4ac9da683.tar.gz camu-000ce1f671d1f05b76202fd128e272e4ac9da683.tar.bz2 camu-000ce1f671d1f05b76202fd128e272e4ac9da683.zip | |
Support new stl_global_init()
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/codec')
| -rw-r--r-- | src/codec/ffmpeg/decoder.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/codec/ffmpeg/decoder.c b/src/codec/ffmpeg/decoder.c index affe9fa..47b5b01 100644 --- a/src/codec/ffmpeg/decoder.c +++ b/src/codec/ffmpeg/decoder.c @@ -141,7 +141,6 @@ static bool get_hwdevice_config(struct camu_ff_decoder *av, const AVCodec *codec static bool collect_supported_hwaccels(struct camu_ff_decoder *av) { - al_array_init(av->supported_hw_codecs); const AVCodec *codec; void *iter = NULL; while ((codec = av_codec_iterate(&iter))) { @@ -151,7 +150,6 @@ static bool collect_supported_hwaccels(struct camu_ff_decoder *av) } } - al_array_init(av->supported_hw_devices); enum AVHWDeviceType hw_device_type = AV_HWDEVICE_TYPE_NONE; while ((hw_device_type = av_hwdevice_iterate_types(hw_device_type)) != AV_HWDEVICE_TYPE_NONE) { al_array_push(av->supported_hw_devices, hw_device_type); @@ -166,6 +164,10 @@ static bool collect_supported_hwaccels(struct camu_ff_decoder *av) static void close_internal(struct camu_ff_decoder *av) { if (av->codec_context) avcodec_free_context(&av->codec_context); +#ifdef CAMU_FF_DECODER_HWACCEL + al_array_free(av->supported_hw_codecs); + al_array_free(av->supported_hw_devices); +#endif } static bool ff_decoder_init(struct camu_decoder *dec, struct camu_renderer *renderer, struct camu_codec_stream *stream, @@ -174,6 +176,10 @@ static bool ff_decoder_init(struct camu_decoder *dec, struct camu_renderer *rend struct camu_ff_decoder *av = (struct camu_ff_decoder *)dec; av->codec_context = NULL; +#ifdef CAMU_FF_DECODER_HWACCEL + al_array_init(av->supported_hw_codecs); + al_array_init(av->supported_hw_devices); +#endif AVCodecParameters *codecpar = stream->av.stream->codecpar; const AVCodec *codec = avcodec_find_decoder(codecpar->codec_id); |