1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update components

Conflicts:
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/.bower.json
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/CHANGELOG.md
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/LICENSE
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/components.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/components/prism-core.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/components/prism-core.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/components/prism-jsx.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/components/prism-jsx.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/package.json
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/file-highlight/prism-file-highlight.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/file-highlight/prism-file-highlight.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-invisibles/prism-show-invisibles.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-invisibles/prism-show-invisibles.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-invisibles/prism-show-invisibles.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-language/prism-show-language.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-language/prism-show-language.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-language/prism-show-language.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/wpd/prism-wpd.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/wpd/prism-wpd.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/prism.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-coy.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-dark.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-funky.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-okaidia.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-tomorrow.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-twilight.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism.css
This commit is contained in:
Luke Pulverenti 2016-02-03 18:00:01 -05:00
parent df4c86218e
commit be5906a13e
54 changed files with 570 additions and 641 deletions

View file

@ -16,11 +16,11 @@ import ID3 from '../demux/id3';
static probe(data) {
// check if data contains ID3 timestamp and ADTS sync worc
var id3 = new ID3(data), adtsStartOffset,len;
var id3 = new ID3(data), offset,len;
if(id3.hasTimeStamp) {
// look for ADTS header (0xFFFx)
for (adtsStartOffset = id3.length, len = data.length; adtsStartOffset < len - 1; adtsStartOffset++) {
if ((data[adtsStartOffset] === 0xff) && (data[adtsStartOffset+1] & 0xf0) === 0xf0) {
for (offset = id3.length, len = data.length; offset < len - 1; offset++) {
if ((data[offset] === 0xff) && (data[offset+1] & 0xf0) === 0xf0) {
//logger.log('ADTS sync word found !');
return true;
}
@ -35,46 +35,47 @@ import ID3 from '../demux/id3';
var track = this._aacTrack,
id3 = new ID3(data),
pts = 90*id3.timeStamp,
config, adtsFrameSize, adtsStartOffset, adtsHeaderLen, stamp, nbSamples, len, aacSample;
config, frameLength, frameDuration, frameIndex, offset, headerLength, stamp, len, aacSample;
// look for ADTS header (0xFFFx)
for (adtsStartOffset = id3.length, len = data.length; adtsStartOffset < len - 1; adtsStartOffset++) {
if ((data[adtsStartOffset] === 0xff) && (data[adtsStartOffset+1] & 0xf0) === 0xf0) {
for (offset = id3.length, len = data.length; offset < len - 1; offset++) {
if ((data[offset] === 0xff) && (data[offset+1] & 0xf0) === 0xf0) {
break;
}
}
if (!track.audiosamplerate) {
config = ADTS.getAudioConfig(this.observer,data, adtsStartOffset, audioCodec);
config = ADTS.getAudioConfig(this.observer,data, offset, audioCodec);
track.config = config.config;
track.audiosamplerate = config.samplerate;
track.channelCount = config.channelCount;
track.codec = config.codec;
track.timescale = this.remuxer.timescale;
track.duration = this.remuxer.timescale * duration;
track.timescale = config.samplerate;
track.duration = config.samplerate * duration;
logger.log(`parsed codec:${track.codec},rate:${config.samplerate},nb channel:${config.channelCount}`);
}
nbSamples = 0;
while ((adtsStartOffset + 5) < len) {
frameIndex = 0;
frameDuration = 1024 * 90000 / track.audiosamplerate;
while ((offset + 5) < len) {
// The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header
headerLength = (!!(data[offset + 1] & 0x01) ? 7 : 9);
// retrieve frame size
adtsFrameSize = ((data[adtsStartOffset + 3] & 0x03) << 11);
// byte 4
adtsFrameSize |= (data[adtsStartOffset + 4] << 3);
// byte 5
adtsFrameSize |= ((data[adtsStartOffset + 5] & 0xE0) >>> 5);
adtsHeaderLen = (!!(data[adtsStartOffset + 1] & 0x01) ? 7 : 9);
adtsFrameSize -= adtsHeaderLen;
stamp = Math.round(pts + nbSamples * 1024 * 90000 / track.audiosamplerate);
frameLength = ((data[offset + 3] & 0x03) << 11) |
(data[offset + 4] << 3) |
((data[offset + 5] & 0xE0) >>> 5);
frameLength -= headerLength;
//stamp = pes.pts;
//console.log('AAC frame, offset/length/pts:' + (adtsStartOffset+7) + '/' + adtsFrameSize + '/' + stamp.toFixed(0));
if ((adtsFrameSize > 0) && ((adtsStartOffset + adtsHeaderLen + adtsFrameSize) <= len)) {
aacSample = {unit: data.subarray(adtsStartOffset + adtsHeaderLen, adtsStartOffset + adtsHeaderLen + adtsFrameSize), pts: stamp, dts: stamp};
if ((frameLength > 0) && ((offset + headerLength + frameLength) <= len)) {
stamp = pts + frameIndex * frameDuration;
//logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);
aacSample = {unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp};
track.samples.push(aacSample);
track.len += adtsFrameSize;
adtsStartOffset += adtsFrameSize + adtsHeaderLen;
nbSamples++;
track.len += frameLength;
offset += frameLength + headerLength;
frameIndex++;
// look for ADTS header (0xFFFx)
for ( ; adtsStartOffset < (len - 1); adtsStartOffset++) {
if ((data[adtsStartOffset] === 0xff) && ((data[adtsStartOffset + 1] & 0xf0) === 0xf0)) {
for ( ; offset < (len - 1); offset++) {
if ((data[offset] === 0xff) && ((data[offset + 1] & 0xf0) === 0xf0)) {
break;
}
}