summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2012-06-06 22:32:25 +0200
committerMarton Balint <cus@passwd.hu>2012-06-07 01:22:00 +0200
commite85df18d7495ac2816c090a9421f60055e4e59c9 (patch)
treee36cf0af87442d7e75d1ebc05bf27f321dca709e /ffplay.c
parentcd947e9a2bc37f5af7a1dda90a7bc62b7f9019e7 (diff)
ffplay: add support for changing pixel format
With the filtering code refactored, it was much easier to finally fix this. Fixes ticket 123 and 238. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index f22a848079..86e347f131 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1648,6 +1648,7 @@ static int video_thread(void *arg)
AVFilterContext *filt_out = NULL, *filt_in = NULL;
int last_w = is->video_st->codec->width;
int last_h = is->video_st->codec->height;
+ enum PixelFormat last_format = is->video_st->codec->pix_fmt;
if ((ret = configure_video_filters(graph, is, vfilters)) < 0) {
SDL_Event event;
@@ -1684,7 +1685,8 @@ static int video_thread(void *arg)
#if CONFIG_AVFILTER
if ( last_w != is->video_st->codec->width
- || last_h != is->video_st->codec->height) {
+ || last_h != is->video_st->codec->height
+ || last_format != is->video_st->codec->pix_fmt) {
av_log(NULL, AV_LOG_INFO, "Frame changed from size:%dx%d to size:%dx%d\n",
last_w, last_h, is->video_st->codec->width, is->video_st->codec->height);
avfilter_graph_free(&graph);
@@ -1697,6 +1699,7 @@ static int video_thread(void *arg)
filt_out = is->out_video_filter;
last_w = is->video_st->codec->width;
last_h = is->video_st->codec->height;
+ last_format = is->video_st->codec->pix_fmt;
}
frame->pts = pts_int;