[FFmpeg-devel] [BUG] Theora decoder displays green line
matthieu castet
castet.matthieu
Sun May 6 18:01:23 CEST 2007
Aurelien Jacobs wrote:
> On Sun, 6 May 2007 17:12:21 +0200
> Michael Niedermayer <michaelni at gmx.at> wrote:
>
>> Hi
>>
>> On Sun, May 06, 2007 at 02:26:36PM +0200, Diego Biurrun wrote:
>>> Try the following sample:
>>>
>>> http://mirrors.creativecommons.org/getcreative/Creative_Commons_-_Get_Creative.ogg
>>>
>>> ffplay displays a green line at the bottom (as does MPlayer with lavc
>>> decoder and lavf demuxer), while MPlayer with native demuxer and
>>> libtheora decoder works fine.
>> ffmpeg -i output could be usefull
>
> coded size is 400x304, display size should be 400x300.
> Attached patch fixes this issue.
Index: libavcodec/vp3.c
s->width = get_bits(gb, 16) << 4;
s->height = get_bits(gb, 16) << 4;
+ avctx->width = get_bits_long(gb, 24);
+ avctx->height = get_bits_long(gb, 24);
if(avcodec_check_dimensions(avctx, s->width, s->height)){
av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n",
s->width, s->height);
@@ -2399,15 +2401,7 @@
skip_bits(gb, 32); /* total number of blocks in a frame */
skip_bits(gb, 4); /* total number of blocks in a frame */
skip_bits(gb, 32); /* total number of macroblocks in a frame */
-
- skip_bits(gb, 24); /* frame width */
- skip_bits(gb, 24); /* frame height */
}
- else
- {
- skip_bits(gb, 24); /* frame width */
- skip_bits(gb, 24); /* frame height */
- }
Are you sure of that ?
The code this wrong for (s->theora >= 0x030400) as frame dimension where
expected after the 3 "total number of x"
if (s->theora >= 0x030200) {
skip_bits(gb, 8); /* offset x */
@@ -2438,8 +2432,8 @@
// align_get_bits(gb);
- avctx->width = s->width;
- avctx->height = s->height;
+ avctx->coded_width = s->width;
+ avctx->coded_height = s->height;
return 0;
}
Index: libavformat/oggparsetheora.c
===================================================================
--- libavformat/oggparsetheora.c (revision 8918)
+++ libavformat/oggparsetheora.c (working copy)
@@ -70,13 +70,15 @@
return -1;
}
- st->codec->width = get_bits(&gb, 16) << 4;
- st->codec->height = get_bits(&gb, 16) << 4;
+ st->codec->coded_width = get_bits(&gb, 16) << 4;
+ st->codec->coded_height = get_bits(&gb, 16) << 4;
+ st->codec->width = get_bits_long(&gb, 24);
+ st->codec->height = get_bits_long(&gb, 24);
Same comment as above, for version >= 0x030400, this seems wrong.
Matthieu
More information about the ffmpeg-devel
mailing list