Open GoogleCodeExporter opened 8 years ago
What's the old code you use to write reverse DNS atoms? (if you could
copy/paste here, I might be able to figure it out)
Original comment by kid...@gmail.com
on 23 Aug 2011 at 4:34
file = MP4Modify([self.pathname UTF8String], 0);
@try {
if (self.selectedRating) {
MP4ItmfItem *item = MP4ItmfItemAlloc("----", 1);
item->mean = strdup("com.apple.iTunes");
item->name = strdup("iTunEXTC");
// If it's already there, remove it
MP4ItmfRemoveItem(file, item);
MP4ItmfData * data = &item->dataList.elements[0];
data->typeCode = MP4_ITMF_BT_UTF8;
data->valueSize = (uint32_t) [self.selectedRating length];
data->value = (uint8_t *) malloc(data->valueSize);
memcpy(data->value, [self.selectedRating UTF8String], data->valueSize);
MP4ItmfAddItem(file, item);
MP4ItmfItemFree(item);
}
if ([dict count] > 0) {
NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]];
[dict writeToFile:path atomically:YES];
NSString *xml = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL];
[[NSFileManager defaultManager] removeItemAtPath:path error:NULL];
MP4ItmfItem *item = MP4ItmfItemAlloc("----", 1);
item->mean = strdup("com.apple.iTunes");
item->name = strdup("iTunMOVI");
// If it's already there, remove it
MP4ItmfRemoveItem(file, item);
MP4ItmfData * data = &item->dataList.elements[0];
data->typeCode = MP4_ITMF_BT_UTF8;
data->valueSize = (uint32_t) [xml length];
data->value = (uint8_t *) malloc(data->valueSize);
memcpy(data->value, [xml UTF8String], data->valueSize);
MP4ItmfAddItem(file, item);
MP4ItmfItemFree(item);
}
} @finally {
MP4Close(file, 0);
}
Original comment by Scott.Gr...@gmail.com
on 23 Aug 2011 at 5:30
That isn't the old api, it's just a lower level api.
Original comment by damiog
on 27 Aug 2011 at 6:21
Right, but it's different, which means I have to be sure I've saved and closed
the file with the 'higher' level api, and then do this, and then make sure this
one is saved and closed if I'm going to do anything else with the higher level
one.
If you'll pull this functionality into the higher level, then I don't run the
risk of corrupting my file by forgetting to save/close something.
Original comment by Scott.Gr...@gmail.com
on 27 Aug 2011 at 8:28
No you don't need to close the file and reopen it. Just make sure to use first
one and then the other.
Original comment by damiog
on 28 Aug 2011 at 8:30
The 'make sure' part is the problem. If tags are getting set in different
places, I don't really *know* that I'm just doing one type at a time. If the
higher level API provided a method for this, then we wouldn't have to worry
about it.
Original comment by Scott.Gr...@gmail.com
on 29 Aug 2011 at 7:38
Original issue reported on code.google.com by
Scott.Gr...@gmail.com
on 19 Aug 2011 at 9:40