Skip to content

Commit ca4fe2a

Browse files
committed
SGVideoDecoder: Padding frames.
1 parent 730d29e commit ca4fe2a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

SGPlayer/Classes/Core/SGDecoder/SGVideoDecoder.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ - (void)flush
9191
SGCodecDescriptor *cd = packet.codecDescriptor;
9292
NSAssert(cd, @"Invalid Codec Descriptor.");
9393
if (![cd isEqualCodecContextToDescriptor:self->_codecDescriptor]) {
94-
NSArray<SGFrame *> *objs = [self processPacket:nil];
94+
NSArray<SGFrame *> *objs = [self finish];
9595
for (SGFrame *obj in objs) {
9696
[ret addObject:obj];
9797
}
@@ -108,9 +108,9 @@ - (void)flush
108108
[ret addObject:obj];
109109
}
110110
}
111-
if (ret.firstObject) {
111+
if (ret.lastObject) {
112112
[self->_lastOutputFrame unlock];
113-
self->_lastOutputFrame = ret.firstObject;
113+
self->_lastOutputFrame = ret.lastObject;
114114
[self->_lastOutputFrame lock];
115115
}
116116
self->_flags.outputCount += ret.count;

0 commit comments

Comments
 (0)