summaryrefslogtreecommitdiff
path: root/libavformat/sdp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-12 01:25:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-12 01:25:37 +0100
commit7fad19a63dc52db4bf2bebbd9d261675956b1b34 (patch)
tree8997428f45d54f3177dc6cd208d0375daa6fe201 /libavformat/sdp.c
parent16abd687798bbf9192ba4954765e61de96065b8b (diff)
parent599b4c6efddaed33b1667c386b34b07729ba732b (diff)
downloadffmpeg-7fad19a63dc52db4bf2bebbd9d261675956b1b34.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: x86: cabac: replace explicit memory references with "m" operands avplay: don't request a stereo downmix wmapro: use av_float2int() lavc: avoid invalid memcpy() in avcodec_default_release_buffer() lavu: replace int/float punning functions lavfi: install libavfilter/vsrc_buffer.h Remove extraneous semicolons sdp: Restore the original mp4 format h264 extradata if converted rtpenc: Add support for mp4 format h264 rtpenc: Simplify code by introducing a separate end pointer movenc: Use the actual converted sample for RTP hinting Fix a bunch of common typos. Conflicts: doc/developer.texi doc/eval.texi doc/filters.texi doc/protocols.texi ffmpeg.c ffplay.c libavcodec/mpegvideo.h libavcodec/x86/cabac.h libavfilter/Makefile libavformat/avformat.h libavformat/cafdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/gxfenc.c libavformat/img2.c libavformat/movenc.c libavformat/mpegts.c libavformat/rtpenc_h264.c libavformat/utils.c libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/sdp.c')
-rw-r--r--libavformat/sdp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 5def15d2a3..11b50a0d07 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -156,6 +156,8 @@ static char *extradata2psets(AVCodecContext *c)
char *psets, *p;
const uint8_t *r;
const char *pset_string = "; sprop-parameter-sets=";
+ uint8_t *orig_extradata = NULL;
+ int orig_extradata_size = 0;
if (c->extradata_size > MAX_EXTRADATA_SIZE) {
av_log(c, AV_LOG_ERROR, "Too much extradata!\n");
@@ -172,6 +174,15 @@ static char *extradata2psets(AVCodecContext *c)
return NULL;
}
+
+ orig_extradata_size = c->extradata_size;
+ orig_extradata = av_mallocz(orig_extradata_size +
+ FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!orig_extradata) {
+ av_bitstream_filter_close(bsfc);
+ return NULL;
+ }
+ memcpy(orig_extradata, c->extradata, orig_extradata_size);
av_bitstream_filter_filter(bsfc, c, NULL, &dummy_p, &dummy_int, NULL, 0, 0);
av_bitstream_filter_close(bsfc);
}
@@ -179,6 +190,7 @@ static char *extradata2psets(AVCodecContext *c)
psets = av_mallocz(MAX_PSET_SIZE);
if (psets == NULL) {
av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the parameter sets.\n");
+ av_free(orig_extradata);
return NULL;
}
memcpy(psets, pset_string, strlen(pset_string));
@@ -208,6 +220,11 @@ static char *extradata2psets(AVCodecContext *c)
p += strlen(p);
r = r1;
}
+ if (orig_extradata) {
+ av_free(c->extradata);
+ c->extradata = orig_extradata;
+ c->extradata_size = orig_extradata_size;
+ }
return psets;
}