[06/12] rtpdec: Remove the now unused .alloc field

Message ID 1424795718-79013-6-git-send-email-martin@martin.st
State Committed
Commit f4b59334bd898c47c9ac30999a346176548630a8
Headers show

Commit Message

Martin Storsjö Feb. 24, 2015, 4:35 p.m.
Always use the .priv_data_size field instead.
---
 libavformat/rtpdec.h | 2 --
 libavformat/rtsp.c   | 6 +-----
 2 files changed, 1 insertion(+), 7 deletions(-)

Comments

Luca Barbato Feb. 24, 2015, 6:52 p.m. | #1
On 24/02/15 17:35, Martin Storsjö wrote:
> Always use the .priv_data_size field instead.
> ---
>  libavformat/rtpdec.h | 2 --
>  libavformat/rtsp.c   | 6 +-----
>  2 files changed, 1 insertion(+), 7 deletions(-)
> 

Ok.

Patch

diff --git a/libavformat/rtpdec.h b/libavformat/rtpdec.h
index 94f2f0c..9b7c36c 100644
--- a/libavformat/rtpdec.h
+++ b/libavformat/rtpdec.h
@@ -127,8 +127,6 @@  struct RTPDynamicProtocolHandler {
     /** Parse the a= line from the sdp field */
     int (*parse_sdp_a_line)(AVFormatContext *s, int st_index,
                             PayloadContext *priv_data, const char *line);
-    /** Allocate any data needed by the rtp parsing for this dynamic data. */
-    PayloadContext *(*alloc)(void);
     /** Free any data needed by the rtp parsing for this dynamic data. */
     void (*free)(PayloadContext *protocol_data);
     /** Parse handler for this dynamic packet */
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index a4527d2..3180d5b 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -186,11 +186,7 @@  static void init_rtp_handler(RTPDynamicProtocolHandler *handler,
     rtsp_st->dynamic_handler = handler;
     if (st)
         st->need_parsing = handler->need_parsing;
-    if (handler->alloc) {
-        rtsp_st->dynamic_protocol_context = handler->alloc();
-        if (!rtsp_st->dynamic_protocol_context)
-            rtsp_st->dynamic_handler = NULL;
-    } else if (handler->priv_data_size) {
+    if (handler->priv_data_size) {
         rtsp_st->dynamic_protocol_context = av_mallocz(handler->priv_data_size);
         if (!rtsp_st->dynamic_protocol_context)
             rtsp_st->dynamic_handler = NULL;