mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-13 18:47:44 +00:00
[mod_av] Add support for FFmpeg 6.0
This commit is contained in:
parent
f76b504d6d
commit
9dccd0b6e6
@ -416,6 +416,7 @@ static int interrupt_cb(void *cp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if (LIBAVFORMAT_VERSION_MAJOR < LIBAVFORMAT_6_V)
|
||||||
static int mod_avformat_alloc_output_context2(AVFormatContext **avctx, const char *format, const char *filename, av_file_context_t *context)
|
static int mod_avformat_alloc_output_context2(AVFormatContext **avctx, const char *format, const char *filename, av_file_context_t *context)
|
||||||
{
|
{
|
||||||
AVFormatContext *s = avformat_alloc_context();
|
AVFormatContext *s = avformat_alloc_context();
|
||||||
@ -489,6 +490,7 @@ error:
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int write_frame(AVFormatContext *fmt_ctx, const AVRational *time_base, AVStream *st, AVPacket *pkt)
|
static int write_frame(AVFormatContext *fmt_ctx, const AVRational *time_base, AVStream *st, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
@ -2235,7 +2237,16 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (LIBAVFORMAT_VERSION_MAJOR < LIBAVFORMAT_6_V)
|
||||||
mod_avformat_alloc_output_context2(&context->fc, format, (char *)file, context);
|
mod_avformat_alloc_output_context2(&context->fc, format, (char *)file, context);
|
||||||
|
#else
|
||||||
|
avformat_alloc_output_context2(&context->fc, NULL, format, (char *)file);
|
||||||
|
|
||||||
|
if (context->fc) {
|
||||||
|
context->fc->interrupt_callback.callback = interrupt_cb;
|
||||||
|
context->fc->interrupt_callback.opaque = context;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!context->fc) {
|
if (!context->fc) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Could not deduce output format from file extension\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Could not deduce output format from file extension\n");
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
#define LIBAVCODEC_V 59
|
#define LIBAVCODEC_V 59
|
||||||
#define LIBAVFORMAT_V 59
|
#define LIBAVFORMAT_V 59
|
||||||
|
#define LIBAVFORMAT_6_V 60
|
||||||
#define LIBAVUTIL_V 57
|
#define LIBAVUTIL_V 57
|
||||||
|
|
||||||
struct mod_av_globals {
|
struct mod_av_globals {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user