mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
HEVC: Fix nalu vec duplicate when h265 vps/sps/pps demux. v6.0.26 (#3411)
Co-authored-by: chundonglinlin <chundonglinlin@163.com> Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
parent
b957463e5e
commit
3ce57ae6b6
6 changed files with 17 additions and 5 deletions
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 6
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 25
|
||||
#define VERSION_REVISION 26
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1048,6 +1048,7 @@ srs_error_t SrsFormat::hevc_demux_hvcc(SrsBuffer* stream)
|
|||
dec_conf_rec_p->temporal_id_nested, dec_conf_rec_p->length_size_minus_one, numOfArrays);
|
||||
|
||||
//parse vps/pps/sps
|
||||
dec_conf_rec_p->nalu_vec.clear();
|
||||
for (int index = 0; index < numOfArrays; index++) {
|
||||
if (!stream->require(3)) {
|
||||
return srs_error_new(ERROR_HEVC_DECODE_ERROR, "requires 3 only %d bytes", stream->left());
|
||||
|
|
|
@ -4737,8 +4737,6 @@ VOID TEST(ConfigEnvTest, CheckEnvValuesDash)
|
|||
|
||||
VOID TEST(ConfigEnvTest, CheckEnvValuesHds)
|
||||
{
|
||||
srs_error_t err;
|
||||
|
||||
if (true) {
|
||||
MockSrsConfig conf;
|
||||
|
||||
|
|
|
@ -4053,10 +4053,19 @@ VOID TEST(KernelCodecTest, HevcVideoFormat)
|
|||
SrsFormat f;
|
||||
HELPER_EXPECT_SUCCESS(f.initialize());
|
||||
|
||||
HELPER_EXPECT_SUCCESS(f.on_video(0, (char *)vps_sps_pps, sizeof(vps_sps_pps)));
|
||||
// firstly demux sequence header
|
||||
HELPER_EXPECT_SUCCESS(f.on_video(0, (char*)vps_sps_pps, sizeof(vps_sps_pps)));
|
||||
EXPECT_EQ(1, f.video->frame_type);
|
||||
EXPECT_EQ(0, f.video->avc_packet_type);
|
||||
EXPECT_EQ(3, f.vcodec->hevc_dec_conf_record_.nalu_vec.size());
|
||||
EXPECT_EQ(1280, f.vcodec->width);
|
||||
EXPECT_EQ(720, f.vcodec->height);
|
||||
|
||||
// secondly demux sequence header
|
||||
HELPER_EXPECT_SUCCESS(f.on_video(0, (char*)vps_sps_pps, sizeof(vps_sps_pps)));
|
||||
EXPECT_EQ(1, f.video->frame_type);
|
||||
EXPECT_EQ(0, f.video->avc_packet_type);
|
||||
EXPECT_EQ(3, f.vcodec->hevc_dec_conf_record_.nalu_vec.size());
|
||||
EXPECT_EQ(1280, f.vcodec->width);
|
||||
EXPECT_EQ(720, f.vcodec->height);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue