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

Unified Diff: webrtc/common_video/h264/h264_bitstream_parser.cc

Issue 2726833005: H264BitstreamParser: Log nalu type when parsing slice type fails. (Closed)
Patch Set: Change log. Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/h264/h264_bitstream_parser.cc
diff --git a/webrtc/common_video/h264/h264_bitstream_parser.cc b/webrtc/common_video/h264/h264_bitstream_parser.cc
index 4ad0ed4b283dcbf22b29f359dfcdcd5b73732214..bbd40e8f05b2d1bdd13c83132524ee3a73773b45 100644
--- a/webrtc/common_video/h264/h264_bitstream_parser.cc
+++ b/webrtc/common_video/h264/h264_bitstream_parser.cc
@@ -27,10 +27,10 @@ const int kMaxQpValue = 51;
namespace webrtc {
-#define RETURN_ON_FAIL(x, res) \
- if (!(x)) { \
- LOG_F(LS_ERROR) << "FAILED: " #x; \
- return res; \
+#define RETURN_ON_FAIL(x, res) \
+ if (!(x)) { \
+ LOG_F(LS_WARNING) << "FAILED: " #x; \
+ return res; \
}
#define RETURN_INV_ON_FAIL(x) RETURN_ON_FAIL(x, kInvalidStream)
@@ -64,7 +64,11 @@ H264BitstreamParser::Result H264BitstreamParser::ParseNonParameterSetNalu(
RETURN_INV_ON_FAIL(slice_reader.ReadExponentialGolomb(&golomb_tmp));
// slice_type: ue(v)
uint32_t slice_type;
- RETURN_INV_ON_FAIL(slice_reader.ReadExponentialGolomb(&slice_type));
+ if (!slice_reader.ReadExponentialGolomb(&slice_type)) {
+ // This is a temporary logging to help diagnose the issue.
+ LOG_F(LS_WARNING) << "Failed to read slice type: " << nalu_type;
+ return kInvalidStream;
+ }
// slice_type's 5..9 range is used to indicate that all slices of a picture
// have the same value of slice_type % 5, we don't care about that, so we map
// to the corresponding 0..4 range.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698