1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

mpegvideo: Initialize chroma_*_shift and codec_tag even if the size is 0

This fixes breakage in a few fate tests on certain setups
(that for some reason didn't break on OS X) after the previous
commit (8812a8057). Currently, some video streams are initialized
in ff_MPV_common_init with width/height set at 0 and only changed
to a proper video size with ff_MPV_common_frame_size_change later.

The breakage was diagnosed by Anton Khirnov.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2013-09-24 12:02:39 +03:00
parent d6d27f3e58
commit 5f24fe82e5

View File

@ -1019,7 +1019,6 @@ av_cold int ff_MPV_common_init(MpegEncContext *s)
s->flags = s->avctx->flags;
s->flags2 = s->avctx->flags2;
if (s->width && s->height) {
/* set chroma shifts */
av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
&s->chroma_x_shift,
@ -1030,6 +1029,7 @@ av_cold int ff_MPV_common_init(MpegEncContext *s)
s->stream_codec_tag = avpriv_toupper4(s->avctx->stream_codec_tag);
if (s->width && s->height) {
s->avctx->coded_frame = &s->current_picture.f;
if (s->encoding) {