Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | diff --git a/media/libmkv/WebMElement.c b/media/libmkv/WebMElement.c |
michael@0 | 2 | --- a/media/libmkv/WebMElement.c |
michael@0 | 3 | +++ b/media/libmkv/WebMElement.c |
michael@0 | 4 | @@ -52,32 +52,39 @@ static UInt64 generateTrackID(unsigned i |
michael@0 | 5 | r = r << 32; |
michael@0 | 6 | r += rand(); |
michael@0 | 7 | // UInt64 rval = t ^ r; |
michael@0 | 8 | return t ^ r; |
michael@0 | 9 | } |
michael@0 | 10 | |
michael@0 | 11 | void writeVideoTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing, |
michael@0 | 12 | const char *codecId, unsigned int pixelWidth, unsigned int pixelHeight, |
michael@0 | 13 | + unsigned int displayWidth, unsigned int displayHeight, |
michael@0 | 14 | double frameRate) { |
michael@0 | 15 | EbmlLoc start; |
michael@0 | 16 | UInt64 trackID; |
michael@0 | 17 | Ebml_StartSubElement(glob, &start, TrackEntry); |
michael@0 | 18 | Ebml_SerializeUnsigned(glob, TrackNumber, trackNumber); |
michael@0 | 19 | trackID = generateTrackID(trackNumber); |
michael@0 | 20 | Ebml_SerializeUnsigned(glob, TrackUID, trackID); |
michael@0 | 21 | Ebml_SerializeString(glob, CodecName, "VP8"); // TODO shouldn't be fixed |
michael@0 | 22 | |
michael@0 | 23 | Ebml_SerializeUnsigned(glob, TrackType, 1); // video is always 1 |
michael@0 | 24 | Ebml_SerializeString(glob, CodecID, codecId); |
michael@0 | 25 | { |
michael@0 | 26 | EbmlLoc videoStart; |
michael@0 | 27 | Ebml_StartSubElement(glob, &videoStart, Video); |
michael@0 | 28 | Ebml_SerializeUnsigned(glob, PixelWidth, pixelWidth); |
michael@0 | 29 | Ebml_SerializeUnsigned(glob, PixelHeight, pixelHeight); |
michael@0 | 30 | + if (pixelWidth != displayWidth) { |
michael@0 | 31 | + Ebml_SerializeUnsigned(glob, DisplayWidth, displayWidth); |
michael@0 | 32 | + } |
michael@0 | 33 | + if (pixelHeight != displayHeight) { |
michael@0 | 34 | + Ebml_SerializeUnsigned(glob, DisplayHeight, displayHeight); |
michael@0 | 35 | + } |
michael@0 | 36 | Ebml_SerializeFloat(glob, FrameRate, frameRate); |
michael@0 | 37 | Ebml_EndSubElement(glob, &videoStart); // Video |
michael@0 | 38 | } |
michael@0 | 39 | Ebml_EndSubElement(glob, &start); // Track Entry |
michael@0 | 40 | } |
michael@0 | 41 | void writeAudioTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing, |
michael@0 | 42 | const char *codecId, double samplingFrequency, unsigned int channels, |
michael@0 | 43 | unsigned char *private, unsigned long privateSize) { |
michael@0 | 44 | diff --git a/media/libmkv/WebMElement.h b/media/libmkv/WebMElement.h |
michael@0 | 45 | --- a/media/libmkv/WebMElement.h |
michael@0 | 46 | +++ b/media/libmkv/WebMElement.h |
michael@0 | 47 | @@ -16,16 +16,17 @@ extern "C" { |
michael@0 | 48 | #include "EbmlWriter.h" |
michael@0 | 49 | |
michael@0 | 50 | // these are helper functions |
michael@0 | 51 | void writeHeader(EbmlGlobal *ebml); |
michael@0 | 52 | void writeSegmentInformation(EbmlGlobal *ebml, EbmlLoc *startInfo, unsigned long timeCodeScale, double duration); |
michael@0 | 53 | // this function is a helper only, it assumes a lot of defaults |
michael@0 | 54 | void writeVideoTrack(EbmlGlobal *ebml, unsigned int trackNumber, int flagLacing, |
michael@0 | 55 | const char *codecId, unsigned int pixelWidth, unsigned int pixelHeight, |
michael@0 | 56 | + unsigned int displayWidth, unsigned int displayHeight, |
michael@0 | 57 | double frameRate); |
michael@0 | 58 | void writeAudioTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing, |
michael@0 | 59 | const char *codecId, double samplingFrequency, unsigned int channels, |
michael@0 | 60 | unsigned char *private_, unsigned long privateSize); |
michael@0 | 61 | |
michael@0 | 62 | void writeSimpleBlock(EbmlGlobal *ebml, unsigned char trackNumber, short timeCode, |
michael@0 | 63 | int isKeyframe, unsigned char lacingFlag, int discardable, |
michael@0 | 64 | unsigned char *data, unsigned long dataLength); |