[1/4] rtpenc: Allow storing format specific data

Message ID 1330005641-19309-1-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö Feb. 23, 2012, 2 p.m.
---
 libavformat/rtpenc.c |    1 +
 libavformat/rtpenc.h |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)

Comments

Luca Barbato Feb. 23, 2012, 2:42 p.m. | #1
On 23/02/12 15:00, Martin Storsjö wrote:
> ---
>  libavformat/rtpenc.c |    1 +
>  libavformat/rtpenc.h |    4 ++++
>  2 files changed, 5 insertions(+), 0 deletions(-)
> 

Ok, I guess, when will be used?

lu

Patch

diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index e4ef0fc..8b51c77 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -480,6 +480,7 @@  static int rtp_write_trailer(AVFormatContext *s1)
     RTPMuxContext *s = s1->priv_data;
 
     av_freep(&s->buf);
+    av_freep(&s->priv_data);
 
     return 0;
 }
diff --git a/libavformat/rtpenc.h b/libavformat/rtpenc.h
index 2bb2b81..0acc3d6 100644
--- a/libavformat/rtpenc.h
+++ b/libavformat/rtpenc.h
@@ -24,6 +24,8 @@ 
 #include "avformat.h"
 #include "rtp.h"
 
+struct RTPFormatSpecificContext;
+
 struct RTPMuxContext {
     const AVClass *av_class;
     AVFormatContext *ic;
@@ -60,6 +62,8 @@  struct RTPMuxContext {
     int nal_length_size;
 
     int flags;
+
+    struct RTPFormatSpecificContext *priv_data;
 };
 
 typedef struct RTPMuxContext RTPMuxContext;