| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
DCHECK(!buf.empty());Normally, when there's a CHECK, we don't handle it below. CHECKs are for "This never happens" invariants.
I would remove this check since we handle it below.
#include "base/memory/raw_ptr.h"Can `raw_ptr.h` be removed?
size_t remaining_size = es_size - offset;Same as `cur_buf.size()`?
const uint32_t value = base::U32FromNativeEndian(buffer.first<4u>());I don't think that native endianness should be used here. There would be a different result based on the platform.
I think you want big-endian here. An easy way to confirm would be to try little endian and see if things are broken.
base::checked_cast<size_t>(search_pos),
base::checked_cast<size_t>(end_pos - search_pos))))) {NIT: Any way to update some data type to avoid `checked_cast`s here?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Normally, when there's a CHECK, we don't handle it below. CHECKs are for "This never happens" invariants.
I would remove this check since we handle it below.
Done
#include "base/memory/raw_ptr.h"Weidong LiuCan `raw_ptr.h` be removed?
Done
size_t remaining_size = es_size - offset;Weidong LiuSame as `cur_buf.size()`?
Done
const uint32_t value = base::U32FromNativeEndian(buffer.first<4u>());I don't think that native endianness should be used here. There would be a different result based on the platform.
I think you want big-endian here. An easy way to confirm would be to try little endian and see if things are broken.
Done. Thank you for your correction.
base::checked_cast<size_t>(search_pos),
base::checked_cast<size_t>(end_pos - search_pos))))) {NIT: Any way to update some data type to avoid `checked_cast`s here?
This requires converting the type of `protected_blocks_`. I anticipate this will involve a wider range of modifications. For now, let's leave it as is.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
static int ExtractAdtsFrameSize(base::span<const uint8_t> adts_header) {
return ((static_cast<int>(adts_header[5]) >> 5) |
(static_cast<int>(adts_header[4]) << 3) |
((static_cast<int>(adts_header[3]) & 0x3) << 11));NIT: Use `size_t` and get rid of `checked_cast<size_t>` below
size_t es_size = es_queue_->Data().size();NIT: If we remove `es_size` below, using `es.size()` directly would be clearer, since there would be only two uses.
es_size = es_queue_->Data().size();No longer needed?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
static int ExtractAdtsFrameSize(base::span<const uint8_t> adts_header) {
return ((static_cast<int>(adts_header[5]) >> 5) |
(static_cast<int>(adts_header[4]) << 3) |
((static_cast<int>(adts_header[3]) & 0x3) << 11));NIT: Use `size_t` and get rid of `checked_cast<size_t>` below
Done
NIT: If we remove `es_size` below, using `es.size()` directly would be clearer, since there would be only two uses.
Done
es_size = es_queue_->Data().size();Weidong LiuNo longer needed?
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
#include "base/numerics/safe_conversions.h"NIT: Probably no longer needed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
Thanks.
#include "base/numerics/safe_conversions.h"NIT: Probably no longer needed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
5 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: media/formats/mp2t/es_parser_adts.cc
Insertions: 0, Deletions: 1.
@@ -12,7 +12,6 @@
#include "base/containers/span.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
-#include "base/strings/string_number_conversions.h"
#include "media/base/audio_timestamp_helper.h"
#include "media/base/bit_reader.h"
#include "media/base/channel_layout.h"
```
spanification: spanify some parts of EsParser.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |