ffserver: set oformat
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 9 Dec 2012 22:34:32 +0000 (23:34 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 9 Dec 2012 23:26:56 +0000 (00:26 +0100)
Fix Ticket1986

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cbe43e62c9ac7d4aefdc13476f6f691bd626525f)

ffserver.c

index 4044d0f..8740140 100644 (file)
@@ -2937,12 +2937,14 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
 {
     AVFormatContext *avc;
     AVStream *avs = NULL;
+    AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
     int i;
 
     avc =  avformat_alloc_context();
-    if (avc == NULL) {
+    if (avc == NULL || !rtp_format) {
         return -1;
     }
+    avc->oformat = rtp_format;
     av_dict_set(&avc->metadata, "title",
                stream->title[0] ? stream->title : "No Title", 0);
     avc->nb_streams = stream->nb_streams;