Ticket #1637: adaptive_audio_only.patch
| File adaptive_audio_only.patch, 3.7 KB (added by jeroen, 13 months ago) |
|---|
-
src/com/longtailvideo/adaptive/muxing/AAC.as
Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
15 15 public static const SYNCWORD_2:uint = 0xFFF9; 16 16 /** ADTS/ADIF sample rates index. **/ 17 17 public static const RATES:Array = 18 [96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025 ];18 [96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000]; 19 19 /** ADIF profile index (ADTS doesn't have Null). **/ 20 20 public static const PROFILES:Array = ['Null','Main','LC','SSR','LTP','SBR']; 21 21 -
src/com/longtailvideo/adaptive/muxing/TS.as
44 44 while(data.bytesAvailable) { 45 45 _readPacket(data); 46 46 } 47 if (_videoPES.length == 0 ||_audioPES.length == 0 ) {48 throw new Error("No AAC audio orAVC video stream found.");47 if (_videoPES.length == 0 && _audioPES.length == 0 ) { 48 throw new Error("No AAC audio and no AVC video stream found."); 49 49 } 50 50 // Extract the ADTS or MPEG audio frames. 51 51 if(_aacId > 0) { … … 71 71 /** Get video configuration data. **/ 72 72 public function getAVCC():ByteArray { 73 73 if(_firstKey == -1) { 74 throw new Error("Cannot parse stream: no keyframe found in TS fragment.");74 return new ByteArray(); 75 75 } 76 76 return AVC.getAVCC(_videoPES[_firstKey].data,_videoPES[_firstKey].payload); 77 77 }; -
src/com/longtailvideo/adaptive/streaming/Loader.as
124 124 } 125 125 // Push codecprivate tags only when switching. 126 126 if(_switched) { 127 var avccTag:Tag = new Tag(Tag.AVC_HEADER,ts.videoTags[0].stamp,true,_level,_fragment); 128 avccTag.push(_levels[_level].avcc,0,_levels[_level].avcc.length); 129 tags.push(avccTag); 127 if (ts.videoTags.length > 0) { 128 // Audio only file don't have videoTags[0] 129 var avccTag:Tag = new Tag(Tag.AVC_HEADER,ts.videoTags[0].stamp,true,_level,_fragment); 130 avccTag.push(_levels[_level].avcc,0,_levels[_level].avcc.length); 131 tags.push(avccTag); 132 } 130 133 if(ts.audioTags[0].type == Tag.AAC_RAW) { 131 134 var adifTag:Tag = new Tag(Tag.AAC_HEADER,ts.audioTags[0].stamp,true,_level,_fragment); 132 135 adifTag.push(_levels[_level].adif,0,2) … … 159 162 } 160 163 } 161 164 if(level == -1) { 162 _adaptive.dispatchEvent(new AdaptiveEvent(AdaptiveEvent.ERROR, 163 "None of the quality levels in this stream can be played."));165 Log.txt("No other quality levels are available"); 166 return; 164 167 } 165 168 // Then update with highest possible level. 166 169 for(var j:Number = _levels.length - 1; j > 0; j--) {
