~ubuntu-branches/ubuntu/lucid/ffmpeg/lucid-security

« back to all changes in this revision

Viewing changes to libavformat/sdp.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-03-13 09:18:28 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090313091828-n4ktby5eca487uhv
Tags: 3:0.svn20090303-1ubuntu1+unstripped1
merge from ubuntu.jaunty branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
struct sdp_session_level {
32
32
    int sdp_version;      /**< protocol version (currently 0) */
33
 
    int id;               /**< session id */
 
33
    int id;               /**< session ID */
34
34
    int version;          /**< session version */
35
35
    int start_time;       /**< session start time (NTP time, in seconds),
36
 
                             or 0 in case of permanent session */
 
36
                               or 0 in case of permanent session */
37
37
    int end_time;         /**< session end time (NTP time, in seconds),
38
38
                               or 0 if the session is not bounded */
39
39
    int ttl;              /**< TTL, in case of multicast stream */
101
101
    const char *pset_string = "; sprop-parameter-sets=";
102
102
 
103
103
    if (c->extradata_size > MAX_EXTRADATA_SIZE) {
104
 
        av_log(c, AV_LOG_ERROR, "Too many extra data!\n");
 
104
        av_log(c, AV_LOG_ERROR, "Too much extradata!\n");
105
105
 
106
106
        return NULL;
107
107
    }
108
108
 
109
109
    psets = av_mallocz(MAX_PSET_SIZE);
110
110
    if (psets == NULL) {
111
 
        av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the parameter sets\n");
 
111
        av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the parameter sets.\n");
112
112
        return NULL;
113
113
    }
114
114
    memcpy(psets, pset_string, strlen(pset_string));
124
124
            p++;
125
125
        }
126
126
        if (av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r) == NULL) {
127
 
            av_log(c, AV_LOG_ERROR, "Cannot BASE64 encode %td %td!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
 
127
            av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %td %td!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
128
128
            av_free(psets);
129
129
 
130
130
            return NULL;
141
141
    char *config;
142
142
 
143
143
    if (c->extradata_size > MAX_EXTRADATA_SIZE) {
144
 
        av_log(c, AV_LOG_ERROR, "Too many extra data!\n");
 
144
        av_log(c, AV_LOG_ERROR, "Too much extradata!\n");
145
145
 
146
146
        return NULL;
147
147
    }
148
148
    config = av_malloc(10 + c->extradata_size * 2);
149
149
    if (config == NULL) {
150
 
        av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the config info\n");
 
150
        av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the config info.\n");
151
151
        return NULL;
152
152
    }
153
153
    memcpy(config, "; config=", 9);
187
187
                /* FIXME: maybe we can forge config information based on the
188
188
                 *        codec parameters...
189
189
                 */
190
 
                av_log(c, AV_LOG_ERROR, "AAC with no global headers is currently not supported\n");
 
190
                av_log(c, AV_LOG_ERROR, "AAC with no global headers is currently not supported.\n");
191
191
                return NULL;
192
192
            }
193
193
            if (config == NULL) {
219
219
                                         c->sample_rate, c->channels);
220
220
            break;
221
221
        default:
222
 
            /* Nothing special to do, here... */
 
222
            /* Nothing special to do here... */
223
223
            break;
224
224
    }
225
225
 
233
233
    const char *type;
234
234
    int payload_type;
235
235
 
236
 
    payload_type = rtp_get_payload_type(c);
 
236
    payload_type = ff_rtp_get_payload_type(c);
237
237
    if (payload_type < 0) {
238
238
        payload_type = 96;  /* FIXME: how to assign a private pt? rtp.c is broken too */
239
239
    }