Commit 2c28e269 authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Marton Balint

ffplay: Check for pix_fmt changes Fixes Ticket238 by not crashing but also not playing the file.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent 2f0f9a87
......@@ -1562,7 +1562,10 @@ static int input_get_buffer(AVCodecContext *codec, AVFrame *pic)
edge = codec->flags & CODEC_FLAG_EMU_EDGE ? 0 : avcodec_get_edge_width();
w += edge << 1;
h += edge << 1;
if (codec->pix_fmt != ctx->outputs[0]->format) {
av_log(codec, AV_LOG_ERROR, "Pixel format mismatches %d %d\n", codec->pix_fmt, ctx->outputs[0]->format);
return -1;
}
if(!(ref = avfilter_get_video_buffer(ctx->outputs[0], perms, w, h)))
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment