|
|
|
@ -117,6 +117,7 @@ typedef struct PacketQueue { |
|
|
|
|
MyAVPacketList *first_pkt, *last_pkt; |
|
|
|
|
int nb_packets; |
|
|
|
|
int size; |
|
|
|
|
int64_t duration; |
|
|
|
|
int abort_request; |
|
|
|
|
int serial; |
|
|
|
|
SDL_mutex *mutex; |
|
|
|
@ -417,6 +418,7 @@ static int packet_queue_put_private(PacketQueue *q, AVPacket *pkt) |
|
|
|
|
q->last_pkt = pkt1; |
|
|
|
|
q->nb_packets++; |
|
|
|
|
q->size += pkt1->pkt.size + sizeof(*pkt1); |
|
|
|
|
q->duration += pkt1->pkt.duration; |
|
|
|
|
/* XXX: should duplicate packet data in DV case */ |
|
|
|
|
SDL_CondSignal(q->cond); |
|
|
|
|
return 0; |
|
|
|
@ -478,6 +480,7 @@ static void packet_queue_flush(PacketQueue *q) |
|
|
|
|
q->first_pkt = NULL; |
|
|
|
|
q->nb_packets = 0; |
|
|
|
|
q->size = 0; |
|
|
|
|
q->duration = 0; |
|
|
|
|
SDL_UnlockMutex(q->mutex); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -528,6 +531,7 @@ static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block, int *seria |
|
|
|
|
q->last_pkt = NULL; |
|
|
|
|
q->nb_packets--; |
|
|
|
|
q->size -= pkt1->pkt.size + sizeof(*pkt1); |
|
|
|
|
q->duration -= pkt1->pkt.duration; |
|
|
|
|
*pkt = pkt1->pkt; |
|
|
|
|
if (serial) |
|
|
|
|
*serial = pkt1->serial; |
|
|
|
@ -2800,7 +2804,7 @@ static int stream_has_enough_packets(AVStream *st, int stream_id, PacketQueue *q |
|
|
|
|
return stream_id < 0 || |
|
|
|
|
queue->abort_request || |
|
|
|
|
(st->disposition & AV_DISPOSITION_ATTACHED_PIC) || |
|
|
|
|
queue->nb_packets > MIN_FRAMES; |
|
|
|
|
queue->nb_packets > MIN_FRAMES && (!queue->duration || av_q2d(st->time_base) * queue->duration > 1.0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static int is_realtime(AVFormatContext *s) |
|
|
|
|