diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-01 17:08:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-01 17:16:08 +0200 |
commit | 758f929d212dd9feb7d40833e96c22018e4d4412 (patch) | |
tree | da3ed1fb5aadf7575f78e2b8e968b1b951a73a03 /ffmpeg_filter.c | |
parent | 00dcb1063110fc417f4e98b3dad3479ed9d35eef (diff) | |
download | ffmpeg-758f929d212dd9feb7d40833e96c22018e4d4412.tar.gz |
ffmpeg: Fix choose_pixel_fmt() so it uses the correct encoding context
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg_filter.c')
-rw-r--r-- | ffmpeg_filter.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c index 25d925a231..50ee422c6c 100644 --- a/ffmpeg_filter.c +++ b/ffmpeg_filter.c @@ -37,7 +37,7 @@ #include "libavutil/imgutils.h" #include "libavutil/samplefmt.h" -enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFormat target) +enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, AVCodec *codec, enum AVPixelFormat target) { if (codec && codec->pix_fmts) { const enum AVPixelFormat *p = codec->pix_fmts; @@ -50,10 +50,10 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE }; - if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) { - if (st->codec->codec_id == AV_CODEC_ID_MJPEG) { + if (enc_ctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) { + if (enc_ctx->codec_id == AV_CODEC_ID_MJPEG) { p = mjpeg_formats; - } else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) { + } else if (enc_ctx->codec_id == AV_CODEC_ID_LJPEG) { p =ljpeg_formats; } } @@ -113,7 +113,7 @@ static char *choose_pix_fmts(OutputStream *ost) return av_strdup(av_get_pix_fmt_name(ost->enc_ctx->pix_fmt)); } if (ost->enc_ctx->pix_fmt != AV_PIX_FMT_NONE) { - return av_strdup(av_get_pix_fmt_name(choose_pixel_fmt(ost->st, ost->enc, ost->enc_ctx->pix_fmt))); + return av_strdup(av_get_pix_fmt_name(choose_pixel_fmt(ost->st, ost->enc_ctx, ost->enc, ost->enc_ctx->pix_fmt))); } else if (ost->enc && ost->enc->pix_fmts) { const enum AVPixelFormat *p; AVIOContext *s = NULL; |