aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-21 02:46:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-21 22:36:33 +0100
commit04220b473e9d7b22d737405348f9904f22bcfb96 (patch)
treee8942eea1f5d25864adfbc3e4a425b79c244b81e
parent8d8c59480e1bbffb290b0790a7af378447c7f1fd (diff)
downloadffmpeg-04220b473e9d7b22d737405348f9904f22bcfb96.tar.gz
h264: ensure that get_format() is called when changing format but not otherwise.
Fixes Ticket2288 Tested-by: Stefano Pigozzi <stefano.pigozzi@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 4f38379021..5e9e64f9cf 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;