mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
Revert "avcodec/h264: remove redundant and bogus get_format call"
This reverts commit be583c6fd3a6f06844b56619653b9b0e4561870d. This was not approved, and was accidentally pushed. I'm very sorry.
This commit is contained in:
parent
cdf4a13f86
commit
17fe18d21a
@ -1129,6 +1129,17 @@ fail:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static enum AVPixelFormat non_j_pixfmt(enum AVPixelFormat a)
|
||||||
|
{
|
||||||
|
switch (a) {
|
||||||
|
case AV_PIX_FMT_YUVJ420P: return AV_PIX_FMT_YUV420P;
|
||||||
|
case AV_PIX_FMT_YUVJ422P: return AV_PIX_FMT_YUV422P;
|
||||||
|
case AV_PIX_FMT_YUVJ444P: return AV_PIX_FMT_YUV444P;
|
||||||
|
default:
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode a slice header.
|
* Decode a slice header.
|
||||||
* This will (re)intialize the decoder and call h264_frame_start() as needed.
|
* This will (re)intialize the decoder and call h264_frame_start() as needed.
|
||||||
@ -1312,6 +1323,9 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
|
|||||||
|| h->mb_width != h->sps.mb_width
|
|| h->mb_width != h->sps.mb_width
|
||||||
|| h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
|
|| h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
|
||||||
));
|
));
|
||||||
|
if (h->avctx->pix_fmt == AV_PIX_FMT_NONE
|
||||||
|
|| (non_j_pixfmt(h->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h, 0))))
|
||||||
|
must_reinit = 1;
|
||||||
|
|
||||||
if (first_slice && av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio))
|
if (first_slice && av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio))
|
||||||
must_reinit = 1;
|
must_reinit = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user