1010#include "ngx_rtmp_relay_module.h"
1111#include "ngx_rtmp_notify_module.h"
1212#include "ngx_rtmp_bandwidth.h"
13- #include "ngx_rtmp_gop_cache_module.h"
1413
1514
1615static ngx_rtmp_play_pt next_play ;
@@ -28,6 +27,8 @@ static void ngx_http_flv_live_cleanup(void *data);
2827static ngx_int_t ngx_http_flv_live_init_process (ngx_cycle_t * cycle );
2928
3029static 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 );
3132static ngx_chain_t * ngx_http_flv_live_meta_message (ngx_rtmp_session_t * ,
3233 ngx_chain_t * in );
3334static 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,
951952 "flv live: HTTP drop message bufs='%ui', priority='%ui'" ,
952953 nmsg , priority );
953954
954- if (s -> gop_cache .out [s -> out_last ].set ) {
955- ngx_rtmp_gop_cache_exec_handler (s , s -> out_last , out );
956- }
957-
958955 return NGX_AGAIN ;
959956 }
960957
@@ -1544,14 +1541,8 @@ ngx_http_flv_live_write_handler(ngx_event_t *wev)
15441541 if (s -> out_bpos == s -> out_chain -> buf -> last ) {
15451542 s -> out_chain = s -> out_chain -> next ;
15461543 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 ]);
15551546 s -> out [s -> out_pos ] = NULL ;
15561547 ++ s -> out_pos ;
15571548 s -> out_pos %= s -> out_queue ;
@@ -1876,15 +1867,6 @@ ngx_http_flv_live_init_session(ngx_http_request_t *r,
18761867 return NULL ;
18771868 }
18781869
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-
18881870 s -> in_streams_pool = ngx_create_pool (4096 , c -> log );
18891871 if (s -> in_streams_pool == NULL ) {
18901872 return NULL ;
@@ -1907,7 +1889,6 @@ ngx_http_flv_live_init_session(ngx_http_request_t *r,
19071889 s -> epoch = ngx_current_msec ;
19081890 s -> timeout = cscf -> timeout ;
19091891 s -> buflen = cscf -> buflen ;
1910- s -> gop_cache .count = 0 ;
19111892 ngx_rtmp_set_chunk_size (s , NGX_RTMP_DEFAULT_CHUNK_SIZE );
19121893
19131894 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)
22012182 }
22022183
22032184 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 ]);
22072186
22082187 s -> out_pos ++ ;
22092188 s -> out_pos %= s -> out_queue ;
0 commit comments