| 1266 | } |
| 1267 | |
| 1268 | static int handle_packets(MpegTSContext *ts, int nb_packets) |
| 1269 | { |
| 1270 | AVFormatContext *s = ts->stream; |
| 1271 | uint8_t packet[TS_PACKET_SIZE]; |
| 1272 | int packet_num, ret; |
| 1273 | |
| 1274 | ts->stop_parse = 0; |
| 1275 | packet_num = 0; |
| 1276 | for(;;) { |
| 1277 | if (ts->stop_parse>0) |
| 1278 | break; |
| 1279 | packet_num++; |
| 1280 | if (nb_packets != 0 && packet_num >= nb_packets) |
| 1281 | break; |
| 1282 | ret = read_packet(s, packet, ts->raw_packet_size); |
| 1283 | if (ret != 0) |
| 1284 | return ret; |
| 1285 | ret = handle_packet(ts, packet); |
| 1286 | if (ret != 0) |
| 1287 | return ret; |
| 1288 | } |
| 1289 | return 0; |
| 1290 | } |
| 1291 | |
| 1292 | static int mpegts_probe(AVProbeData *p) |
| 1293 | { |
no test coverage detected