Skip to content

Commit

Permalink
fix: ps startcode leading length
Browse files Browse the repository at this point in the history
  • Loading branch information
ireader committed Dec 14, 2024
1 parent 8c84c3b commit 87d503b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libmpeg/source/mpeg-ts-h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ int mpeg_h264_find_new_access_unit(const uint8_t* data, size_t bytes, int* vcl)
{
// pes data loss ???
*vcl = MPEG_VCL_CORRUPT;
return (int)(p - data + n - leading);
return (int)(p - data + n - (leading>3?3:leading));
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion libmpeg/source/mpeg-ts-h265.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int mpeg_h265_find_new_access_unit(const uint8_t* data, size_t bytes, int* vcl)
{
// pes data loss ???
*vcl = MPEG_VCL_CORRUPT; // for assert
return (int)(p - data + n - leading);
return (int)(p - data + n - (leading > 3 ? 3 : leading));
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion libmpeg/source/mpeg-ts-h266.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int mpeg_h266_find_new_access_unit(const uint8_t* data, size_t bytes, int* vcl)
{
// pes data loss ???
*vcl = MPEG_VCL_CORRUPT; // for assert
return (int)(p - data + n - leading);
return (int)(p - data + n - (leading > 3 ? 3 : leading));
}
else
{
Expand Down

0 comments on commit 87d503b

Please sign in to comment.