static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,

                                   struct in_addr my_ip)

{

    AVFormatContext *avc;

    AVStream avs[MAX_STREAMS];

    int i;



    avc =  avformat_alloc_context();

    if (avc == NULL) {

        return -1;

    }

    av_metadata_set2(&avc->metadata, "title",

                     stream->title[0] ? stream->title : "No Title", 0);

    avc->nb_streams = stream->nb_streams;

    if (stream->is_multicast) {

        snprintf(avc->filename, 1024, "rtp://%s:%d?multicast=1?ttl=%d",

                 inet_ntoa(stream->multicast_ip),

                 stream->multicast_port, stream->multicast_ttl);

    } else {

        snprintf(avc->filename, 1024, "rtp://0.0.0.0");

    }



    for(i = 0; i < stream->nb_streams; i++) {

        avc->streams[i] = &avs[i];

        avc->streams[i]->codec = stream->streams[i]->codec;

    }

    *pbuffer = av_mallocz(2048);

    avf_sdp_create(&avc, 1, *pbuffer, 2048);


    av_free(avc);



    return strlen(*pbuffer);

}
static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,

                                   struct in_addr my_ip)

{

    AVFormatContext *avc;

    AVStream avs[MAX_STREAMS];

    int i;



    avc =  avformat_alloc_context();

    if (avc == NULL) {

        return -1;

    }

    av_metadata_set2(&avc->metadata, "title",

                     stream->title[0] ? stream->title : "No Title", 0);

    avc->nb_streams = stream->nb_streams;

    if (stream->is_multicast) {

        snprintf(avc->filename, 1024, "rtp:

                 inet_ntoa(stream->multicast_ip),

                 stream->multicast_port, stream->multicast_ttl);

    } else {

        snprintf(avc->filename, 1024, "rtp:

    }



    for(i = 0; i < stream->nb_streams; i++) {

        avc->streams[i] = &avs[i];

        avc->streams[i]->codec = stream->streams[i]->codec;

    }

    *pbuffer = av_mallocz(2048);

    avf_sdp_create(&avc, 1, *pbuffer, 2048);


    av_free(avc);



    return strlen(*pbuffer);

}
static int FUNC_0(FFStream *VAR_0, uint8_t **VAR_1,

                                   struct in_addr VAR_2)

{

    AVFormatContext *avc;

    AVStream avs[MAX_STREAMS];

    int VAR_3;



    avc =  avformat_alloc_context();

    if (avc == NULL) {

        return -1;

    }

    av_metadata_set2(&avc->metadata, "title",

                     VAR_0->title[0] ? VAR_0->title : "No Title", 0);

    avc->nb_streams = VAR_0->nb_streams;

    if (VAR_0->is_multicast) {

        snprintf(avc->filename, 1024, "rtp:

                 inet_ntoa(VAR_0->multicast_ip),

                 VAR_0->multicast_port, VAR_0->multicast_ttl);

    } else {

        snprintf(avc->filename, 1024, "rtp:

    }



    for(VAR_3 = 0; VAR_3 < VAR_0->nb_streams; VAR_3++) {

        avc->streams[VAR_3] = &avs[VAR_3];

        avc->streams[VAR_3]->codec = VAR_0->streams[VAR_3]->codec;

    }

    *VAR_1 = av_mallocz(2048);

    avf_sdp_create(&avc, 1, *VAR_1, 2048);


    av_free(avc);



    return strlen(*VAR_1);

}
static int FUNC_0(FFStream *VAR_0, uint8_t **VAR_1,
struct in_addr VAR_2)
{ AVFormatContext *avc; AVStream avs[MAX_STREAMS]; int VAR_3; avc =  avformat_alloc_context(); if (avc == NULL) { return -1; } av_metadata_set2(&avc->metadata, "title",
VAR_0->title[0] ? VAR_0->title : "No Title", 0); avc->nb_streams = VAR_0->nb_streams; if (VAR_0->is_multicast) { snprintf(avc->filename, 1024, "rtp:
inet_ntoa(VAR_0->multicast_ip),
VAR_0->multicast_port, VAR_0->multicast_ttl); } else { snprintf(avc->filename, 1024, "rtp:
} for(VAR_3 = 0; VAR_3 < VAR_0->nb_streams; VAR_3++) { avc->streams[VAR_3] = &avs[VAR_3]; avc->streams[VAR_3]->codec = VAR_0->streams[VAR_3]->codec; } *VAR_1 = av_mallocz(2048); avf_sdp_create(&avc, 1, *VAR_1, 2048); av_free(avc); return strlen(*VAR_1); }