if (is->video_st->codec.codec_id == CODEC_ID_RAWVIDEO) { avpicture_fill((AVPicture *)frame, pkt->data, is->video_st->codec.pix_fmt, is->video_st->codec.width, is->video_st->codec.height); frame->pict_type = FF_I_TYPE; if (output_picture2(is, frame, pts) < 0) goto the_end; } else {
static int video_thread(void *arg){    VideoState *is = arg;    AVPacket pkt1, *pkt = &pkt1;    int len1, got_picture;    AVFrame *frame= avcodec_alloc_frame();    double pts;    for(;;) {        while (is->paused && !is->videoq.abort_request) {            SDL_Delay(10);        }        if (packet_queue_get(&is->videoq, pkt, 1) < 0)            break;        /* NOTE: ipts is the PTS of the _first_ picture beginning in           this packet, if any */        pts = 0;        if (pkt->dts != AV_NOPTS_VALUE)            pts = (double)pkt->dts / AV_TIME_BASE;        if (is->video_st->codec.codec_id == CODEC_ID_RAWVIDEO) {            avpicture_fill((AVPicture *)frame, pkt->data,                            is->video_st->codec.pix_fmt,                           is->video_st->codec.width,                           is->video_st->codec.height);            frame->pict_type = FF_I_TYPE;            if (output_picture2(is, frame, pts) < 0)                goto the_end;        } else {            len1 = avcodec_decode_video(&is->video_st->codec,                                         frame, &got_picture,                                         pkt->data, pkt->size);//            if (len1 < 0)//                break;            if (got_picture) {                if (output_picture2(is, frame, pts) < 0)                    goto the_end;            }        }        av_free_packet(pkt);        if (step)             if (cur_stream)                stream_pause(cur_stream);    } the_end:    av_free(frame);    return 0;}