From f3bd5d82e501834e01e5d0d9b1a634f8c80012ce Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Mon, 3 Feb 2014 10:56:27 -0800 Subject: [PATCH] libmkv: constify codec_id. This lets the caller pass a string literal for the codec id. From https://bugzilla.mozilla.org/show_bug.cgi?id=966044 Change-Id: I345bd7a5943f0c33b3fb368d4280100ac5038a3d --- third_party/libmkv/WebMElement.c | 10 ++++++---- third_party/libmkv/WebMElement.h | 22 ++++++++++++---------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/third_party/libmkv/WebMElement.c b/third_party/libmkv/WebMElement.c index 2f79a3c6a..3ab388054 100644 --- a/third_party/libmkv/WebMElement.c +++ b/third_party/libmkv/WebMElement.c @@ -52,8 +52,9 @@ static UInt64 generateTrackID(unsigned int trackNumber) { return rval; } -void writeVideoTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing, - char *codecId, unsigned int pixelWidth, unsigned int pixelHeight, +void writeVideoTrack(EbmlGlobal *glob, unsigned int trackNumber, + int flagLacing, const char *codecId, + unsigned int pixelWidth, unsigned int pixelHeight, double frameRate) { EbmlLoc start; Ebml_StartSubElement(glob, &start, TrackEntry); @@ -74,8 +75,9 @@ void writeVideoTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing, } Ebml_EndSubElement(glob, &start); // Track Entry } -void writeAudioTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing, - char *codecId, double samplingFrequency, unsigned int channels, +void writeAudioTrack(EbmlGlobal *glob, unsigned int trackNumber, + int flagLacing, const char *codecId, + double samplingFrequency, unsigned int channels, unsigned char *private, unsigned long privateSize) { EbmlLoc start; Ebml_StartSubElement(glob, &start, TrackEntry); diff --git a/third_party/libmkv/WebMElement.h b/third_party/libmkv/WebMElement.h index dd6e50590..0e5ec2036 100644 --- a/third_party/libmkv/WebMElement.h +++ b/third_party/libmkv/WebMElement.h @@ -12,19 +12,21 @@ // these are helper functions void writeHeader(EbmlGlobal *ebml); -void writeSegmentInformation(EbmlGlobal *ebml, EbmlLoc *startInfo, unsigned long timeCodeScale, double duration); +void writeSegmentInformation(EbmlGlobal *ebml, EbmlLoc *startInfo, + unsigned long timeCodeScale, double duration); // this function is a helper only, it assumes a lot of defaults -void writeVideoTrack(EbmlGlobal *ebml, unsigned int trackNumber, int flagLacing, - char *codecId, unsigned int pixelWidth, unsigned int pixelHeight, +void writeVideoTrack(EbmlGlobal *ebml, unsigned int trackNumber, + int flagLacing, const char *codecId, + unsigned int pixelWidth, unsigned int pixelHeight, double frameRate); -void writeAudioTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing, - char *codecId, double samplingFrequency, unsigned int channels, +void writeAudioTrack(EbmlGlobal *glob, unsigned int trackNumber, + int flagLacing, const char *codecId, + double samplingFrequency, unsigned int channels, unsigned char *private, unsigned long privateSize); -void writeSimpleBlock(EbmlGlobal *ebml, unsigned char trackNumber, short timeCode, - int isKeyframe, unsigned char lacingFlag, int discardable, +void writeSimpleBlock(EbmlGlobal *ebml, unsigned char trackNumber, + short timeCode, int isKeyframe, + unsigned char lacingFlag, int discardable, unsigned char *data, unsigned long dataLength); - - -#endif \ No newline at end of file +#endif -- 2.40.0