fix bug, when disable all, some code of HLS must be exported.
正在显示
2 个修改的文件
包含
38 行增加
和
26 行删除
| @@ -23,6 +23,28 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -23,6 +23,28 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 23 | 23 | ||
| 24 | #include <srs_app_hls.hpp> | 24 | #include <srs_app_hls.hpp> |
| 25 | 25 | ||
| 26 | +/** | ||
| 27 | +* the public data, event HLS disable, others can use it. | ||
| 28 | +*/ | ||
| 29 | +// 0 = 5.5 kHz = 5512 Hz | ||
| 30 | +// 1 = 11 kHz = 11025 Hz | ||
| 31 | +// 2 = 22 kHz = 22050 Hz | ||
| 32 | +// 3 = 44 kHz = 44100 Hz | ||
| 33 | +int flv_sample_rates[] = {5512, 11025, 22050, 44100}; | ||
| 34 | + | ||
| 35 | +// the sample rates in the codec, | ||
| 36 | +// in the sequence header. | ||
| 37 | +int aac_sample_rates[] = | ||
| 38 | +{ | ||
| 39 | + 96000, 88200, 64000, 48000, | ||
| 40 | + 44100, 32000, 24000, 22050, | ||
| 41 | + 16000, 12000, 11025, 8000, | ||
| 42 | + 7350, 0, 0, 0 | ||
| 43 | +}; | ||
| 44 | + | ||
| 45 | +/** | ||
| 46 | +* the HLS section, only available when HLS enabled. | ||
| 47 | +*/ | ||
| 26 | #ifdef SRS_AUTO_HLS | 48 | #ifdef SRS_AUTO_HLS |
| 27 | 49 | ||
| 28 | #include <sys/types.h> | 50 | #include <sys/types.h> |
| @@ -76,22 +98,6 @@ using namespace std; | @@ -76,22 +98,6 @@ using namespace std; | ||
| 76 | // in ms, for HLS aac flush the audio | 98 | // in ms, for HLS aac flush the audio |
| 77 | #define SRS_CONF_DEFAULT_AAC_DELAY 100 | 99 | #define SRS_CONF_DEFAULT_AAC_DELAY 100 |
| 78 | 100 | ||
| 79 | -// 0 = 5.5 kHz = 5512 Hz | ||
| 80 | -// 1 = 11 kHz = 11025 Hz | ||
| 81 | -// 2 = 22 kHz = 22050 Hz | ||
| 82 | -// 3 = 44 kHz = 44100 Hz | ||
| 83 | -int flv_sample_rates[] = {5512, 11025, 22050, 44100}; | ||
| 84 | - | ||
| 85 | -// the sample rates in the codec, | ||
| 86 | -// in the sequence header. | ||
| 87 | -int aac_sample_rates[] = | ||
| 88 | -{ | ||
| 89 | - 96000, 88200, 64000, 48000, | ||
| 90 | - 44100, 32000, 24000, 22050, | ||
| 91 | - 16000, 12000, 11025, 8000, | ||
| 92 | - 7350, 0, 0, 0 | ||
| 93 | -}; | ||
| 94 | - | ||
| 95 | // @see: ngx_rtmp_mpegts_header | 101 | // @see: ngx_rtmp_mpegts_header |
| 96 | u_int8_t mpegts_header[] = { | 102 | u_int8_t mpegts_header[] = { |
| 97 | /* TS */ | 103 | /* TS */ |
| @@ -29,6 +29,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -29,6 +29,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 29 | */ | 29 | */ |
| 30 | #include <srs_core.hpp> | 30 | #include <srs_core.hpp> |
| 31 | 31 | ||
| 32 | +/** | ||
| 33 | +* the public data, event HLS disable, others can use it. | ||
| 34 | +*/ | ||
| 35 | +/** | ||
| 36 | +* the flv sample rate map | ||
| 37 | +*/ | ||
| 38 | +extern int flv_sample_rates[]; | ||
| 39 | + | ||
| 40 | +/** | ||
| 41 | +* the aac sample rate map | ||
| 42 | +*/ | ||
| 43 | +extern int aac_sample_rates[]; | ||
| 44 | + | ||
| 45 | +/** | ||
| 46 | +* the HLS section, only available when HLS enabled. | ||
| 47 | +*/ | ||
| 32 | #ifdef SRS_AUTO_HLS | 48 | #ifdef SRS_AUTO_HLS |
| 33 | 49 | ||
| 34 | #include <string> | 50 | #include <string> |
| @@ -48,16 +64,6 @@ class SrsSource; | @@ -48,16 +64,6 @@ class SrsSource; | ||
| 48 | class SrsFileWriter; | 64 | class SrsFileWriter; |
| 49 | 65 | ||
| 50 | /** | 66 | /** |
| 51 | -* the flv sample rate map | ||
| 52 | -*/ | ||
| 53 | -extern int flv_sample_rates[]; | ||
| 54 | - | ||
| 55 | -/** | ||
| 56 | -* the aac sample rate map | ||
| 57 | -*/ | ||
| 58 | -extern int aac_sample_rates[]; | ||
| 59 | - | ||
| 60 | -/** | ||
| 61 | * jitter correct for audio, | 67 | * jitter correct for audio, |
| 62 | * the sample rate 44100/32000 will lost precise, | 68 | * the sample rate 44100/32000 will lost precise, |
| 63 | * when mp4/ts(tbn=90000) covert to flv/rtmp(1000), | 69 | * when mp4/ts(tbn=90000) covert to flv/rtmp(1000), |
-
请 注册 或 登录 后发表评论