10
10
#include "ngx_rtmp_relay_module.h"
11
11
#include "ngx_rtmp_notify_module.h"
12
12
#include "ngx_rtmp_bandwidth.h"
13
- #include "ngx_rtmp_gop_cache_module.h"
14
13
15
14
16
15
static ngx_rtmp_play_pt next_play ;
@@ -28,6 +27,8 @@ static void ngx_http_flv_live_cleanup(void *data);
28
27
static ngx_int_t ngx_http_flv_live_init_process (ngx_cycle_t * cycle );
29
28
30
29
static void ngx_http_flv_live_send_tail (ngx_rtmp_session_t * s );
30
+ static ngx_int_t ngx_http_flv_live_send_message (ngx_rtmp_session_t * s ,
31
+ ngx_chain_t * out , ngx_uint_t priority );
31
32
static ngx_chain_t * ngx_http_flv_live_meta_message (ngx_rtmp_session_t * ,
32
33
ngx_chain_t * in );
33
34
static ngx_chain_t * ngx_http_flv_live_append_message (ngx_rtmp_session_t * s ,
@@ -951,10 +952,6 @@ ngx_http_flv_live_send_message(ngx_rtmp_session_t *s,
951
952
"flv live: HTTP drop message bufs='%ui', priority='%ui'" ,
952
953
nmsg , priority );
953
954
954
- if (s -> gop_cache .out [s -> out_last ].set ) {
955
- ngx_rtmp_gop_cache_exec_handler (s , s -> out_last , out );
956
- }
957
-
958
955
return NGX_AGAIN ;
959
956
}
960
957
@@ -1544,14 +1541,8 @@ ngx_http_flv_live_write_handler(ngx_event_t *wev)
1544
1541
if (s -> out_bpos == s -> out_chain -> buf -> last ) {
1545
1542
s -> out_chain = s -> out_chain -> next ;
1546
1543
if (s -> out_chain == NULL ) {
1547
- if (s -> gop_cache .out [s -> out_pos ].set ) {
1548
- ngx_rtmp_gop_cache_exec_handler (s , s -> out_pos ,
1549
- s -> out [s -> out_pos ]);
1550
- } else {
1551
- cscf = ngx_rtmp_get_module_srv_conf (s ,
1552
- ngx_rtmp_core_module );
1553
- ngx_rtmp_free_shared_chain (cscf , s -> out [s -> out_pos ]);
1554
- }
1544
+ cscf = ngx_rtmp_get_module_srv_conf (s , ngx_rtmp_core_module );
1545
+ ngx_rtmp_free_shared_chain (cscf , s -> out [s -> out_pos ]);
1555
1546
s -> out [s -> out_pos ] = NULL ;
1556
1547
++ s -> out_pos ;
1557
1548
s -> out_pos %= s -> out_queue ;
@@ -1876,15 +1867,6 @@ ngx_http_flv_live_init_session(ngx_http_request_t *r,
1876
1867
return NULL ;
1877
1868
}
1878
1869
1879
- s -> gop_cache .out = ngx_pcalloc (s -> out_pool ,
1880
- sizeof (ngx_rtmp_gop_cache_free_t )
1881
- * ((ngx_rtmp_core_srv_conf_t * )
1882
- addr_conf -> default_server -> ctx -> srv_conf
1883
- [ngx_rtmp_core_module .ctx_index ])-> out_queue );
1884
- if (s -> gop_cache .out == NULL ) {
1885
- return NULL ;
1886
- }
1887
-
1888
1870
s -> in_streams_pool = ngx_create_pool (4096 , c -> log );
1889
1871
if (s -> in_streams_pool == NULL ) {
1890
1872
return NULL ;
@@ -1907,7 +1889,6 @@ ngx_http_flv_live_init_session(ngx_http_request_t *r,
1907
1889
s -> epoch = ngx_current_msec ;
1908
1890
s -> timeout = cscf -> timeout ;
1909
1891
s -> buflen = cscf -> buflen ;
1910
- s -> gop_cache .count = 0 ;
1911
1892
ngx_rtmp_set_chunk_size (s , NGX_RTMP_DEFAULT_CHUNK_SIZE );
1912
1893
1913
1894
if (ngx_rtmp_fire_event (s , NGX_RTMP_CONNECT , NULL , NULL ) != NGX_OK ) {
@@ -2201,9 +2182,7 @@ ngx_http_flv_live_close_session_handler(ngx_rtmp_session_t *s)
2201
2182
}
2202
2183
2203
2184
while (s -> out_pos != s -> out_last ) {
2204
- if (!s -> gop_cache .out [s -> out_pos ].set ) {
2205
- ngx_rtmp_free_shared_chain (cscf , s -> out [s -> out_pos ]);
2206
- }
2185
+ ngx_rtmp_free_shared_chain (cscf , s -> out [s -> out_pos ]);
2207
2186
2208
2187
s -> out_pos ++ ;
2209
2188
s -> out_pos %= s -> out_queue ;
0 commit comments