Fixed more errors

This commit is contained in:
Damiano Galassi committed 2015-08-20 14:47:10 +02:00
1 parent f2ccd9e1d6
commit 9e3554d6df
4 files changed
+50 -27

No files matched your search

+1 -1
View File
@@ -215,7 +215,7 @@
refTrackDuration = moovDuration;
for (i = 0; i < chapterCount; i++) {
MP42TextSample * chapter = [chapters objectAtIndex:i];
MP42TextSample *chapter = [chapters objectAtIndex:i];
if ([[chapter title] UTF8String])
strcpy(fileChapters[i].title, [[chapter title] UTF8String]);
+17 -6
View File
@@ -130,18 +130,29 @@
for (i = 0; i < spsCount; i++) {
uint16_t spsSize = (avcCAtom[ptrPos++] << 8) & 0xff00;
spsSize += avcCAtom[ptrPos++] & 0xff;
MP4AddH264SequenceParameterSet(_fileHandle, dstTrackId,
avcCAtom+ptrPos, spsSize);
ptrPos += spsSize;
if (spsSize + ptrPos < magicCookie.length) {
MP4AddH264SequenceParameterSet(_fileHandle, dstTrackId,
avcCAtom+ptrPos, spsSize);
ptrPos += spsSize;
} else {
break;
}
}
int8_t ppsCount = avcCAtom[ptrPos++];
for (i = 0; i < ppsCount; i++) {
uint16_t ppsSize = (avcCAtom[ptrPos++] << 8) & 0xff00;
ppsSize += avcCAtom[ptrPos++] & 0xff;
MP4AddH264PictureParameterSet(_fileHandle, dstTrackId,
avcCAtom + ptrPos, ppsSize);
ptrPos += ppsSize;
if (ppsSize + ptrPos < magicCookie.length) {
MP4AddH264PictureParameterSet(_fileHandle, dstTrackId,
avcCAtom + ptrPos, ppsSize);
ptrPos += ppsSize;
} else {
break;
}
}
MP4SetVideoProfileLevel(_fileHandle, 0x15);
+9 -6
View File
@@ -10,15 +10,18 @@
#import "MP42MediaFormat.h"
#import "MP42Image.h"
NS_ASSUME_NONNULL_BEGIN
@interface MP42TextSample : NSObject <NSCoding> {
MP42Duration timestamp;
MP42Image *image;
NSString *title;
MP42Duration _timestamp;
MP42Image *_image;
NSString *_title;
}
@property(readwrite, retain) NSString *title;
@property(readwrite, retain) MP42Image *image;
@property(readwrite) MP42Duration timestamp;
@property (nonatomic, readwrite, copy) NSString *title;
@property (nonatomic, readwrite, retain, nullable) MP42Image *image;
@property (nonatomic, readwrite) MP42Duration timestamp;
@end
NS_ASSUME_NONNULL_END
+23 -14
View File
@@ -10,41 +10,50 @@
@implementation MP42TextSample
-(NSComparisonResult)compare:(MP42TextSample *)otherObject
- (NSComparisonResult)compare:(MP42TextSample *)otherObject
{
MP42Duration otherTimestamp = [otherObject timestamp];
MP42Duration otherTimestamp = otherObject.timestamp;
if (timestamp < otherTimestamp)
if (_timestamp < otherTimestamp)
return NSOrderedAscending;
else if (timestamp > otherTimestamp)
else if (_timestamp > otherTimestamp)
return NSOrderedDescending;
return NSOrderedSame;
}
-(void) dealloc
- (void)dealloc
{
[image release];
[title release];
[_image release];
[_title release];
[super dealloc];
}
@synthesize timestamp;
@synthesize title;
@synthesize image;
@synthesize timestamp = _timestamp;
@synthesize title = _title;
@synthesize image = _image;
- (void)setTitle:(NSString *)title
{
if (title == nil) {
_title = @"";
} else {
_title = [title copy];
}
}
- (void)encodeWithCoder:(NSCoder *)coder
{
[coder encodeInt64:timestamp forKey:@"timestamp"];
[coder encodeObject:title forKey:@"title"];
[coder encodeInt64:_timestamp forKey:@"timestamp"];
[coder encodeObject:_title forKey:@"title"];
}
- (id)initWithCoder:(NSCoder *)decoder
{
self = [super init];
timestamp = [decoder decodeInt64ForKey:@"timestamp"];
title = [[decoder decodeObjectForKey:@"title"] retain];
_timestamp = [decoder decodeInt64ForKey:@"timestamp"];
_title = [[decoder decodeObjectForKey:@"title"] retain];
return self;
}