... | ... |
@@ -58,7 +58,6 @@ static int theora_header(AVFormatContext *s, int idx) |
58 | 58 |
switch (os->buf[os->pstart]) { |
59 | 59 |
case 0x80: { |
60 | 60 |
GetBitContext gb; |
61 |
- int width, height; |
|
62 | 61 |
AVRational timebase; |
63 | 62 |
|
64 | 63 |
init_get_bits(&gb, os->buf + os->pstart, os->psize * 8); |
... | ... |
@@ -73,19 +72,20 @@ static int theora_header(AVFormatContext *s, int idx) |
73 | 73 |
return AVERROR(ENOSYS); |
74 | 74 |
} |
75 | 75 |
|
76 |
- width = get_bits(&gb, 16) << 4; |
|
77 |
- height = get_bits(&gb, 16) << 4; |
|
78 |
- avcodec_set_dimensions(st->codec, width, height); |
|
76 |
+ st->codec->width = get_bits(&gb, 16) << 4; |
|
77 |
+ st->codec->height = get_bits(&gb, 16) << 4; |
|
79 | 78 |
|
80 | 79 |
if (thp->version >= 0x030400) |
81 | 80 |
skip_bits(&gb, 100); |
82 | 81 |
|
83 | 82 |
if (thp->version >= 0x030200) { |
84 |
- width = get_bits_long(&gb, 24); |
|
85 |
- height = get_bits_long(&gb, 24); |
|
83 |
+ int width = get_bits_long(&gb, 24); |
|
84 |
+ int height = get_bits_long(&gb, 24); |
|
86 | 85 |
if (width <= st->codec->width && width > st->codec->width - 16 && |
87 |
- height <= st->codec->height && height > st->codec->height - 16) |
|
88 |
- avcodec_set_dimensions(st->codec, width, height); |
|
86 |
+ height <= st->codec->height && height > st->codec->height - 16) { |
|
87 |
+ st->codec->width = width; |
|
88 |
+ st->codec->height = height; |
|
89 |
+ } |
|
89 | 90 |
|
90 | 91 |
skip_bits(&gb, 16); |
91 | 92 |
} |