Skip to content

Conversation

@redlex-spb
Copy link

No description provided.

Copy link
Owner

@dhowden dhowden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Just a few quick changes.

return fmt.Errorf("invalid encoding: expected at least %d bytes, for integer tag data, got %d", 1, len(b))
}
data = getInt(b[:1])
data = getInt(b[len(b)-1:])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some padding in front that we need to jump over? Might be best to explicitly say that (for future reference!)

}

if name == "gnre" {
m.data[name] = getInt(b[len(b)-1:])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jumping over something here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The genre identifier in the "gnre" tag is stored at the end of the byte array, subsequent processing is redundant, we only need id

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. But then b[len(b)-1:] is going to be 1 byte, so the number will only ever be between 0 and 255 (which will not hit any of the genres added). Is this is in the spec somewhere?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the identifier is stored in one byte.
Sorry, couldn't find an explanation / specification.
I can provide an example.

}

if name == "gnre" {
m.data[name] = getInt(b[len(b)-1:])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. But then b[len(b)-1:] is going to be 1 byte, so the number will only ever be between 0 and 255 (which will not hit any of the genres added). Is this is in the spec somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants