You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
Merge commit 'd1f539c97e04e7cebecaf6916c5064f243d39fcf'
* commit 'd1f539c97e04e7cebecaf6916c5064f243d39fcf': h264: merge the two reinit blocks in slice_header_parse() Merged-by: Clément Bœsch <clement@stupeflix.com>
This commit is contained in:
@@ -1414,8 +1414,7 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (h->context_initialized &&
|
if (!h->context_initialized || must_reinit || needs_reinit) {
|
||||||
(must_reinit || needs_reinit)) {
|
|
||||||
h->context_initialized = 0;
|
h->context_initialized = 0;
|
||||||
if (sl != h->slice_ctx) {
|
if (sl != h->slice_ctx) {
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
@@ -1435,7 +1434,7 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
|
|||||||
return ret;
|
return ret;
|
||||||
h->avctx->pix_fmt = ret;
|
h->avctx->pix_fmt = ret;
|
||||||
|
|
||||||
av_log(h->avctx, AV_LOG_INFO, "Reinit context to %dx%d, "
|
av_log(h->avctx, AV_LOG_VERBOSE, "Reinit context to %dx%d, "
|
||||||
"pix_fmt: %s\n", h->width, h->height, av_get_pix_fmt_name(h->avctx->pix_fmt));
|
"pix_fmt: %s\n", h->width, h->height, av_get_pix_fmt_name(h->avctx->pix_fmt));
|
||||||
|
|
||||||
if ((ret = h264_slice_header_init(h)) < 0) {
|
if ((ret = h264_slice_header_init(h)) < 0) {
|
||||||
@@ -1444,23 +1443,6 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!h->context_initialized) {
|
|
||||||
if (sl != h->slice_ctx) {
|
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
|
||||||
"Cannot (re-)initialize context during parallel decoding.\n");
|
|
||||||
return AVERROR_PATCHWELCOME;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((ret = get_pixel_format(h, 1)) < 0)
|
|
||||||
return ret;
|
|
||||||
h->avctx->pix_fmt = ret;
|
|
||||||
|
|
||||||
if ((ret = h264_slice_header_init(h)) < 0) {
|
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
|
||||||
"h264_slice_header_init() failed\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
frame_num = get_bits(&sl->gb, sps->log2_max_frame_num);
|
frame_num = get_bits(&sl->gb, sps->log2_max_frame_num);
|
||||||
if (!first_slice) {
|
if (!first_slice) {
|
||||||
|
Reference in New Issue
Block a user