Changeset 1114
- Timestamp:
- 07/26/09 00:01:19 (12 months ago)
- Location:
- branches/perian-1.1
- Files:
-
- 8 modified
-
. (modified) (1 prop)
-
Perian.xcodeproj/project.pbxproj (modified) (1 diff)
-
Release/Changes.txt (modified) (2 diffs)
-
Subtitles/SubATSUIRenderer.m (modified) (1 diff)
-
Subtitles/SubImport.mm (modified) (6 diffs)
-
Subtitles/SubParsing.h (modified) (1 diff)
-
Subtitles/SubParsing.m.rl (modified) (2 diffs)
-
VobSubCodec.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/perian-1.1
- Property svn:mergeinfo changed
/trunk merged: 1103-1104,1107,1112-1113
- Property svn:mergeinfo changed
-
branches/perian-1.1/Perian.xcodeproj/project.pbxproj
r1101 r1114 1520 1520 isa = PBXProject; 1521 1521 buildConfigurationList = 11D4ED470A3CE59A0066D45F /* Build configuration list for PBXProject "Perian" */; 1522 compatibilityVersion = "Xcode 2.4";1522 compatibilityVersion = "Xcode 3.1"; 1523 1523 hasScannedForEncodings = 1; 1524 1524 knownRegions = ( -
branches/perian-1.1/Release/Changes.txt
r1101 r1114 7 7 Fixes: 8 8 - Fixed "Load External Subtitles" checkbox [r998] 9 - Fixed crash/freeze when loading broken VobSub subtitles [r1000, 1034]9 - Fixed crash/freeze when loading broken VobSub subtitles [r1000, r1034] 10 10 - Fixed import of uncompressed audio in FLV [r1007] 11 - Fixed import of some audio tracks; should improve iApps [r1042, r1088]11 - Fixed import of some audio tracks; should improve iApps [r1042, r1088] 12 12 - Fixed CRAM codec AVI in browsers [r1010] 13 13 - Worked around bug in iChat codec loading [r1008] … … 27 27 - Fixed rendering of multi-layer subtitles [r1016] 28 28 - Fixed SRT files using ',' for decimals [r1019] 29 - Ignored SSA shapes and \blur instead of misparsing them [r1027, 1036]29 - Ignored SSA shapes and \blur instead of misparsing them [r1027, r1036] 30 30 - Disabled vertical font support again to fix files wrongly using it for Latin text [r1027] 31 31 - Fixed subtitles in MKV wrongly displaying at the end of a video [r1036] 32 - Fixed text position with \move [r1063] 32 - Better handling of \move and \org [r1063, r1103] 33 Notes: 34 - Compilation under 10.4 is no longer supported. 35 - AC3Codec has been deprecated and will be replaced by an LGPL decoder in a future release. 33 36 34 37 1.1.3 -
branches/perian-1.1/Subtitles/SubATSUIRenderer.m
r1101 r1114 1096 1096 const unichar *ubuffer = STUnicodeForString(div->text, &ubufferData); 1097 1097 1098 if (div->layer != lastLayer ) {1098 if (div->layer != lastLayer || div->shouldResetPens) { 1099 1099 resetPens = YES; 1100 1100 lastLayer = div->layer; -
branches/perian-1.1/Subtitles/SubImport.mm
r1087 r1114 31 31 32 32 extern "C" { 33 int ExtractVobSubPacket(UInt8 *dest, const UInt8 *framedSrc, int srcSize, int *usedSrcBytes );33 int ExtractVobSubPacket(UInt8 *dest, const UInt8 *framedSrc, int srcSize, int *usedSrcBytes, int index); 34 34 } 35 35 … … 812 812 static OSErr loadTrackIntoMovie(VobSubTrack *track, VobSubInfo info, uint8_t onlyForced, Track *theTrack, uint8_t *hasForcedSubtitles) 813 813 { 814 int sampleCount = [track->samples count]; 815 if(sampleCount == 0) 816 return noErr; 817 814 818 ImageDescriptionHandle imgDesc; 815 819 Media trackMedia = createVobSubMedia(info.theMovie, info.movieBox, &imgDesc, info.dataRef, info.dataRefType, track); … … 820 824 } 821 825 822 int sampleCount = [track->samples count];823 826 int totalSamples = 0; 824 827 SampleReference64Ptr samples = (SampleReference64Ptr)calloc(sampleCount*2, sizeof(SampleReference64Record)); … … 843 846 NSData *subData = [info.subFileData subdataWithRange:NSMakeRange(offset, size)]; 844 847 uint8_t *extracted = (uint8_t *)malloc(size); 845 int extractedSize = ExtractVobSubPacket(extracted, (const UInt8 *)[subData bytes], size, &size); 848 //The index here likely should really be track->index, but I'm not sure we can really trust it. 849 int extractedSize = ExtractVobSubPacket(extracted, (const UInt8 *)[subData bytes], size, &size, -1); 846 850 847 851 uint16_t startTimestamp, endTimestamp; … … 1030 1034 while((track = [trackEnum nextObject]) != nil) 1031 1035 { 1032 Track theTrack ;1036 Track theTrack = NULL; 1033 1037 VobSubInfo info = {theMovie, dataRefType, dataRef, imageWidth, imageHeight, movieBox, subFileData}; 1034 1038 uint8_t hasForced = 0; 1035 1039 err = loadTrackIntoMovie(track, info, 0, &theTrack, &hasForced); 1036 if( hasForced)1040 if(theTrack && hasForced) 1037 1041 { 1038 1042 Track forcedTrack; … … 1046 1050 if (*firstSubTrack == NULL) 1047 1051 *firstSubTrack = theTrack; 1048 else 1052 else if(theTrack) 1049 1053 SetTrackAlternate(*firstSubTrack, theTrack); 1050 1054 } -
branches/perian-1.1/Subtitles/SubParsing.h
r1081 r1114 39 39 float posX, posY; 40 40 UInt8 alignH, alignV, wrapStyle, render_complexity; 41 BOOL positioned ;41 BOOL positioned, shouldResetPens; 42 42 43 43 unsigned layer; -
branches/perian-1.1/Subtitles/SubParsing.m.rl
r1081 r1114 359 359 } 360 360 } 361 362 action origin { 363 div->shouldResetPens = YES; 364 } 361 365 362 366 intnum = ("-"? [0-9]+) >paramset %setintnum; … … 405 409 |"move" move %position 406 410 |"t" parens 407 |"org" parens 411 |"org" parens %origin 408 412 |("fad" "e"? parens) 409 413 |"clip" parens -
branches/perian-1.1/VobSubCodec.c
r1087 r1114 83 83 84 84 // dest must be at least as large as src 85 int ExtractVobSubPacket(UInt8 *dest, UInt8 *framedSrc, int srcSize, int *usedSrcBytes );85 int ExtractVobSubPacket(UInt8 *dest, UInt8 *framedSrc, int srcSize, int *usedSrcBytes, int index); 86 86 static ComponentResult ReadPacketControls(UInt8 *packet, UInt32 palette[16], PacketControlData *controlDataOut); 87 87 extern void initLib(); … … 331 331 } else if (data[0] + data[1] == 0) { 332 332 // remove the MPEG framing 333 myDrp->bufferSize = ExtractVobSubPacket(glob->codecData, data, myDrp->bufferSize, NULL );333 myDrp->bufferSize = ExtractVobSubPacket(glob->codecData, data, myDrp->bufferSize, NULL, -1); 334 334 } else { 335 335 memcpy(glob->codecData, drp->codecData, myDrp->bufferSize); … … 442 442 } 443 443 444 int ExtractVobSubPacket(UInt8 *dest, UInt8 *framedSrc, int srcSize, int *usedSrcBytes ) {444 int ExtractVobSubPacket(UInt8 *dest, UInt8 *framedSrc, int srcSize, int *usedSrcBytes, int index) { 445 445 int copiedBytes = 0; 446 446 UInt8 *currentPacket = framedSrc; … … 483 483 484 484 int header_data_length = currentPacket[8]; 485 486 memcpy(&dest[copiedBytes], 487 // header's 9 bytes + extension, we don't want 1st byte of packet 488 ¤tPacket[9 + header_data_length + 1], 489 // we don't want the 1-byte stream ID, or the header 490 packet_length - 1 - (header_data_length + 3)); 491 492 if(packetSize == INT_MAX) 485 int packetIndex = currentPacket[header_data_length + 9] & 0x1f; 486 if(index == -1) 487 index = packetIndex; 488 if(index == packetIndex) 493 489 { 494 packetSize = dest[0] << 8 | dest[1]; 490 int blockSize = packet_length - 1 - (header_data_length + 3); 491 memcpy(&dest[copiedBytes], 492 // header's 9 bytes + extension, we don't want 1st byte of packet 493 ¤tPacket[9 + header_data_length + 1], 494 // we don't want the 1-byte stream ID, or the header 495 blockSize); 496 copiedBytes += blockSize; 497 498 if(packetSize == INT_MAX) 499 { 500 packetSize = dest[0] << 8 | dest[1]; 501 } 495 502 } 496 copiedBytes += packet_length - 1 - (header_data_length + 3);497 503 currentPacket += packet_length + 6; 498 504 break;
