Skip to content

Commit

Permalink
Merge pull request #3290 from tomiwu/main
Browse files Browse the repository at this point in the history
Fix for decoding a PES packet with a header, when the DTS (Decoding Timestamp) is unavailable.
  • Loading branch information
mpilquist authored Aug 30, 2023
2 parents 73429d2 + bc75cb6 commit 655aabe
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ object PesPacketHeader {
("flags" | Codec[Flags]).flatPrepend { flags =>
variableSizeBytes(
uint8,
("pts" | conditional(flags.ptsFlag, tsCodec(bin"0011"))) ::
("pts" | conditional(
flags.ptsFlag,
if (flags.dtsFlag) tsCodec(bin"0011") else tsCodec(bin"0010")
)) ::
("dts" | conditional(flags.dtsFlag, tsCodec(bin"0001"))) ::
("escr" | conditional(flags.escrFlag, escrCodec)) ::
("es_rate" | conditional(flags.esRateFlag, ignore(1) ~> uint(22) <~ ignore(1))) ::
Expand Down

0 comments on commit 655aabe

Please sign in to comment.