[FFmpeg-cvslog] h264: ensure that get_format() is called when changing format but not otherwise.
Michael Niedermayer
git at videolan.org
Thu Feb 21 22:43:20 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Feb 21 02:46:02 2013 +0100| [04220b473e9d7b22d737405348f9904f22bcfb96] | committer: Michael Niedermayer
h264: ensure that get_format() is called when changing format but not otherwise.
Fixes Ticket2288
Tested-by: Stefano Pigozzi <stefano.pigozzi at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=04220b473e9d7b22d737405348f9904f22bcfb96
---
libavcodec/h264.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 4f38379..5e9e64f 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2852,7 +2852,7 @@ static int h264_set_parameter_from_sps(H264Context *h)
return 0;
}
-static enum PixelFormat get_pixel_format(H264Context *h)
+static enum PixelFormat get_pixel_format(H264Context *h, int force_callback)
{
switch (h->sps.bit_depth_luma) {
case 9:
@@ -2921,7 +2921,7 @@ static enum PixelFormat get_pixel_format(H264Context *h)
hwaccel_pixfmt_list_h264_420;
for (i=0; fmt[i] != AV_PIX_FMT_NONE; i++)
- if (fmt[i] == h->avctx->pix_fmt)
+ if (fmt[i] == h->avctx->pix_fmt && !force_callback)
return fmt[i];
return h->avctx->get_format(h->avctx, fmt);
}
@@ -3169,7 +3169,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|| h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma
|| h->cur_chroma_format_idc != h->sps.chroma_format_idc
|| av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio)));
- if (h0->avctx->pix_fmt != get_pixel_format(h0))
+ if (h0->avctx->pix_fmt != get_pixel_format(h0, 0))
must_reinit = 1;
h->mb_width = h->sps.mb_width;
@@ -3209,7 +3209,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
flush_change(h);
- if ((ret = get_pixel_format(h)) < 0)
+ if ((ret = get_pixel_format(h, 1)) < 0)
return ret;
h->avctx->pix_fmt = ret;
@@ -3229,7 +3229,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
return -1;
}
- if ((ret = get_pixel_format(h)) < 0)
+ if ((ret = get_pixel_format(h, 1)) < 0)
return ret;
h->avctx->pix_fmt = ret;
More information about the ffmpeg-cvslog
mailing list