SDL_UnlockMutex(q->mutex);
static void packet_queue_flush(PacketQueue *q){    AVPacketList *pkt, *pkt1;    for(pkt = q->first_pkt; pkt != NULL; pkt = pkt1) {        pkt1 = pkt->next;        av_free_packet(&pkt->pkt);        av_freep(&pkt);    }    q->last_pkt = NULL;    q->first_pkt = NULL;    q->nb_packets = 0;    q->size = 0;}