Skip to content

Commit

Permalink
Code refactoring for magic producer
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed May 20, 2024
1 parent bc8295b commit 99cc21a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/magic/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func Open(r io.Reader) (core.Producer, error) {
}

switch {
case bytes.HasPrefix(b, []byte(annexb.StartCode)):
case string(b) == annexb.StartCode:
return bitstream.Open(rd)

case bytes.HasPrefix(b, []byte{0xFF, 0xD8}):
Expand All @@ -37,7 +37,7 @@ func Open(r io.Reader) (core.Producer, error) {
case bytes.HasPrefix(b, []byte("--")):
return multipart.Open(rd)

case b[0] == 0xFF && b[1]&0xF7 == 0xF1:
case b[0] == 0xFF && (b[1] == 0xF1 || b[1] == 0xF9):
return aac.Open(rd)

case b[0] == mpegts.SyncByte:
Expand Down

0 comments on commit 99cc21a

Please sign in to comment.