aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2009-04-06 21:04:26 +0000
committerLuca Abeni <lucabe72@email.it>2009-04-06 21:04:26 +0000
commit99f373f3a6da62712388019e008dc76c4b8edc3b (patch)
treea13d47220d7e21b7e73aecf372acdc3ab89b355e
parent5a43bbc37d7521d40eb1e96019f47f74ee645577 (diff)
downloadffmpeg-99f373f3a6da62712388019e008dc76c4b8edc3b.tar.gz
Only insert the SPS and PPS NALs in sprop-parameter-sets
Patch by Martin Storsjö (martin AT martin DOT st) Originally committed as revision 18343 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/sdp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index d5312c48d9..0c12862e47 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -116,9 +116,15 @@ static char *extradata2psets(AVCodecContext *c)
r = ff_avc_find_startcode(c->extradata, c->extradata + c->extradata_size);
while (r < c->extradata + c->extradata_size) {
const uint8_t *r1;
+ uint8_t nal_type;
while (!*(r++));
+ nal_type = *r & 0x1f;
r1 = ff_avc_find_startcode(r, c->extradata + c->extradata_size);
+ if (nal_type != 7 && nal_type != 8) { /* Only output SPS and PPS */
+ r = r1;
+ continue;
+ }
if (p != (psets + strlen(pset_string))) {
*p = ',';
p++;