]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Fail and print correct error message when video stream pixel format
authorbcoudurier <bcoudurier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 12 Jun 2009 08:15:37 +0000 (08:15 +0000)
committerbcoudurier <bcoudurier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 12 Jun 2009 08:15:37 +0000 (08:15 +0000)
is unknown.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19164 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

ffmpeg.c

index 1c734c3f846da65b5f23c102eae1c0b651a7ce39..dcba31f17a22f82ca7a40eca760b3dd472bc0408 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1818,6 +1818,10 @@ static int av_encode(AVFormatContext **output_files,
                 ost->encoding_needed = 1;
                 break;
             case CODEC_TYPE_VIDEO:
+                if (ost->st->codec->pix_fmt == PIX_FMT_NONE) {
+                    fprintf(stderr, "Video pixel format is unknown, stream cannot be decoded\n");
+                    av_exit(1);
+                }
                 ost->video_crop = ((frame_leftBand + frame_rightBand + frame_topBand + frame_bottomBand) != 0);
                 ost->video_pad = ((frame_padleft + frame_padright + frame_padtop + frame_padbottom) != 0);
                 ost->video_resample = ((codec->width != icodec->width -