]> git.sesse.net Git - ffmpeg/commitdiff
Make libx264 take the pict_type input parameter into account,
authorNicolas George <nicola.george@normalesup.org>
Mon, 25 Oct 2010 14:40:00 +0000 (14:40 +0000)
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>
Mon, 25 Oct 2010 14:40:00 +0000 (14:40 +0000)
thus making forced key frames work.

Patch by Nicolas George, nicolas d george a normalesup d org

Originally committed as revision 25567 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/libx264.c

index 7ce04a62cc8ac9bc8512170f4d908188487064ca..6da7f2ae03fa47e31ae656329091bb0d2a64d48e 100644 (file)
@@ -100,7 +100,11 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
         }
 
         x4->pic.i_pts  = frame->pts;
-        x4->pic.i_type = X264_TYPE_AUTO;
+        x4->pic.i_type =
+            frame->pict_type == FF_I_TYPE ? X264_TYPE_KEYFRAME :
+            frame->pict_type == FF_P_TYPE ? X264_TYPE_P :
+            frame->pict_type == FF_B_TYPE ? X264_TYPE_B :
+                                            X264_TYPE_AUTO;
     }
 
     do {