1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Cover more kernel codec.

This commit is contained in:
winlin 2019-05-15 08:44:38 +08:00
parent 77cc148608
commit f7994b85eb
2 changed files with 168 additions and 8 deletions

View file

@ -553,10 +553,8 @@ srs_error_t SrsFormat::on_audio(int64_t timestamp, char* data, int size)
SrsBuffer* buffer = new SrsBuffer(data, size);
SrsAutoFree(SrsBuffer, buffer);
// audio decode
if (!buffer->require(1)) {
return srs_error_new(ERROR_HLS_DECODE_ERROR, "aac decode sound_format");
}
// We already checked the size is positive and data is not NULL.
srs_assert(buffer->require(1));
// @see: E.4.2 Audio Tags, video_file_format_spec_v10_1.pdf, page 76
uint8_t v = buffer->read_1bytes();
@ -599,10 +597,8 @@ srs_error_t SrsFormat::on_video(int64_t timestamp, char* data, int size)
SrsBuffer* buffer = new SrsBuffer(data, size);
SrsAutoFree(SrsBuffer, buffer);
// video decode
if (!buffer->require(1)) {
return srs_error_new(ERROR_HLS_DECODE_ERROR, "decode frame_type");
}
// We already checked the size is positive and data is not NULL.
srs_assert(buffer->require(1));
// @see: E.4.3 Video Tags, video_file_format_spec_v10_1.pdf, page 78
int8_t frame_type = buffer->read_1bytes();