]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpenc_chain.c
swscale: fix signed shift overflows in ff_yuv2rgb_c_init_tables()
[ffmpeg] / libavformat / rtpenc_chain.c
index a923b2deb64f3746a12b04a210fbb7fb736ed7cc..f0e4dae8ebc30c7a89c37b34186a711dfb0a428e 100644 (file)
  */
 
 #include "avformat.h"
+#include "avio_internal.h"
 #include "rtpenc_chain.h"
 #include "avio_internal.h"
+#include "libavutil/opt.h"
 
 AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
                                        URLContext *handle, int packet_size)
@@ -29,6 +31,8 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
     AVFormatContext *rtpctx;
     int ret;
     AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
+    uint8_t *rtpflags;
+    AVDictionary *opts = NULL;
 
     if (!rtp_format)
         return NULL;
@@ -39,7 +43,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
         return NULL;
 
     rtpctx->oformat = rtp_format;
-    if (!av_new_stream(rtpctx, 0)) {
+    if (!avformat_new_stream(rtpctx, NULL)) {
         av_free(rtpctx);
         return NULL;
     }
@@ -48,16 +52,20 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
     /* Copy other stream parameters. */
     rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio;
 
+    if (av_opt_get(s, "rtpflags", AV_OPT_SEARCH_CHILDREN, &rtpflags) >= 0)
+        av_dict_set(&opts, "rtpflags", rtpflags, AV_DICT_DONT_STRDUP_VAL);
+
     /* Set the synchronized start time. */
     rtpctx->start_time_realtime = s->start_time_realtime;
 
     avcodec_copy_context(rtpctx->streams[0]->codec, st->codec);
 
     if (handle) {
-        url_fdopen(&rtpctx->pb, handle);
+        ffio_fdopen(&rtpctx->pb, handle);
     } else
         ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size);
-    ret = av_write_header(rtpctx);
+    ret = avformat_write_header(rtpctx, &opts);
+    av_dict_free(&opts);
 
     if (ret) {
         if (handle) {