Commits

Ivan Vučica committed 852387d

Removed some dead code paths.

  • Participants
  • Parent commits 994ce5b

Comments (0)

Files changed (1)

File MakeRefMovieCLI/makerefmovie.m

 @interface MetadataItemAtom : Atom 
 {
 }
+-(id)initWithMiniName:(NSString*)miniName;
 @end
 @implementation MetadataItemAtom
 
         MetadataAtom * meta = nil;
         
         udta = [[UserdataAtom new] autorelease];
-        /*
-        NSData *namdata = [NSData dataWithBytes:"Jerry" length:5];
-        MetadataItemAtom * nam = [[[MetadataItemAtom alloc] initWithMiniName:@"nam" unknownPrefixBeforeValue:1 value:namdata] autorelease];
-        [udta appendAtom:nam];
-        */
         meta = [[MetadataAtom new] autorelease];
         
-        
-#if 0
-        MetadataHandlerAtom * hdlr = [[[MetadataHandlerAtom alloc] initWithHandler:'mdta'] autorelease];
-        [meta appendAtom:hdlr];
-
-        NSMutableArray * keysArray = [NSMutableArray array];
-        int argi;
-        for(argi = 3; argi < argc; argi++)
-        {
-            if(!strcmp(argv[argi], "-nam"))
-            {
-                [keysArray addObject:@"com.apple.quicktime.displayname"];
-                argi++;
-            }
-        }
-        MetadataItemKeysAtom * keys = [[[MetadataItemKeysAtom alloc] initWithKeyNames:keysArray] autorelease];
-        [meta appendAtom:keys];
-        
-        //
-
-        MetadataItemListAtom * ilst = [[MetadataItemListAtom new] autorelease];
-        for(argi = 3; argi < argc; argi++)
-        {
-            int keyIndex = argi - 3 + 1; // 1 based instead of 0 based
-            if(!strcmp(argv[argi], "-nam"))
-            {
-                argi++;
-                
-                MetadataItemAtom * nam = [[[MetadataItemAtom alloc] initWithKeyIndex:keyIndex] autorelease];
-                NSData * value = [NSData dataWithBytes:argv[argi] length:strlen(argv[argi])];
-                MetadataDataAtom * data = [[[MetadataDataAtom alloc] initWithType:MetadataDataAtomTypeString locale:MetadataDataAtomLocaleDefault value:value] autorelease];
-                
-                [nam appendAtom:data];
-                [ilst appendAtom:nam];
-
-            }
-        }
-        
-#else
         MetadataHandlerAtom * hdlr = [[[MetadataHandlerAtom alloc] initWithHandler:'mdir'] autorelease];
         [meta appendAtom:hdlr];
 
                 [ilst appendAtom:stik];
             }
         }
-
-#endif
         
         [meta appendAtom:ilst];
         [udta appendAtom:meta];
 
     }    
     
-    
-    
-    /*
-    if(argc > 3)
-    {
-        UserdataAtom * udta = [[UserdataAtom new] autorelease];
-        int argi;
-        for(argi = 3; argi < argc; argi++)
-        {
-            if(!strcmp(argv[argi], "-nam"))
-            {
-                argi++;
-                
-                MetadataItemAtom * nam = [[[MetadataItemAtom alloc] initWithMiniName:@"nam"] autorelease];
-                NSData * value = [NSData dataWithBytes:argv[argi] length:strlen(argv[argi])];
-                MetadataDataAtom * data = [[[MetadataDataAtom alloc] initWithType:MetadataDataAtomTypeString locale:MetadataDataAtomLocaleDefault value:value] autorelease];
-                
-                [nam appendAtom:data];
-                [udta appendAtom:nam];
-                
-            }
-        }
-        [moov appendAtom:udta];
-    }
-     */
-    /*
-    if(argc > 3)
-    {
-        MetadataAtom * meta = [[MetadataAtom new] autorelease];
-        MetadataHandlerAtom * hdlr = [[[MetadataHandlerAtom alloc] initWithHandler:'mdir'] autorelease];
-        [meta appendAtom:hdlr];
-        
-        MetadataItemListAtom * ilst = [[MetadataItemListAtom new] autorelease];
-        int argi;
-        for(argi = 3; argi < argc; argi++)
-        {
-            if(!strcmp(argv[argi], "-nam"))
-            {
-                argi++;
-
-                MetadataItemAtom * nam = [[[MetadataItemAtom alloc] initWithMiniName:@"nam"] autorelease];
-                NSData * value = [NSData dataWithBytes:argv[argi] length:strlen(argv[argi])];
-                MetadataDataAtom * data = [[[MetadataDataAtom alloc] initWithType:MetadataDataAtomTypeString locale:MetadataDataAtomLocaleDefault value:value] autorelease];
-                
-                [nam appendAtom:data];
-                [ilst appendAtom:nam];
-                
-            }
-        }
-        [meta appendAtom:ilst];
-        
-        [moov appendAtom:meta];
-    }    
-    */
-    
-    //[moov writeToFile:[NSString stringWithUTF8String:argv[2]]];
-    
-    
-    Atom * a = [[[Atom alloc] initWithName:@"ftyp"] autorelease];
-    [a->data appendBytes:(char[]){'3','g','2','a'} length:4]; // major brand
-    [a->data appendBytes:(char[]){0,0,0,0} length:4]; // version
-    //[a writeToFile:[NSString stringWithUTF8String:argv[2]]];
-    
-    
-    NSMutableData * outData = [NSMutableData data];
-    //[outData appendData:[a resultData]];
-    [outData appendData:[moov resultData]];
-    [outData writeToFile:[NSString stringWithUTF8String:argv[2]] atomically:YES];
+    [moov writeToFile:[NSString stringWithUTF8String:argv[2]]];
     
     [pool release];