media: Derive frame ordering from AVFrame::pts [chromium/src : main]

0 views
Skip to first unread message

Dale Curtis (Gerrit)

unread,
Jul 7, 2025, 1:02:02 PM7/7/25
to Peter Collingbourne, AyeAye, Chromium LUCI CQ, feature-me...@chromium.org
Attention needed from Peter Collingbourne

Dale Curtis voted and added 2 comments

Votes added by Dale Curtis

Code-Review+1

2 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Dale Curtis . resolved

Thanks for the simplification!

File media/filters/ffmpeg_video_decoder.cc
Line 497, Patchset 2 (Latest): codec_context_->pkt_timebase = (AVRational){1, 1000000};
Dale Curtis . unresolved

no c_style casts.

Open in Gerrit

Related details

Attention is currently required from:
  • Peter Collingbourne
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Idd4e52638910253d8b56b06d73d3e868d9535836
Gerrit-Change-Number: 6706346
Gerrit-PatchSet: 2
Gerrit-Owner: Peter Collingbourne <p...@chromium.org>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Peter Collingbourne <p...@chromium.org>
Gerrit-Attention: Peter Collingbourne <p...@chromium.org>
Gerrit-Comment-Date: Mon, 07 Jul 2025 17:01:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Peter Collingbourne (Gerrit)

unread,
Jul 7, 2025, 3:34:42 PM7/7/25
to Dale Curtis, AyeAye, Chromium LUCI CQ, feature-me...@chromium.org

Peter Collingbourne voted and added 1 comment

Votes added by Peter Collingbourne

Auto-Submit+1
Commit-Queue+2

1 comment

File media/filters/ffmpeg_video_decoder.cc
Line 497, Patchset 2: codec_context_->pkt_timebase = (AVRational){1, 1000000};
Dale Curtis . resolved

no c_style casts.

Peter Collingbourne

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Idd4e52638910253d8b56b06d73d3e868d9535836
Gerrit-Change-Number: 6706346
Gerrit-PatchSet: 3
Gerrit-Owner: Peter Collingbourne <p...@chromium.org>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Peter Collingbourne <p...@chromium.org>
Gerrit-Comment-Date: Mon, 07 Jul 2025 19:34:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
satisfied_requirement
open
diffy

Peter Collingbourne (Gerrit)

unread,
Jul 7, 2025, 5:49:18 PM7/7/25
to Dale Curtis, AyeAye, Chromium LUCI CQ, feature-me...@chromium.org

Peter Collingbourne voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Idd4e52638910253d8b56b06d73d3e868d9535836
Gerrit-Change-Number: 6706346
Gerrit-PatchSet: 3
Gerrit-Owner: Peter Collingbourne <p...@chromium.org>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Peter Collingbourne <p...@chromium.org>
Gerrit-Comment-Date: Mon, 07 Jul 2025 21:49:07 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Chromium LUCI CQ (Gerrit)

unread,
Jul 7, 2025, 8:17:00 PM7/7/25
to Peter Collingbourne, Dale Curtis, AyeAye, feature-me...@chromium.org

Chromium LUCI CQ submitted the change with unreviewed changes

Unreviewed changes

2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: media/filters/ffmpeg_video_decoder.cc
Insertions: 1, Deletions: 1.

@@ -494,7 +494,7 @@

// Timebase must be at most 1us because of web-facing APIs with
// microsecond-level precision such as VideoFrame.timestamp.
- codec_context_->pkt_timebase = (AVRational){1, 1000000};
+ codec_context_->pkt_timebase = AVRational{1, 1000000};

const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
if (!codec || avcodec_open2(codec_context_.get(), codec, nullptr) < 0) {
```

Change information

Commit message:
media: Derive frame ordering from AVFrame::pts

When using FFmpeg's libopenh264 backend for decoding H.264 (not used by
the upstream build, but some Linux distributions such as Fedora use it),
AVFrame::opaque is copied from AVPacket::opaque but is not adjusted to
take into account frame reordering (e.g. for B-frames). As a result,
frames may be displayed in the wrong order.

The correct way to determine the frame presentation order is to use the
presentation timestamp field, AVFrame::pts. This field is not set to a
valid value unless AVCodecContext::pkt_timebase and AVPacket::pts are set,
so do so.
Bug: 401515587
Change-Id: Idd4e52638910253d8b56b06d73d3e868d9535836
Reviewed-by: Dale Curtis <dalec...@chromium.org>
Auto-Submit: Peter Collingbourne <p...@chromium.org>
Commit-Queue: Peter Collingbourne <p...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1483447}
Files:
  • M media/filters/ffmpeg_video_decoder.cc
  • M media/filters/ffmpeg_video_decoder.h
Change size: S
Delta: 2 files changed, 7 insertions(+), 26 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Dale Curtis
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Idd4e52638910253d8b56b06d73d3e868d9535836
Gerrit-Change-Number: 6706346
Gerrit-PatchSet: 4
Gerrit-Owner: Peter Collingbourne <p...@chromium.org>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages