| 294 | } |
| 295 | |
| 296 | bool ReadAMFBool(bool* val, AMFInputStream* stream) { |
| 297 | uint8_t marker; |
| 298 | if (stream->cut_u8(&marker) != 1u) { |
| 299 | LOG(ERROR) << "stream is not long enough"; |
| 300 | return false; |
| 301 | } |
| 302 | if ((AMFMarker)marker == AMF_MARKER_BOOLEAN) { |
| 303 | uint8_t tmp; |
| 304 | if (stream->cut_u8(&tmp) != 1u) { |
| 305 | LOG(ERROR) << "stream is not long enough"; |
| 306 | return false; |
| 307 | } |
| 308 | *val = tmp; |
| 309 | return true; |
| 310 | } |
| 311 | LOG(ERROR) << "Expected boolean, actually " << marker2str(marker); |
| 312 | return false; |
| 313 | } |
| 314 | |
| 315 | bool ReadAMFNumber(double* val, AMFInputStream* stream) { |
| 316 | uint8_t marker; |
no test coverage detected