[libbluray-devel] Rename file_entry.icb_flags -> file_entry.ad_type
Petri Hintukainen
git at videolan.org
Wed May 31 10:25:27 CEST 2017
libudfread | branch: master | Petri Hintukainen <phintuka at gmail.com> | Wed May 31 11:22:39 2017 +0300| [34268210a90393ff9d818b0f5b53a76b65e91767] | committer: Petri Hintukainen
Rename file_entry.icb_flags -> file_entry.ad_type
> http://git.videolan.org/gitweb.cgi/libudfread.git/?a=commit;h=34268210a90393ff9d818b0f5b53a76b65e91767
---
src/ecma167.c | 13 ++++++-------
src/ecma167.h | 2 +-
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/ecma167.c b/src/ecma167.c
index d777490..b488990 100644
--- a/src/ecma167.c
+++ b/src/ecma167.c
@@ -232,14 +232,13 @@ static void _decode_extended_ad(const uint8_t *buf, struct long_ad *ad)
/* File Entry */
-static void _decode_file_ads(const uint8_t *p, int flags, uint16_t partition,
+static void _decode_file_ads(const uint8_t *p, int ad_type, uint16_t partition,
struct long_ad *ad, unsigned num_ad)
{
uint32_t i;
- flags &= 7;
for (i = 0; i < num_ad; i++) {
- switch (flags) {
+ switch (ad_type) {
case 0:
_decode_short_ad(p, partition, &ad[i]);
p += 8;
@@ -302,7 +301,7 @@ static struct file_entry *_decode_file_entry(const uint8_t *p, size_t size,
fe->file_type = tag.file_type;
fe->length = _get_u64(p + 56);
fe->num_ad = num_ad;
- fe->icb_flags = tag.flags;
+ fe->ad_type = tag.flags & 7;
if (content_inline) {
/* data of small files can be embedded in file entry */
@@ -310,7 +309,7 @@ static struct file_entry *_decode_file_entry(const uint8_t *p, size_t size,
fe->content_inline = 1;
memcpy(fe->data.content, p + p_ad, l_ad);
} else {
- _decode_file_ads(p + p_ad, tag.flags, partition, &fe->data.ad[0], num_ad);
+ _decode_file_ads(p + p_ad, fe->ad_type, partition, &fe->data.ad[0], num_ad);
}
return fe;
@@ -327,7 +326,7 @@ int decode_allocation_extent(struct file_entry **p_fe, const uint8_t *p, size_t
return -1;
}
- switch (fe->icb_flags & 7) {
+ switch (fe->ad_type) {
case 0: num_ad = l_ad / 8; break;
case 1: num_ad = l_ad / 16; break;
case 2: num_ad = l_ad / 20; break;
@@ -353,7 +352,7 @@ int decode_allocation_extent(struct file_entry **p_fe, const uint8_t *p, size_t
fe->num_ad--;
/* decode new allocation descriptors */
- _decode_file_ads(p + 24, fe->icb_flags, partition, &fe->data.ad[fe->num_ad], num_ad);
+ _decode_file_ads(p + 24, fe->ad_type, partition, &fe->data.ad[fe->num_ad], num_ad);
fe->num_ad += num_ad;
return 0;
diff --git a/src/ecma167.h b/src/ecma167.h
index f507893..e483f05 100644
--- a/src/ecma167.h
+++ b/src/ecma167.h
@@ -212,7 +212,7 @@ struct file_entry {
uint64_t length; /* in bytes */
uint8_t file_type; /* ECMA_FT_* */
uint8_t content_inline; /* 1 if file data is embedded in file entry */
- uint8_t icb_flags; /* used when parsing allocation extents */
+ uint8_t ad_type; /* from icb_flags; used when parsing allocation extents */
uint32_t num_ad;
union {
More information about the libbluray-devel
mailing list