Skip to content

Commit

Permalink
Update ffmpeg-the-third to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FreezyLemon committed Aug 27, 2024
1 parent 64d03d2 commit e542217
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
31 changes: 18 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions av_metrics_decoders/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ license = "MIT"
repository = "https://github.com/rust-av/av-metrics"
include = ["src/**/*", "LICENSE"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.66"
av-metrics = "0.9"
ffmpeg-the-third = { version = "1.2.2", optional = true, default-features = false, features = [
ffmpeg-the-third = { version = "2.0", optional = true, default-features = false, features = [
"codec",
"format",
] }
Expand Down
7 changes: 6 additions & 1 deletion av_metrics_decoders/src/ffmpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ impl Decoder for FfmpegDecoder {
loop {
// This iterator is actually really stupid... it doesn't reset itself after each `new`.
// But that solves our lifetime hell issues, ironically.
let packet = self.input_ctx.packets().next().map(|(_, packet)| packet);
let packet = self
.input_ctx
.packets()
.filter_map(Result::ok)
.next()
.map(|(_, packet)| packet);

let mut packet = if let Some(packet) = packet {
packet
Expand Down

0 comments on commit e542217

Please sign in to comment.