History

Merge commit '1f29e5d7a2b0950f3b6820896e97e2c02e6a10a9'

* commit '1f29e5d7a2b0950f3b6820896e97e2c02e6a10a9': h263dec: call get_format after setting resolution and profile

Michael Niedermayer committed 12 years ago

Commit d3d265b2 parents f87134c 1f29e5d1 file · +12 −5Browse files

Unified · Split

libavcodec/h263dec.c+12−5
@@ -43,6 +43,14 @@ · 42 unmodified lines
4343 #include "vdpau_internal.h"
4444 #include "thread.h"
4545
46+static enum AVPixelFormat h263_get_format(AVCodecContext *avctx)
47+{
48+ if (avctx->codec->id == AV_CODEC_ID_MSS2)
49+ return AV_PIX_FMT_YUV420P;
50+
51+ return avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
52+}
53+
4654 av_cold int ff_h263_decode_init(AVCodecContext *avctx)
4755 {
4856 MpegEncContext *s = avctx->priv_data;
@@ -57,10 +65,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) · 8 unmodified lines
5765 s->quant_precision = 5;
5866 s->decode_mb = ff_h263_decode_mb;
5967 s->low_delay = 1;
60− if (avctx->codec->id == AV_CODEC_ID_MSS2)
61− avctx->pix_fmt = AV_PIX_FMT_YUV420P;
62− else
63− avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
6468 s->unrestricted_mv = 1;
6569
6670 /* select sub codec */
@@ -120,6 +124,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) · 53 unmodified lines
120124 if (avctx->codec->id != AV_CODEC_ID_H263 &&
121125 avctx->codec->id != AV_CODEC_ID_H263P &&
122126 avctx->codec->id != AV_CODEC_ID_MPEG4) {
127+ avctx->pix_fmt = h263_get_format(avctx);
123128 ff_mpv_idct_init(s);
124129 if ((ret = ff_mpv_common_init(s)) < 0)
125130 return ret;
@@ -505,9 +510,11 @@ retry: · 379 unmodified lines
505510 return ret;
506511 }
507512
508− if (!s->context_initialized)
513+ if (!s->context_initialized) {
514+ avctx->pix_fmt = h263_get_format(avctx);
509515 if ((ret = ff_mpv_common_init(s)) < 0)
510516 return ret;
517+ }
511518
512519 if (!s->current_picture_ptr || s->current_picture_ptr->f->data[0]) {
513520 int i = ff_find_unused_picture(s, 0);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t