Commit 6dfcc7ab authored by Michael Niedermayer's avatar Michael Niedermayer

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

Found-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 7f6f8f64
...@@ -41,6 +41,7 @@ typedef struct { ...@@ -41,6 +41,7 @@ typedef struct {
static int write_header(AVFormatContext *s) static int write_header(AVFormatContext *s)
{ {
VideoMuxData *img = s->priv_data; VideoMuxData *img = s->priv_data;
AVStream *st = s->streams[0];
const char *str; const char *str;
av_strlcpy(img->path, s->filename, sizeof(img->path)); av_strlcpy(img->path, s->filename, sizeof(img->path));
...@@ -52,7 +53,10 @@ static int write_header(AVFormatContext *s) ...@@ -52,7 +53,10 @@ static int write_header(AVFormatContext *s)
img->is_pipe = 1; img->is_pipe = 1;
str = strrchr(img->path, '.'); 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; return 0;
} }
......
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