summaryrefslogtreecommitdiff
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-15 02:27:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-15 02:28:49 +0200
commit012062cfd51f50862d18eeb35e316866932cfd0e (patch)
tree97274e41a286a9c7bd1e797d3df3116744472ac5 /libavcodec/h263dec.c
parent2fd87a3d7895ce36e558a306d03e33697d456086 (diff)
parentb869eea7ea8f5d8331fcd6355f848bb6a6e06b14 (diff)
Merge commit 'b869eea7ea8f5d8331fcd6355f848bb6a6e06b14'
* commit 'b869eea7ea8f5d8331fcd6355f848bb6a6e06b14': h263dec: Fix order of initialization Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 74e4be43a1..40d98142c4 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -456,21 +456,9 @@ retry:
if (ret < 0)
return ret;
- if (!s->context_initialized) {
+ if (!s->context_initialized)
// we need the idct permutaton for reading a custom matrix
ff_mpv_idct_init(s);
- if ((ret = ff_MPV_common_init(s)) < 0)
- return ret;
- }
-
- /* We need to set current_picture_ptr before reading the header,
- * otherwise we cannot store anyting in there */
- if (s->current_picture_ptr == NULL || s->current_picture_ptr->f->data[0]) {
- int i = ff_find_unused_picture(s, 0);
- if (i < 0)
- return i;
- s->current_picture_ptr = &s->picture[i];
- }
/* let's go :-) */
if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) {
@@ -510,6 +498,17 @@ retry:
return ret;
}
+ if (!s->context_initialized)
+ if ((ret = ff_MPV_common_init(s)) < 0)
+ return ret;
+
+ if (s->current_picture_ptr == NULL || s->current_picture_ptr->f->data[0]) {
+ int i = ff_find_unused_picture(s, 0);
+ if (i < 0)
+ return i;
+ s->current_picture_ptr = &s->picture[i];
+ }
+
avctx->has_b_frames = !s->low_delay;
if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) {