X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffplay.c;h=6a4b9d91566f83c32391dd0b9a5ee7c426a76e57;hb=148ffcd2ce116cadb0efdbacc358851222c808d0;hp=3cd3c3fdf7d27589864550a89c788853e4a3e1f5;hpb=0665199e438fcdd2000717352fc665a8cf017f7c;p=ffmpeg diff --git a/ffplay.c b/ffplay.c index 3cd3c3fdf7d..6a4b9d91566 100644 --- a/ffplay.c +++ b/ffplay.c @@ -692,10 +692,10 @@ static void video_image_display(VideoState *is) vp = &is->pictq[is->pictq_rindex]; if (vp->bmp) { #if CONFIG_AVFILTER - if (vp->picref->video->pixel_aspect.num == 0) + if (vp->picref->video->sample_aspect_ratio.num == 0) aspect_ratio = 0; else - aspect_ratio = av_q2d(vp->picref->video->pixel_aspect); + aspect_ratio = av_q2d(vp->picref->video->sample_aspect_ratio); #else /* XXX: use variable in the frame */ @@ -1381,7 +1381,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_ #if defined(DEBUG_SYNC) && 0 printf("frame_type=%c clock=%0.3f pts=%0.3f\n", - av_get_pict_type_char(src_frame->pict_type), pts, pts1); + av_get_picture_type_char(src_frame->pict_type), pts, pts1); #endif /* wait until we have space to put a new picture */ @@ -1687,8 +1687,8 @@ static int input_request_frame(AVFilterLink *link) av_free_packet(&pkt); picref->pts = pts; - picref->pos = pkt.pos; - picref->video->pixel_aspect = priv->is->video_st->codec->sample_aspect_ratio; + picref->pos = priv->frame->pkt_pos; + picref->video->sample_aspect_ratio = priv->frame->sample_aspect_ratio; avfilter_start_frame(link, picref); avfilter_draw_slice(link, 0, link->h, 1); avfilter_end_frame(link); @@ -2381,10 +2381,18 @@ static int read_thread(void *arg) ap->height= frame_height; ap->time_base= (AVRational){1, 25}; ap->pix_fmt = frame_pix_fmt; + ic->flags |= AVFMT_FLAG_PRIV_OPT; - set_context_opts(ic, avformat_opts, AV_OPT_FLAG_DECODING_PARAM, NULL); err = av_open_input_file(&ic, is->filename, is->iformat, 0, ap); + if (err >= 0) { + set_context_opts(ic, avformat_opts, AV_OPT_FLAG_DECODING_PARAM, NULL); + err = av_demuxer_open(ic, ap); + if(err < 0){ + avformat_free_context(ic); + ic= NULL; + } + } if (err < 0) { print_error(is->filename, err); ret = -1;