get_packetheader(nut, bc); #if 0 if (((tmp & 0x60)>>5) > 3)  av_log(s, AV_LOG_ERROR, "sanity check failed!\n"); #endif id = get_v(bc); if ((tmp & 0x8) >> 3) pts = get_v(bc) << nut->msb_timestamp_shift[id]; pts += get_v(bc);
flags= nut->frame_code[frame_code].flags; size_mul= nut->frame_code[frame_code].size_mul; size_lsb= nut->frame_code[frame_code].size_lsb; stream_id= nut->frame_code[frame_code].stream_id_plus1 - 1;  if(flags & FLAG_FRAME_TYPE){ reset(s); if(frame_type==2){ get_packetheader(nut, bc, 8+1); }else{ get_packetheader(nut, bc, 1); frame_type= 1; } }  if(stream_id==-1) stream_id= get_v(bc); if(stream_id >= s->nb_streams){ av_log(s, AV_LOG_ERROR, "illegal stream_id\n"); return -1; } stream= &nut->stream[stream_id];
static int nut_read_packet(AVFormatContext *s, AVPacket *pkt){    NUTContext *nut = s->priv_data;    ByteIOContext *bc = &s->pb;    int id, size;    int key_frame = 0;    uint64_t tmp;    int64_t pts = 0;    if (url_feof(bc))	return -1;        tmp = get_byte(bc);    if (tmp & 0x80) /* zero bit set? */    {	tmp<<=8 ; tmp |= get_byte(bc);	tmp<<=16; tmp |= get_be16(bc);	tmp<<=32; tmp |= get_be32(bc);	if (tmp == KEYFRAME_STARTCODE)	{	    key_frame = 1;	    tmp = get_byte(bc); /* flags */	}	else	    av_log(s, AV_LOG_ERROR, "error in zero bit / startcode %LX\n", tmp);    }    get_packetheader(nut, bc);#if 0    if (((tmp & 0x60)>>5) > 3) /* priority <= 3 */	av_log(s, AV_LOG_ERROR, "sanity check failed!\n");#endif    id = get_v(bc);    if ((tmp & 0x8) >> 3)	pts = get_v(bc) << nut->msb_timestamp_shift[id];    pts += get_v(bc);        size = (nut->curr_frame_size - (url_ftell(bc)-nut->curr_frame_start));    dprintf("flags: 0x%llx, timestamp: %llx, packet size: %d\n", tmp, pts, size);        if (size < 0)	return -1;    av_new_packet(pkt, size);    get_buffer(bc, pkt->data, size);    pkt->stream_index = id;    if (key_frame)	pkt->flags |= PKT_FLAG_KEY;    pkt->pts = pts;    return 0;}