| 1162 | } |
| 1163 | |
| 1164 | static AVBufferRef *buffer_pool_get(MpegTSContext *ts, int size) |
| 1165 | { |
| 1166 | int index = av_log2(size + AV_INPUT_BUFFER_PADDING_SIZE); |
| 1167 | if (!ts->pools[index]) { |
| 1168 | int pool_size = FFMIN(ts->max_packet_size + AV_INPUT_BUFFER_PADDING_SIZE, 2 << index); |
| 1169 | ts->pools[index] = av_buffer_pool_init(pool_size, NULL); |
| 1170 | if (!ts->pools[index]) |
| 1171 | return NULL; |
| 1172 | } |
| 1173 | return av_buffer_pool_get(ts->pools[index]); |
| 1174 | } |
| 1175 | |
| 1176 | /* return non zero if a packet could be constructed */ |
| 1177 | static int mpegts_push_data(MpegTSFilter *filter, |
no test coverage detected