diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-29 17:46:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-29 18:04:34 +0200 |
commit | 1c66807636ed8da5cf81d75cc8bb2726c6d6bc21 (patch) | |
tree | dbb5d2fafe49a56ce5d608c74ae32929c08a4405 /libavformat | |
parent | 85c830331c36502144e1cc9cf8aa7bd177e1d79d (diff) | |
parent | d488c3bcbaf7ddda42597e014deb661a7e9e2112 (diff) | |
download | ffmpeg-1c66807636ed8da5cf81d75cc8bb2726c6d6bc21.tar.gz |
Merge commit 'd488c3bcbaf7ddda42597e014deb661a7e9e2112'
* commit 'd488c3bcbaf7ddda42597e014deb661a7e9e2112':
configure: support Bitrig OS
yuv2rgb: handle line widths that are not a multiple of 4.
graph2dot: Use the fallback getopt implementation if needed
tools: Include io.h for open/read/write/close if unistd.h doesn't exist
testprogs: Remove unused includes
qt-faststart: Use other seek/tell functions on MSVC than on mingw
ismindex: Include direct.h for _mkdir on windows
sdp: Use static const char arrays instead of pointers to strings
x86: avcodec: Drop silly "_mmx" suffixes from filenames
x86: avcodec: Drop silly "_sse" suffixes from filenames
sdp: Include profile-level-id for H264
utvideoenc: use ff_huff_gen_len_table
huffman: add ff_huff_gen_len_table
cllc: simplify/fix swapped data buffer allocation.
rtpdec_h264: Don't set the pixel format
h264: Check that the codec isn't null before accessing it
audio_frame_queue: Define af_queue_log_state before using it
Conflicts:
libavcodec/audio_frame_queue.c
libavcodec/h264.c
libavcodec/huffman.h
libavcodec/huffyuv.c
libavcodec/utvideoenc.c
libavcodec/x86/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rtpdec_h264.c | 1 | ||||
-rw-r--r-- | libavformat/sdp.c | 14 |
2 files changed, 13 insertions, 2 deletions
diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c index 61e038afeb..083f8e89b2 100644 --- a/libavformat/rtpdec_h264.c +++ b/libavformat/rtpdec_h264.c @@ -369,7 +369,6 @@ static int parse_h264_sdp_line(AVFormatContext *s, int st_index, // set our parameters codec->width = atoi(buf1); codec->height = atoi(p + 1); // skip the - - codec->pix_fmt = PIX_FMT_YUV420P; } else if (av_strstart(p, "fmtp:", &p)) { return ff_parse_fmtp(stream, h264_data, p, sdp_parse_fmtp_config_h264); } else if (av_strstart(p, "cliprect:", &p)) { diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 48dfb86649..9d7dc0be0d 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -154,9 +154,11 @@ static char *extradata2psets(AVCodecContext *c) { char *psets, *p; const uint8_t *r; - const char *pset_string = "; sprop-parameter-sets="; + static const char pset_string[] = "; sprop-parameter-sets="; + static const char profile_string[] = "; profile-level-id="; uint8_t *orig_extradata = NULL; int orig_extradata_size = 0; + const uint8_t *sps = NULL, *sps_end; if (c->extradata_size > MAX_EXTRADATA_SIZE) { av_log(c, AV_LOG_ERROR, "Too much extradata!\n"); @@ -210,6 +212,10 @@ static char *extradata2psets(AVCodecContext *c) *p = ','; p++; } + if (!sps) { + sps = r; + sps_end = r1; + } if (av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r) == NULL) { av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %td %td!\n", MAX_PSET_SIZE - (p - psets), r1 - r); av_free(psets); @@ -219,6 +225,12 @@ static char *extradata2psets(AVCodecContext *c) p += strlen(p); r = r1; } + if (sps && sps_end - sps >= 4) { + memcpy(p, profile_string, strlen(profile_string)); + p += strlen(p); + ff_data_to_hex(p, sps + 1, 3, 0); + p[6] = '\0'; + } if (orig_extradata) { av_free(c->extradata); c->extradata = orig_extradata; |