~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavformat/sdp.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
    char *psets, *p;
157
157
    const uint8_t *r;
158
158
    const char *pset_string = "; sprop-parameter-sets=";
 
159
    uint8_t *orig_extradata = NULL;
 
160
    int orig_extradata_size = 0;
159
161
 
160
162
    if (c->extradata_size > MAX_EXTRADATA_SIZE) {
161
163
        av_log(c, AV_LOG_ERROR, "Too much extradata!\n");
172
174
 
173
175
            return NULL;
174
176
        }
 
177
 
 
178
        orig_extradata_size = c->extradata_size;
 
179
        orig_extradata = av_mallocz(orig_extradata_size +
 
180
                                    FF_INPUT_BUFFER_PADDING_SIZE);
 
181
        if (!orig_extradata) {
 
182
            av_bitstream_filter_close(bsfc);
 
183
            return NULL;
 
184
        }
 
185
        memcpy(orig_extradata, c->extradata, orig_extradata_size);
175
186
        av_bitstream_filter_filter(bsfc, c, NULL, &dummy_p, &dummy_int, NULL, 0, 0);
176
187
        av_bitstream_filter_close(bsfc);
177
188
    }
179
190
    psets = av_mallocz(MAX_PSET_SIZE);
180
191
    if (psets == NULL) {
181
192
        av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the parameter sets.\n");
 
193
        av_free(orig_extradata);
182
194
        return NULL;
183
195
    }
184
196
    memcpy(psets, pset_string, strlen(pset_string));
208
220
        p += strlen(p);
209
221
        r = r1;
210
222
    }
 
223
    if (orig_extradata) {
 
224
        av_free(c->extradata);
 
225
        c->extradata      = orig_extradata;
 
226
        c->extradata_size = orig_extradata_size;
 
227
    }
211
228
 
212
229
    return psets;
213
230
}
252
269
        return NULL;
253
270
    }
254
271
 
255
 
    if (ff_split_xiph_headers(c->extradata, c->extradata_size,
 
272
    if (avpriv_split_xiph_headers(c->extradata, c->extradata_size,
256
273
                              first_header_size, header_start,
257
274
                              header_len) < 0) {
258
275
        av_log(c, AV_LOG_ERROR, "Extradata corrupt.\n");
342
359
    char *config;
343
360
 
344
361
    for (rate_index = 0; rate_index < 16; rate_index++)
345
 
        if (ff_mpeg4audio_sample_rates[rate_index] == c->sample_rate)
 
362
        if (avpriv_mpeg4audio_sample_rates[rate_index] == c->sample_rate)
346
363
            break;
347
364
    if (rate_index == 16) {
348
365
        av_log(c, AV_LOG_ERROR, "Unsupported sample rate\n");
517
534
                                         payload_type,
518
535
                                         8000, c->channels);
519
536
            break;
 
537
        case CODEC_ID_ADPCM_G726: {
 
538
            if (payload_type >= RTP_PT_PRIVATE)
 
539
                av_strlcatf(buff, size, "a=rtpmap:%d G726-%d/%d\r\n",
 
540
                                         payload_type,
 
541
                                         c->bits_per_coded_sample*8,
 
542
                                         c->sample_rate);
 
543
            break;
 
544
        }
520
545
        default:
521
546
            /* Nothing special to do here... */
522
547
            break;
532
557
    const char *type;
533
558
    int payload_type;
534
559
 
535
 
    payload_type = ff_rtp_get_payload_type(c);
536
 
    if (payload_type < 0) {
537
 
        payload_type = RTP_PT_PRIVATE + (c->codec_type == AVMEDIA_TYPE_AUDIO);
538
 
    }
 
560
    payload_type = ff_rtp_get_payload_type(fmt, c);
539
561
 
540
562
    switch (c->codec_type) {
541
563
        case AVMEDIA_TYPE_VIDEO   : type = "video"      ; break;