Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: services/media/framework_ffmpeg/ffmpeg_audio_decoder.cc

Issue 1814553002: Motown: Improvements to packet definition (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/media/framework_ffmpeg/ffmpeg_audio_decoder.cc
diff --git a/services/media/framework_ffmpeg/ffmpeg_audio_decoder.cc b/services/media/framework_ffmpeg/ffmpeg_audio_decoder.cc
index 11e2679aba266dca51bdb7c8729952a46f97a8a6..45e1adb516cbf951776d76202df4987b49d0204d 100644
--- a/services/media/framework_ffmpeg/ffmpeg_audio_decoder.cc
+++ b/services/media/framework_ffmpeg/ffmpeg_audio_decoder.cc
@@ -28,7 +28,7 @@ FfmpegAudioDecoder::~FfmpegAudioDecoder() {}
void FfmpegAudioDecoder::Flush() {
FfmpegDecoderBase::Flush();
- next_presentation_time_= Packet::kUnknownPresentationTime;
+ next_pts_= Packet::kUnknownPts;
}
int FfmpegAudioDecoder::Decode(
@@ -41,11 +41,11 @@ int FfmpegAudioDecoder::Decode(
DCHECK(context());
DCHECK(av_frame_ptr);
- if (next_presentation_time_ == Packet::kUnknownPresentationTime) {
+ if (next_pts_ == Packet::kUnknownPts) {
if (av_packet.pts == AV_NOPTS_VALUE) {
- next_presentation_time_ = 0;
+ next_pts_ = 0;
johngro 2016/03/21 19:47:56 I'm still a bit confused by this logic; eg, why is
dalesat 2016/03/21 22:30:59 Acknowledged.
} else {
- next_presentation_time_ = av_packet.pts;
+ next_pts_ = av_packet.pts;
}
}
@@ -74,10 +74,10 @@ PacketPtr FfmpegAudioDecoder::CreateOutputPacket(
PayloadAllocator* allocator) {
DCHECK(allocator);
- int64_t presentation_time = av_frame.pts;
- if (presentation_time == AV_NOPTS_VALUE) {
- presentation_time = next_presentation_time_;
- next_presentation_time_ += av_frame.nb_samples;
+ int64_t pts = av_frame.pts;
+ if (pts == AV_NOPTS_VALUE) {
+ pts = next_pts_;
+ next_pts_ += av_frame.nb_samples;
}
uint64_t payload_size;
@@ -110,8 +110,7 @@ PacketPtr FfmpegAudioDecoder::CreateOutputPacket(
}
return Packet::Create(
- presentation_time,
- av_frame.nb_samples,
+ pts,
false, // The base class is responsible for end-of-stream.
payload_size,
payload_buffer,
@@ -119,7 +118,7 @@ PacketPtr FfmpegAudioDecoder::CreateOutputPacket(
}
PacketPtr FfmpegAudioDecoder::CreateOutputEndOfStreamPacket() {
- return Packet::CreateEndOfStream(next_presentation_time_);
+ return Packet::CreateEndOfStream(next_pts_);
}
int FfmpegAudioDecoder::AllocateBufferForAvFrame(

Powered by Google App Engine
This is Rietveld 408576698