Zhiming Wang 6639f02b80
Fix filter::filter::PadIter to actually iterate
Bug caught by clippy:

  error: offset calculation on zero-sized value
    --> src/filter/filter.rs:98:33
     |
  98 |             let pad = Pad::wrap(self.ptr.offset(self.cur));
     |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `#[deny(clippy::zst_offset)]` on by default
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zst_offset

The problem is that `AVFilterPad` is zero-sized:

  #[repr(C)]
  #[derive(Debug, Copy, Clone)]
  pub struct AVFilterPad {
      _unused: [u8; 0],
  }

which is in turn due to `AVFilterPad` being an opaque type in
`libavfilter/avfilter.h`:

  typedef struct AVFilterContext AVFilterContext;
  typedef struct AVFilterLink    AVFilterLink;
  typedef struct AVFilterPad     AVFilterPad;
  typedef struct AVFilterFormats AVFilterFormats;

Doing pointer arithmetic on an opaque (incomplete) type doesn't work. We have
to use the proper FFI calls to obtain info on individual pads. The API has to
be tweaked a bit; hopefully it doesn't break user programs (if it does it
should only break bugged ones...).

Fixes #20.
2020-07-25 23:34:27 +08:00
..
2020-06-17 01:51:38 +08:00
2020-07-24 22:18:58 +08:00
2020-06-01 13:17:08 +08:00