[FFmpeg-cvslog] libx264: connect AVCodecContext.rtp_payload_size to x264_params_t. i_slice_max_size

Lyubomir Marinov git at videolan.org
Mon Sep 17 21:40:26 CEST 2012


ffmpeg | branch: master | Lyubomir Marinov <lyubomir.marinov at jitsi.org> | Sun Sep 16 12:46:27 2012 +0300| [fd9cd8cd5ab6042731fa0fab3a5158e35dce773a] | committer: Michael Niedermayer

libx264: connect AVCodecContext.rtp_payload_size to x264_params_t.i_slice_max_size

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fd9cd8cd5ab6042731fa0fab3a5158e35dce773a
---

 libavcodec/libx264.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index f2f8990..4435a2a 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -443,6 +443,16 @@ static av_cold int X264_init(AVCodecContext *avctx)
 
     if (x4->slice_max_size >= 0)
         x4->params.i_slice_max_size =  x4->slice_max_size;
+    else {
+        /*
+         * Allow x264 to be instructed through AVCodecContext about the maximum
+         * size of the RTP payload. For example, this enables the production of
+         * payload suitable for the H.264 RTP packetization-mode 0 i.e. single
+         * NAL unit per RTP packet.
+         */
+        if (avctx->rtp_payload_size)
+            x4->params.i_slice_max_size = avctx->rtp_payload_size;
+    }
 
     if (x4->fastfirstpass)
         x264_param_apply_fastfirstpass(&x4->params);



More information about the ffmpeg-cvslog mailing list