Fixes for h264bitstream library for reading and writing SPS

This commit is contained in:
Iwan Timmer
2015-05-01 14:20:36 +02:00
parent c4e8cee2bf
commit de40d3f54d
2 changed files with 4 additions and 6 deletions

View File

@@ -146,11 +146,9 @@ int find_nal_unit(uint8_t* buf, int size, int* nal_start, int* nal_end)
int rbsp_to_nal(const uint8_t* rbsp_buf, const int* rbsp_size, uint8_t* nal_buf, int* nal_size)
{
int i;
int j = 1;
int j = 0;
int count = 0;
if (*nal_size > 0) { nal_buf[0] = 0x00; } // zero out first byte since we start writing from second byte
for ( i = 0; i < *rbsp_size ; i++ )
{
if ( j >= *nal_size )

View File

@@ -337,7 +337,7 @@ void read_seq_parameter_set_rbsp(h264_stream_t* h, bs_t* b)
if( 1 )
{
memcpy(h->sps, h->sps_table[sps->seq_parameter_set_id], sizeof(sps_t));
memcpy(h->sps_table[sps->seq_parameter_set_id], h->sps, sizeof(sps_t));
}
}
@@ -1224,7 +1224,7 @@ void write_seq_parameter_set_rbsp(h264_stream_t* h, bs_t* b)
if( 0 )
{
memcpy(h->sps, h->sps_table[sps->seq_parameter_set_id], sizeof(sps_t));
memcpy(h->sps_table[sps->seq_parameter_set_id], h->sps, sizeof(sps_t));
}
}
@@ -2111,7 +2111,7 @@ void read_debug_seq_parameter_set_rbsp(h264_stream_t* h, bs_t* b)
if( 1 )
{
memcpy(h->sps, h->sps_table[sps->seq_parameter_set_id], sizeof(sps_t));
memcpy(h->sps_table[sps->seq_parameter_set_id], h->sps, sizeof(sps_t));
}
}