Fixed more errors
This commit is contained in:
1 parent
f2ccd9e1d6
commit
9e3554d6df
3 files changed
+41
-18
No files matched your search
@@ -130,18 +130,29 @@
|
|||||||
for (i = 0; i < spsCount; i++) {
|
for (i = 0; i < spsCount; i++) {
|
||||||
uint16_t spsSize = (avcCAtom[ptrPos++] << 8) & 0xff00;
|
uint16_t spsSize = (avcCAtom[ptrPos++] << 8) & 0xff00;
|
||||||
spsSize += avcCAtom[ptrPos++] & 0xff;
|
spsSize += avcCAtom[ptrPos++] & 0xff;
|
||||||
|
|
||||||
|
if (spsSize + ptrPos < magicCookie.length) {
|
||||||
MP4AddH264SequenceParameterSet(_fileHandle, dstTrackId,
|
MP4AddH264SequenceParameterSet(_fileHandle, dstTrackId,
|
||||||
avcCAtom+ptrPos, spsSize);
|
avcCAtom+ptrPos, spsSize);
|
||||||
ptrPos += spsSize;
|
ptrPos += spsSize;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t ppsCount = avcCAtom[ptrPos++];
|
int8_t ppsCount = avcCAtom[ptrPos++];
|
||||||
for (i = 0; i < ppsCount; i++) {
|
for (i = 0; i < ppsCount; i++) {
|
||||||
uint16_t ppsSize = (avcCAtom[ptrPos++] << 8) & 0xff00;
|
uint16_t ppsSize = (avcCAtom[ptrPos++] << 8) & 0xff00;
|
||||||
ppsSize += avcCAtom[ptrPos++] & 0xff;
|
ppsSize += avcCAtom[ptrPos++] & 0xff;
|
||||||
|
|
||||||
|
if (ppsSize + ptrPos < magicCookie.length) {
|
||||||
MP4AddH264PictureParameterSet(_fileHandle, dstTrackId,
|
MP4AddH264PictureParameterSet(_fileHandle, dstTrackId,
|
||||||
avcCAtom + ptrPos, ppsSize);
|
avcCAtom + ptrPos, ppsSize);
|
||||||
ptrPos += ppsSize;
|
ptrPos += ppsSize;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MP4SetVideoProfileLevel(_fileHandle, 0x15);
|
MP4SetVideoProfileLevel(_fileHandle, 0x15);
|
||||||
|
|||||||
@@ -10,15 +10,18 @@
|
|||||||
#import "MP42MediaFormat.h"
|
#import "MP42MediaFormat.h"
|
||||||
#import "MP42Image.h"
|
#import "MP42Image.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface MP42TextSample : NSObject <NSCoding> {
|
@interface MP42TextSample : NSObject <NSCoding> {
|
||||||
MP42Duration timestamp;
|
MP42Duration _timestamp;
|
||||||
MP42Image *image;
|
MP42Image *_image;
|
||||||
NSString *title;
|
NSString *_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
@property(readwrite, retain) NSString *title;
|
@property (nonatomic, readwrite, copy) NSString *title;
|
||||||
@property(readwrite, retain) MP42Image *image;
|
@property (nonatomic, readwrite, retain, nullable) MP42Image *image;
|
||||||
@property(readwrite) MP42Duration timestamp;
|
@property (nonatomic, readwrite) MP42Duration timestamp;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
+21
-12
@@ -12,11 +12,11 @@
|
|||||||
|
|
||||||
- (NSComparisonResult)compare:(MP42TextSample *)otherObject
|
- (NSComparisonResult)compare:(MP42TextSample *)otherObject
|
||||||
{
|
{
|
||||||
MP42Duration otherTimestamp = [otherObject timestamp];
|
MP42Duration otherTimestamp = otherObject.timestamp;
|
||||||
|
|
||||||
if (timestamp < otherTimestamp)
|
if (_timestamp < otherTimestamp)
|
||||||
return NSOrderedAscending;
|
return NSOrderedAscending;
|
||||||
else if (timestamp > otherTimestamp)
|
else if (_timestamp > otherTimestamp)
|
||||||
return NSOrderedDescending;
|
return NSOrderedDescending;
|
||||||
|
|
||||||
return NSOrderedSame;
|
return NSOrderedSame;
|
||||||
@@ -24,27 +24,36 @@
|
|||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
[image release];
|
[_image release];
|
||||||
[title release];
|
[_title release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
@synthesize timestamp;
|
@synthesize timestamp = _timestamp;
|
||||||
@synthesize title;
|
@synthesize title = _title;
|
||||||
@synthesize image;
|
@synthesize image = _image;
|
||||||
|
|
||||||
|
- (void)setTitle:(NSString *)title
|
||||||
|
{
|
||||||
|
if (title == nil) {
|
||||||
|
_title = @"";
|
||||||
|
} else {
|
||||||
|
_title = [title copy];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)encodeWithCoder:(NSCoder *)coder
|
- (void)encodeWithCoder:(NSCoder *)coder
|
||||||
{
|
{
|
||||||
[coder encodeInt64:timestamp forKey:@"timestamp"];
|
[coder encodeInt64:_timestamp forKey:@"timestamp"];
|
||||||
[coder encodeObject:title forKey:@"title"];
|
[coder encodeObject:_title forKey:@"title"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithCoder:(NSCoder *)decoder
|
- (id)initWithCoder:(NSCoder *)decoder
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
timestamp = [decoder decodeInt64ForKey:@"timestamp"];
|
_timestamp = [decoder decodeInt64ForKey:@"timestamp"];
|
||||||
title = [[decoder decodeObjectForKey:@"title"] retain];
|
_title = [[decoder decodeObjectForKey:@"title"] retain];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user