Cosmetics.

This commit is contained in:
Damiano Galassi committed 2014-03-24 14:08:58 +01:00
1 parent e88c278428
commit 6a95e8d565
1 file changed
+6 -9
+6 -9
View File
@@ -673,8 +673,7 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
} }
demuxHelper->samplesWritten++; demuxHelper->samplesWritten++;
free(frame); free(frame);
} } else {
else {
MP42SampleBuffer *nextSample = [[MP42SampleBuffer alloc] init]; MP42SampleBuffer *nextSample = [[MP42SampleBuffer alloc] init];
nextSample->duration = 0; nextSample->duration = 0;
@@ -691,11 +690,10 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
demuxHelper->previousSample = [[MP42SampleBuffer alloc] init]; demuxHelper->previousSample = [[MP42SampleBuffer alloc] init];
demuxHelper->previousSample->duration = StartTime / SCALE_FACTOR; demuxHelper->previousSample->duration = StartTime / SCALE_FACTOR;
demuxHelper->previousSample->offset = 0; demuxHelper->previousSample->offset = 0;
demuxHelper->previousSample->timestamp = 0; demuxHelper->previousSample->timestamp = StartTime;
demuxHelper->previousSample->isSync = YES; demuxHelper->previousSample->isSync = YES;
demuxHelper->previousSample->trackId = track.sourceId; demuxHelper->previousSample->trackId = track.sourceId;
} } else {
else {
if (nextSample->timestamp < demuxHelper->previousSample->timestamp) { if (nextSample->timestamp < demuxHelper->previousSample->timestamp) {
// Out of order samples? swap the next with the previous // Out of order samples? swap the next with the previous
MP42SampleBuffer *temp = nextSample; MP42SampleBuffer *temp = nextSample;
@@ -711,9 +709,8 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
demuxHelper->previousSample = nextSample; demuxHelper->previousSample = nextSample;
demuxHelper->samplesWritten++; demuxHelper->samplesWritten++;
} } else if (!strcmp(trackInfo->CodecID, "S_VOBSUB")) {
// VobSub seems to have an end duration, and no blank samples, so create a new one each time to fill the gaps // VobSub seems to have an end duration, and no blank samples, so create a new one each time to fill the gaps
else if (!strcmp(trackInfo->CodecID, "S_VOBSUB")) {
if (StartTime > demuxHelper->current_time) { if (StartTime > demuxHelper->current_time) {
MP42SampleBuffer *sample = [[MP42SampleBuffer alloc] init]; MP42SampleBuffer *sample = [[MP42SampleBuffer alloc] init];
sample->duration = (StartTime - demuxHelper->current_time) / SCALE_FACTOR; sample->duration = (StartTime - demuxHelper->current_time) / SCALE_FACTOR;
@@ -749,9 +746,9 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
[demuxHelper->queue addObject:frameSample]; [demuxHelper->queue addObject:frameSample];
[frameSample release]; [frameSample release];
if ([demuxHelper->queue count] < bufferSize) if ([demuxHelper->queue count] < bufferSize) {
continue; continue;
else { } else {
currentSample = [demuxHelper->queue objectAtIndex:demuxHelper->buffer]; currentSample = [demuxHelper->queue objectAtIndex:demuxHelper->buffer];
// matroska stores only the start and end time, so we need to recreate // matroska stores only the start and end time, so we need to recreate