[FFmpeg-cvslog] img2enc: ensure that the codec is rawvideo for split planes mode.

Michael Niedermayer git at videolan.org
Tue Nov 6 01:32:34 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Nov  6 01:13:12 2012 +0100| [6dfcc7abdd5c5c312521c0d030bfc7290847d1c3] | committer: Michael Niedermayer

img2enc: ensure that the codec is rawvideo for split planes mode.

Found-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6dfcc7abdd5c5c312521c0d030bfc7290847d1c3
---

 libavformat/img2enc.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index dea4572..c485569 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -41,6 +41,7 @@ typedef struct {
 static int write_header(AVFormatContext *s)
 {
     VideoMuxData *img = s->priv_data;
+    AVStream *st = s->streams[0];
     const char *str;
 
     av_strlcpy(img->path, s->filename, sizeof(img->path));
@@ -52,7 +53,10 @@ static int write_header(AVFormatContext *s)
         img->is_pipe = 1;
 
     str = strrchr(img->path, '.');
-    img->split_planes = str && !av_strcasecmp(str + 1, "y");
+    img->split_planes =     str
+                         && !av_strcasecmp(str + 1, "y")
+                         && s->nb_streams == 1
+                         && st->codec->codec_id == AV_CODEC_ID_RAWVIDEO;
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list