Browse code

ffplay: fix another use of context instead of frame parameters

Fixes Ticket2050

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/12/22 05:46:18
Showing 1 changed files
... ...
@@ -1719,7 +1719,7 @@ fail:
1719 1719
     return ret;
1720 1720
 }
1721 1721
 
1722
-static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const char *vfilters)
1722
+static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const char *vfilters, AVFrame *frame)
1723 1723
 {
1724 1724
     static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE };
1725 1725
     char sws_flags_str[128];
... ...
@@ -1737,7 +1737,7 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
1737 1737
 
1738 1738
     snprintf(buffersrc_args, sizeof(buffersrc_args),
1739 1739
              "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
1740
-             codec->width, codec->height, codec->pix_fmt,
1740
+             frame->width, frame->height, frame->format,
1741 1741
              is->video_st->time_base.num, is->video_st->time_base.den,
1742 1742
              codec->sample_aspect_ratio.num, FFMAX(codec->sample_aspect_ratio.den, 1));
1743 1743
 
... ...
@@ -1828,7 +1828,7 @@ static int video_thread(void *arg)
1828 1828
                    last_w, last_h, frame->width, frame->height);
1829 1829
             avfilter_graph_free(&graph);
1830 1830
             graph = avfilter_graph_alloc();
1831
-            if ((ret = configure_video_filters(graph, is, vfilters)) < 0) {
1831
+            if ((ret = configure_video_filters(graph, is, vfilters, frame)) < 0) {
1832 1832
                 SDL_Event event;
1833 1833
                 event.type = FF_QUIT_EVENT;
1834 1834
                 event.user.data1 = is;