[FFmpeg-devel] [PATCH] H.264: fix decoding of plain still images (broken since revision 14289)

Reinhard Nissl rnissl
Sat Jan 3 19:01:32 CET 2009


the offending change in that revision seems to me the following:

-            if(prev && pics <= s->avctx->has_b_frames ||
-                out = prev;
+            if(pics <= s->avctx->has_b_frames || out_of_order)
+                out = NULL;

In the case of a plain still image, there are no previous images.
 Revision 14288 honored this by checking prev and therefore
output the current image (the still image).
In Revision 14289, this test is missing and therefore, no picture
is output. I've to add that pics as well as has_b_frames was 1
while out_of_order was 0 when checking the condition in both

As you can see from the attached patch, the location of this test
has moved meanwhile and the condition as well as the behavior has
been inverted, but still lacks a test for "no previous image".

I've added such a test by using outputted_poc and comparing it to
INT_MIN, which is the initial value of this variable.

For testing, I've uploaded two sample files into subdirectory
rnissl: one with a still frame and one with a pair of fields. See
readme.txt for more information.

Dipl.-Inform. (FH) Reinhard Nissl
mailto:rnissl at gmx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg_fix_stills.patch
Type: text/x-patch
Size: 580 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090103/b653e1b2/attachment.bin>

More information about the ffmpeg-devel mailing list