summarylogtreecommitdiffstats
path: root/libquicktime-1.2.4-ffmpeg7.patch
blob: 8a87ee6e88da32fa9ee9f3c16f6a3db4858b361f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- libquicktime-1.2.4.orig/plugins/ffmpeg/audio.c  2024-07-09 12:18:11.919376601 +0200
+++ libquicktime-1.2.4/plugins/ffmpeg/audio.c   2024-07-09 12:10:53.297276614 +0200
@@ -971,7 +971,11 @@
   if(!codec->initialized)
     {
     /* Set some mandatory variables */
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
+    codec->avctx->ch_layout.nb_channels = quicktime_track_channels(file, track);
+#else
     codec->avctx->channels        = quicktime_track_channels(file, track);
+#endif
     codec->avctx->sample_rate     = quicktime_sample_rate(file, track);

     if(track_map->track->mdia.minf.stbl.stsd.table[0].version == 1)
@@ -1202,7 +1206,11 @@
   if(!codec->initialized)
     {
     codec->avctx->sample_rate = track_map->samplerate;
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
+    codec->avctx->ch_layout.nb_channels = channels;
+#else
     codec->avctx->channels = channels;
+#endif

     codec->avctx->codec_id = codec->encoder->id;
     codec->avctx->codec_type = codec->encoder->type;
@@ -1229,7 +1237,11 @@
     /* One frame is: bitrate * frame_samples / (samplerate * 8) + 1024 */
     codec->chunk_buffer_alloc = ( codec->avctx->frame_size
                                   * sizeof( int16_t )
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
+                                  * codec->avctx->ch_layout.nb_channels);
+#else
                                   * codec->avctx->channels);
+#endif
     codec->chunk_buffer = malloc(codec->chunk_buffer_alloc);

     if(trak->strl)