]> git.pld-linux.org Git - packages/vlc.git/blob - vlc-fdk_aac.patch
- libplacebo rebuild
[packages/vlc.git] / vlc-fdk_aac.patch
1 Based on ffmpeg patch:
2
3 From: Martin Storsjö <martin@martin.st>
4 Date: Fri, 31 Aug 2018 11:25:30 +0000 (+0300)
5 Subject: libfdk-aacenc: Fix building with libfdk-aac v2
6 X-Git-Url: https://git.libav.org/?p=libav.git;a=commitdiff_plain;h=141c960e21d2860e354f9b90df136184dd00a9a8;hp=c8bca9fe466f810fd484e2c6db7ef7bc83b5a943
7
8 libfdk-aacenc: Fix building with libfdk-aac v2
9
10 When flushing the encoder, we now need to provide non-null buffer
11 parameters for everything, even if they are unused.
12
13 The encoderDelay parameter has been replaced by two, nDelay and
14 nDelayCore.
15
16
17 --- vlc-3.0.7.1/modules/codec/fdkaac.c.orig     2019-08-04 19:40:15.759796884 +0200
18 +++ vlc-3.0.7.1/modules/codec/fdkaac.c  2019-08-04 19:50:16.323210020 +0200
19 @@ -59,6 +59,11 @@
20  #include <vlc_plugin.h>
21  #include <vlc_codec.h>
22  
23 +#define FDKENC_VER_AT_LEAST(vl0, vl1) \
24 +    (defined(AACENCODER_LIB_VL0) && \
25 +        ((AACENCODER_LIB_VL0 > vl0) || \
26 +         (AACENCODER_LIB_VL0 == vl0 && AACENCODER_LIB_VL1 >= vl1)))
27 +
28  static int OpenEncoder(vlc_object_t *);
29  static void CloseEncoder(vlc_object_t *);
30  
31 @@ -288,7 +293,11 @@
32      p_sys->i_maxoutputsize = 768*p_enc->fmt_in.audio.i_channels;
33      p_enc->fmt_in.audio.i_bitspersample = 16;
34      p_sys->i_frame_size = info.frameLength;
35 +#if FDKENC_VER_AT_LEAST(4, 0)
36 +    p_sys->i_encoderdelay = info.nDelay;
37 +#else
38      p_sys->i_encoderdelay = info.encoderDelay;
39 +#endif
40  
41      p_enc->fmt_out.i_extra = info.confSize;
42      if (p_enc->fmt_out.i_extra) {
43 @@ -353,21 +362,26 @@
44          int out_identifier = OUT_BITSTREAM_DATA;
45          int out_size, out_elem_size;
46          void *in_ptr, *out_ptr;
47 +        char dummy_buf[1];
48  
49          if (unlikely(i_samples == 0)) {
50 +            /* Must be a non-null pointer, even if it's a dummy. */
51 +            in_ptr = dummy_buf;
52 +            in_size = 0;
53              // this forces the encoder to purge whatever is left in the internal buffer
54              in_args.numInSamples = -1;
55          } else {
56              in_ptr = p_buffer + (i_samples - i_samples_left)*p_enc->fmt_in.audio.i_channels;
57              in_size = 2*p_enc->fmt_in.audio.i_channels*i_samples_left;
58 -            in_elem_size = 2;
59              in_args.numInSamples = p_enc->fmt_in.audio.i_channels*i_samples_left;
60 -            in_buf.numBufs = 1;
61 -            in_buf.bufs = &in_ptr;
62 -            in_buf.bufferIdentifiers = &in_identifier;
63 -            in_buf.bufSizes = &in_size;
64 -            in_buf.bufElSizes = &in_elem_size;
65          }
66 +        in_elem_size = 2;
67 +        in_buf.numBufs = 1;
68 +        in_buf.bufs = &in_ptr;
69 +        in_buf.bufferIdentifiers = &in_identifier;
70 +        in_buf.bufSizes = &in_size;
71 +        in_buf.bufElSizes = &in_elem_size;
72 +
73          block_t *p_block;
74          p_block = block_Alloc(p_sys->i_maxoutputsize);
75          p_block->i_buffer = p_sys->i_maxoutputsize;
This page took 0.027663 seconds and 3 git commands to generate.