[FFmpeg-devel] [PATCH] ffplay: Check for pix_fmt changes Fixes Ticket238 by not crashing but also not playing the file.

Michael Niedermayer michaelni at gmx.at
Mon Nov 21 20:39:31 CET 2011


On Mon, Nov 21, 2011 at 08:23:34PM +0100, Marton Balint wrote:
> 
> On Sun, 20 Nov 2011, Michael Niedermayer wrote:
> 
> >Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> >---
> >ffplay.c |    5 ++++-
> >1 files changed, 4 insertions(+), 1 deletions(-)
> >
> >diff --git a/ffplay.c b/ffplay.c
> >index 46cf6a1..673f31d 100644
> >--- a/ffplay.c
> >+++ b/ffplay.c
> >@@ -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;
> >
> 
> Pushed to my stable branch, feel free to merge.

merged, thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111121/7f277952/attachment.asc>


More information about the ffmpeg-devel mailing list