-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fire trackinfo for audio only transmuxers #277
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,11 +165,7 @@ var aacPipeline = function(options) { | |
pipeline = { | ||
type: 'aac', | ||
tracks: { | ||
audio: { | ||
timelineStartInfo: { | ||
baseMediaDecodeTime: options.baseMediaDecodeTime | ||
} | ||
} | ||
audio: null | ||
}, | ||
metadataStream: new m2ts.MetadataStream(), | ||
aacStream: new AacStream(), | ||
|
@@ -197,9 +193,9 @@ var aacPipeline = function(options) { | |
return; | ||
} | ||
|
||
pipeline.tracks.audio = { | ||
pipeline.tracks.audio = pipeline.tracks.audio || { | ||
timelineStartInfo: { | ||
baseMediaDecodeTime: pipeline.tracks.audio.timelineStartInfo.baseMediaDecodeTime | ||
baseMediaDecodeTime: options.baseMediaDecodeTime | ||
}, | ||
codec: 'adts', | ||
type: 'audio' | ||
|
@@ -208,19 +204,13 @@ var aacPipeline = function(options) { | |
// hook up the audio segment stream to the first track with aac data | ||
pipeline.audioSegmentStream = new AudioSegmentStream(pipeline.tracks.audio, options); | ||
|
||
pipeline.audioSegmentStream.on('timingInfo', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We were firing audioTimingInfo twice, woops |
||
pipeline.trigger.bind(pipeline, 'audioTimingInfo')); | ||
|
||
// Set up the final part of the audio pipeline | ||
pipeline.adtsStream | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move the actual pipe below listener definitions just in case. |
||
.pipe(pipeline.audioSegmentStream); | ||
|
||
pipeline.audioSegmentStream.on('data', function(data) { | ||
pipeline.trigger('data', { | ||
type: 'audio', | ||
data: data | ||
}); | ||
}); | ||
|
||
pipeline.audioSegmentStream.on('partialdone', | ||
pipeline.trigger.bind(pipeline, 'partialdone')); | ||
pipeline.audioSegmentStream.on('done', pipeline.trigger.bind(pipeline, 'done')); | ||
|
@@ -229,6 +219,14 @@ var aacPipeline = function(options) { | |
pipeline.audioSegmentStream.on('timingInfo', | ||
pipeline.trigger.bind(pipeline, 'audioTimingInfo')); | ||
|
||
// Set up the final part of the audio pipeline | ||
pipeline.adtsStream | ||
.pipe(pipeline.audioSegmentStream); | ||
|
||
pipeline.trigger('trackinfo', { | ||
hasAudio: !!pipeline.tracks.audio, | ||
hasVideo: !!pipeline.tracks.video | ||
}); | ||
}); | ||
|
||
// set the pipeline up as a stream before binding to get access to the trigger function | ||
|
@@ -266,6 +264,7 @@ var Transmuxer = function(options) { | |
hasFlushed = true; | ||
|
||
Transmuxer.prototype.init.call(this); | ||
options.baseMediaDecodeTime = options.baseMediaDecodeTime || 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this baseMediaDecodeTime defaults to undefined, which is weird. |
||
|
||
this.push = function(bytes) { | ||
if (hasFlushed) { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this more like the non-partial transmuxer.