From 99f373f3a6da62712388019e008dc76c4b8edc3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 6 Apr 2009 21:04:26 +0000 Subject: [PATCH] =?UTF-8?q?Only=20insert=20the=20SPS=20and=20PPS=20NALs=20?= =?UTF-8?q?in=20sprop-parameter-sets=20Patch=20by=20Martin=20Storsj=C3=B6?= =?UTF-8?q?=20(martin=20AT=20martin=20DOT=20st)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 18343 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/sdp.c | 6 ++++++ 1 file changed, 6 insertions(+) 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++;