sample_muxer: clean-up to conform to style guide
Change-Id: I77a4657d71359777a8f55f40346014f90051e02d
This commit is contained in:
		
							
								
								
									
										7
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								Makefile
									
									
									
									
									
								
							| @@ -6,9 +6,8 @@ WEBMOBJS  := mkvparser.o mkvreader.o mkvmuxer.o mkvmuxerutil.o mkvwriter.o | ||||
| OBJSA     := $(WEBMOBJS:.o=_a.o) | ||||
| OBJSSO    := $(WEBMOBJS:.o=_so.o) | ||||
| OBJECTS1  := sample.o | ||||
| OBJECTS2  := sample_muxer.o | ||||
| OBJECTS2  := sample_muxer.o vttreader.o webvttparser.o sample_muxer_metadata.o | ||||
| OBJECTS3  := dumpvtt.o vttreader.o webvttparser.o | ||||
| OBJECTS4  := vttreader.o webvttparser.o sample_muxer_metadata.o | ||||
| INCLUDES  := -I. | ||||
| EXES      := samplemuxer sample dumpvtt | ||||
|  | ||||
| @@ -17,7 +16,7 @@ all: $(EXES) | ||||
| sample: sample.o $(LIBWEBMA) | ||||
| 	$(CXX) $^ -o $@ | ||||
|  | ||||
| samplemuxer: sample_muxer.o $(LIBWEBMA) $(OBJECTS4) | ||||
| samplemuxer: $(OBJECTS2) $(LIBWEBMA) | ||||
| 	$(CXX) $^ -o $@ | ||||
|  | ||||
| dumpvtt: $(OBJECTS3) | ||||
| @@ -41,4 +40,4 @@ libwebm.so: $(OBJSSO) | ||||
| 	$(CXX) -c $(CXXFLAGS) -fPIC $(INCLUDES) $< -o $@ | ||||
|  | ||||
| clean: | ||||
| 	$(RM) -f $(OBJECTS1) $(OBJECTS2) $(OBJECTS3) $(OBJECTS4) $(OBJSA) $(OBJSSO) $(LIBWEBMA) $(LIBWEBMSO) $(EXES) Makefile.bak | ||||
| 	$(RM) -f $(OBJECTS1) $(OBJECTS2) $(OBJECTS3) $(OBJSA) $(OBJSSO) $(LIBWEBMA) $(LIBWEBMSO) $(EXES) Makefile.bak | ||||
|   | ||||
| @@ -399,7 +399,11 @@ int main(int argc, char* argv[]) { | ||||
|   // input file. | ||||
|  | ||||
|   SampleMuxerMetadata metadata; | ||||
|   metadata.Init(&muxer_segment); | ||||
|  | ||||
|   if (!metadata.Init(&muxer_segment)) { | ||||
|     printf("\n Could not initialize metadata cache.\n"); | ||||
|     return EXIT_FAILURE; | ||||
|   } | ||||
|  | ||||
|   if (!LoadMetadataFiles(metadata_files, &metadata)) | ||||
|     return EXIT_FAILURE; | ||||
|   | ||||
| @@ -7,8 +7,12 @@ using std::string; | ||||
| SampleMuxerMetadata::SampleMuxerMetadata() : segment_(NULL) { | ||||
| } | ||||
|  | ||||
| void SampleMuxerMetadata::Init(mkvmuxer::Segment* s) { | ||||
|   segment_ = s; | ||||
| bool SampleMuxerMetadata::Init(mkvmuxer::Segment* segment) { | ||||
|   if (segment == NULL || segment_ != NULL) | ||||
|     return false; | ||||
|  | ||||
|   segment_ = segment; | ||||
|   return true; | ||||
| } | ||||
|  | ||||
| bool SampleMuxerMetadata::Load(const char* file, Kind kind) { | ||||
|   | ||||
| @@ -26,8 +26,9 @@ class SampleMuxerMetadata { | ||||
|  | ||||
|   SampleMuxerMetadata(); | ||||
|  | ||||
|   // Bind this metadata object to the muxer instance. | ||||
|   void Init(mkvmuxer::Segment* segment); | ||||
|   // Bind this metadata object to the muxer instance.  Returns false | ||||
|   // if segment equals NULL, or Init has already been called. | ||||
|   bool Init(mkvmuxer::Segment* segment); | ||||
|  | ||||
|   // Parse the WebVTT file |filename| having the indicated |kind|, and | ||||
|   // create a corresponding track in the segment.  Returns false on | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Matthew Heaney
					Matthew Heaney