mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-19 06:49:55 +00:00
Fixes for h264bitstream library for reading and writing SPS
This commit is contained in:
@@ -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 rbsp_to_nal(const uint8_t* rbsp_buf, const int* rbsp_size, uint8_t* nal_buf, int* nal_size)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int j = 1;
|
int j = 0;
|
||||||
int count = 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++ )
|
for ( i = 0; i < *rbsp_size ; i++ )
|
||||||
{
|
{
|
||||||
if ( j >= *nal_size )
|
if ( j >= *nal_size )
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ void read_seq_parameter_set_rbsp(h264_stream_t* h, bs_t* b)
|
|||||||
|
|
||||||
if( 1 )
|
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 )
|
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 )
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user