[04/16] rtpdec_h264: Remove unnecessary struct padding

Message ID 1424727122-2827-4-git-send-email-martin@martin.st
State Committed
Commit 247764a592f83521f9c1ccdc900b00a8b84f3c87
Headers show

Commit Message

Martin Storsjö Feb. 23, 2015, 9:31 p.m.
There's no point in adding padding in the allocation of a depacketizer
specific context struct.
---
 libavformat/rtpdec_h264.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Barbato Feb. 23, 2015, 9:44 p.m. | #1
On 23/02/15 22:31, Martin Storsjö wrote:
> There's no point in adding padding in the allocation of a depacketizer
> specific context struct.
> ---
>   libavformat/rtpdec_h264.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
> index 13dd7e9..b6f2444 100644
> --- a/libavformat/rtpdec_h264.c
> +++ b/libavformat/rtpdec_h264.c
> @@ -346,7 +346,7 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
>
>   static PayloadContext *h264_new_context(void)
>   {
> -    return av_mallocz(sizeof(PayloadContext) + FF_INPUT_BUFFER_PADDING_SIZE);
> +    return av_mallocz(sizeof(PayloadContext));
>   }
>
>   static void h264_free_context(PayloadContext *data)
>

Ok.

Patch

diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
index 13dd7e9..b6f2444 100644
--- a/libavformat/rtpdec_h264.c
+++ b/libavformat/rtpdec_h264.c
@@ -346,7 +346,7 @@  static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
 
 static PayloadContext *h264_new_context(void)
 {
-    return av_mallocz(sizeof(PayloadContext) + FF_INPUT_BUFFER_PADDING_SIZE);
+    return av_mallocz(sizeof(PayloadContext));
 }
 
 static void h264_free_context(PayloadContext *data)