Merge commit 'e72605f80bf5cbe32053a554ccc137e0a99cf3dd'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 24 Feb 2015 21:42:00 +0000 (22:42 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 24 Feb 2015 21:42:04 +0000 (22:42 +0100)
* commit 'e72605f80bf5cbe32053a554ccc137e0a99cf3dd':
  rtpdec: Allow allocating and freeing the private data without explicit functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/rtpdec.h
libavformat/rtsp.c

Simple merge
@@@ -728,20 -725,24 +732,24 @@@ void ff_rtsp_close_streams(AVFormatCont
      for (i = 0; i < rt->nb_rtsp_streams; i++) {
          rtsp_st = rt->rtsp_streams[i];
          if (rtsp_st) {
-             if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context)
-                 rtsp_st->dynamic_handler->free(
-                     rtsp_st->dynamic_protocol_context);
+             if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context) {
+                 if (rtsp_st->dynamic_handler->free)
+                     rtsp_st->dynamic_handler->free(
+                         rtsp_st->dynamic_protocol_context);
+                 else
+                     av_free(rtsp_st->dynamic_protocol_context);
+             }
              for (j = 0; j < rtsp_st->nb_include_source_addrs; j++)
 -                av_free(rtsp_st->include_source_addrs[j]);
 +                av_freep(&rtsp_st->include_source_addrs[j]);
              av_freep(&rtsp_st->include_source_addrs);
              for (j = 0; j < rtsp_st->nb_exclude_source_addrs; j++)
 -                av_free(rtsp_st->exclude_source_addrs[j]);
 +                av_freep(&rtsp_st->exclude_source_addrs[j]);
              av_freep(&rtsp_st->exclude_source_addrs);
  
 -            av_free(rtsp_st);
 +            av_freep(&rtsp_st);
          }
      }
 -    av_free(rt->rtsp_streams);
 +    av_freep(&rt->rtsp_streams);
      if (rt->asf_ctx) {
          avformat_close_input(&rt->asf_ctx);
      }