mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-06-09 01:48:55 +00:00
Remove buggy/unused multiple-frame-per-packet handling from WebM decoders
This commit is contained in:
@@ -923,40 +923,26 @@ WebMReader::DemuxPacket()
|
||||
}
|
||||
|
||||
// Figure out if this is a keyframe.
|
||||
//
|
||||
// Doing this at packet-granularity is kind of the wrong level of
|
||||
// abstraction, but timestamps are on the packet, so the only time
|
||||
// we have multiple video frames in a packet is when we have "alternate
|
||||
// reference frames", which are a compression detail and never displayed.
|
||||
// So for our purposes, we can just take the union of the is_kf values for
|
||||
// all the frames in the packet.
|
||||
bool isKeyframe = false;
|
||||
if (track == mAudioTrack) {
|
||||
isKeyframe = true;
|
||||
} else if (track == mVideoTrack) {
|
||||
unsigned int count = 0;
|
||||
r = nestegg_packet_count(packet, &count);
|
||||
unsigned char* data;
|
||||
size_t length;
|
||||
r = nestegg_packet_data(packet, 0, &data, &length);
|
||||
if (r == -1) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < count; ++i) {
|
||||
unsigned char* data;
|
||||
size_t length;
|
||||
r = nestegg_packet_data(packet, i, &data, &length);
|
||||
if (r == -1) {
|
||||
return nullptr;
|
||||
}
|
||||
vpx_codec_stream_info_t si;
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.sz = sizeof(si);
|
||||
if (mVideoCodec == NESTEGG_CODEC_VP8) {
|
||||
vpx_codec_peek_stream_info(vpx_codec_vp8_dx(), data, length, &si);
|
||||
} else if (mVideoCodec == NESTEGG_CODEC_VP9) {
|
||||
vpx_codec_peek_stream_info(vpx_codec_vp9_dx(), data, length, &si);
|
||||
}
|
||||
isKeyframe = isKeyframe || si.is_kf;
|
||||
vpx_codec_stream_info_t si;
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.sz = sizeof(si);
|
||||
if (mVideoCodec == NESTEGG_CODEC_VP8) {
|
||||
vpx_codec_peek_stream_info(vpx_codec_vp8_dx(), data, length, &si);
|
||||
} else if (mVideoCodec == NESTEGG_CODEC_VP9) {
|
||||
vpx_codec_peek_stream_info(vpx_codec_vp9_dx(), data, length, &si);
|
||||
}
|
||||
isKeyframe = si.is_kf;
|
||||
}
|
||||
|
||||
int64_t offset = mDecoder->GetResource()->Tell();
|
||||
|
||||
Reference in New Issue
Block a user