X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shared%2Fffmpeg_raii.cpp;fp=shared%2Fffmpeg_raii.cpp;h=0e087c27b063a03ef80e909f22ec1d2c9516fbde;hb=f0db8fcc58dd66a7dfd019f99add721d8161b75a;hp=f2948e9feba8908f88ee529daaf43e99d1f2b518;hpb=bdc9f1ea04141e71906d486f9d254c3346835e72;p=nageru diff --git a/shared/ffmpeg_raii.cpp b/shared/ffmpeg_raii.cpp index f2948e9..0e087c2 100644 --- a/shared/ffmpeg_raii.cpp +++ b/shared/ffmpeg_raii.cpp @@ -31,7 +31,11 @@ AVFormatContextWithCloser avformat_open_input_unique( { AVFormatContext *format_ctx = avformat_alloc_context(); format_ctx->interrupt_callback = interrupt_cb; +#ifdef ff_const59 + if (avformat_open_input(&format_ctx, pathname, const_cast(fmt), options) != 0) { +#else if (avformat_open_input(&format_ctx, pathname, fmt, options) != 0) { +#endif format_ctx = nullptr; } return AVFormatContextWithCloser(format_ctx); @@ -48,7 +52,11 @@ AVFormatContextWithCloser avformat_open_input_unique( unsigned char *buf = (unsigned char *)av_malloc(buf_size); format_ctx->pb = avio_alloc_context(buf, buf_size, /*write_flag=*/false, opaque, read_packet, /*write_packet=*/nullptr, /*seek=*/nullptr); +#ifdef ff_const59 + if (avformat_open_input(&format_ctx, "", const_cast(fmt), options) != 0) { +#else if (avformat_open_input(&format_ctx, "", fmt, options) != 0) { +#endif format_ctx = nullptr; } return AVFormatContextWithCloser(format_ctx);