packet queue handling */
| 470 | |
| 471 | /* packet queue handling */ |
| 472 | static int packet_queue_init(PacketQueue *q) |
| 473 | { |
| 474 | memset(q, 0, sizeof(PacketQueue)); |
| 475 | q->pkt_list = av_fifo_alloc2(1, sizeof(MyAVPacketList), AV_FIFO_FLAG_AUTO_GROW); |
| 476 | if (!q->pkt_list) |
| 477 | return AVERROR(ENOMEM); |
| 478 | q->mutex = SDL_CreateMutex(); |
| 479 | if (!q->mutex) { |
| 480 | av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError()); |
| 481 | return AVERROR(ENOMEM); |
| 482 | } |
| 483 | q->cond = SDL_CreateCond(); |
| 484 | if (!q->cond) { |
| 485 | av_log(NULL, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError()); |
| 486 | return AVERROR(ENOMEM); |
| 487 | } |
| 488 | q->abort_request = 1; |
| 489 | return 0; |
| 490 | } |
| 491 | |
| 492 | static void packet_queue_flush(PacketQueue *q) |
| 493 | { |
no test coverage detected