diff options
author | Luca Abeni <lucabe72@email.it> | 2010-06-11 08:01:45 +0000 |
---|---|---|
committer | Luca Abeni <lucabe72@email.it> | 2010-06-11 08:01:45 +0000 |
commit | ede13f55f00dd6c56897fd4bc88c202b2f087455 (patch) | |
tree | 09ac0c7e545cf18f3ac13c1b7b6ab0eb2d1987eb | |
parent | e91376d1f645d514796da16b606ac2764ab005e7 (diff) | |
download | ffmpeg-ede13f55f00dd6c56897fd4bc88c202b2f087455.tar.gz |
Use a bitstream filter for converting the extradata syntax when generating an SDP.
This allows to generate correct SDPs for H.264 video in "MP4 syntax".
Originally committed as revision 23572 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/sdp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 6bf05dbe39..10f43c35fa 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -149,6 +149,19 @@ static char *extradata2psets(AVCodecContext *c) return NULL; } + if (c->extradata[0] == 1) { + uint8_t *dummy_p; + int dummy_int; + AVBitStreamFilterContext *bsfc= av_bitstream_filter_init("h264_mp4toannexb"); + + if (!bsfc) { + av_log(c, AV_LOG_ERROR, "Cannot open the h264_mp4toannexb BSF!\n"); + + return NULL; + } + av_bitstream_filter_filter(bsfc, c, NULL, &dummy_p, &dummy_int, NULL, 0, 0); + av_bitstream_filter_close(bsfc); + } psets = av_mallocz(MAX_PSET_SIZE); if (psets == NULL) { |