]> git.pld-linux.org Git - packages/gpac.git/blob - ffmpeg6.patch
- up to 2.2.1
[packages/gpac.git] / ffmpeg6.patch
1 From ba14e34dd7a3c4cef5a56962898e9f863dd4b4f3 Mon Sep 17 00:00:00 2001
2 From: jeanlf <jeanlf@gpac.io>
3 Date: Mon, 13 Mar 2023 09:43:52 +0100
4 Subject: [PATCH] fixed compil with ffmpeg 6 - cf #2406
5
6 ---
7  src/filters/ff_mx.c | 20 ++++++++++++++++----
8  1 file changed, 16 insertions(+), 4 deletions(-)
9
10 diff --git a/src/filters/ff_mx.c b/src/filters/ff_mx.c
11 index 34e5f59e7c..5cf1d98941 100644
12 --- a/src/filters/ff_mx.c
13 +++ b/src/filters/ff_mx.c
14 @@ -503,7 +503,11 @@ static GF_Err ffmx_close_seg(GF_Filter *filter, GF_FFMuxCtx *ctx, Bool send_evt_
15                 evt.seg_size.is_init = 0;
16         }
17         evt.seg_size.media_range_start = ctx->offset_at_seg_start;
18 +#if LIBAVFORMAT_VERSION_MAJOR < 60
19         evt.seg_size.media_range_end = ctx->muxer->pb ? (ctx->muxer->pb->written-1) : 0;
20 +#else
21 +       evt.seg_size.media_range_end = ctx->muxer->pb ? (ctx->muxer->pb->bytes_written-1) : 0;
22 +#endif
23         ctx->offset_at_seg_start = evt.seg_size.media_range_end;
24  
25         gf_filter_pid_send_event(pid, &evt);
26 @@ -1013,13 +1017,21 @@ static GF_Err ffmx_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_r
27                 ff_codec_id = ffmpeg_codecid_from_gpac(codec_id, &ff_codec_tag);
28         }
29  
30 +
31 +       res = 1;
32 +#if LIBAVFORMAT_VERSION_MAJOR < 60
33         if (ctx->muxer->oformat && ctx->muxer->oformat->query_codec) {
34                 res = ctx->muxer->oformat->query_codec(ff_codec_id, 1);
35 -               if (!res) {
36 -                       GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[FFMux] Codec %s not supported in container %s\n", gf_codecid_name(codec_id), ctx->muxer->oformat->name));
37 -                       return GF_NOT_SUPPORTED;
38 -               }
39         }
40 +#else
41 +       res = avformat_query_codec(ctx->muxer->oformat, ff_codec_id, FF_COMPLIANCE_NORMAL);
42 +#endif
43 +
44 +       if (!res) {
45 +               GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[FFMux] Codec %s not supported in container %s\n", gf_codecid_name(codec_id), ctx->muxer->oformat->name));
46 +               return GF_NOT_SUPPORTED;
47 +       }
48 +
49         const AVCodec *c = avcodec_find_decoder(ff_codec_id);
50         if (!c) return GF_NOT_SUPPORTED;
51  
This page took 0.128969 seconds and 3 git commands to generate.