diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 20:58:15 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 20:59:55 +0100 |
commit | 6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch) | |
tree | 0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavformat/rtpdec_hevc.c | |
parent | 60b75186b2c878b6257b43c8fcc0b1356ada218e (diff) | |
parent | 9200514ad8717c63f82101dc394f4378854325bf (diff) | |
download | ffmpeg-6f69f7a8bf6a0d013985578df2ef42ee6b1c7994.tar.gz |
Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
lavf: replace AVStream.codec with AVStream.codecpar
This has been a HUGE effort from:
- Derek Buitenhuis <derek.buitenhuis@gmail.com>
- Hendrik Leppkes <h.leppkes@gmail.com>
- wm4 <nfxjfg@googlemail.com>
- Clément Bœsch <clement@stupeflix.com>
- James Almer <jamrial@gmail.com>
- Michael Niedermayer <michael@niedermayer.cc>
- Rostislav Pehlivanov <atomnuker@gmail.com>
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/rtpdec_hevc.c')
-rw-r--r-- | libavformat/rtpdec_hevc.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libavformat/rtpdec_hevc.c b/libavformat/rtpdec_hevc.c index 68ca17f3cb..a0e3a7c2f4 100644 --- a/libavformat/rtpdec_hevc.c +++ b/libavformat/rtpdec_hevc.c @@ -131,41 +131,41 @@ static av_cold int hevc_parse_sdp_line(AVFormatContext *ctx, int st_index, PayloadContext *hevc_data, const char *line) { AVStream *current_stream; - AVCodecContext *codec; + AVCodecParameters *par; const char *sdp_line_ptr = line; if (st_index < 0) return 0; current_stream = ctx->streams[st_index]; - codec = current_stream->codec; + par = current_stream->codecpar; if (av_strstart(sdp_line_ptr, "framesize:", &sdp_line_ptr)) { - ff_h264_parse_framesize(codec, sdp_line_ptr); + ff_h264_parse_framesize(par, sdp_line_ptr); } else if (av_strstart(sdp_line_ptr, "fmtp:", &sdp_line_ptr)) { int ret = ff_parse_fmtp(ctx, current_stream, hevc_data, sdp_line_ptr, hevc_sdp_parse_fmtp_config); if (hevc_data->vps_size || hevc_data->sps_size || hevc_data->pps_size || hevc_data->sei_size) { - av_freep(&codec->extradata); - codec->extradata_size = hevc_data->vps_size + hevc_data->sps_size + - hevc_data->pps_size + hevc_data->sei_size; - codec->extradata = av_malloc(codec->extradata_size + - AV_INPUT_BUFFER_PADDING_SIZE); - if (!codec->extradata) { + av_freep(&par->extradata); + par->extradata_size = hevc_data->vps_size + hevc_data->sps_size + + hevc_data->pps_size + hevc_data->sei_size; + par->extradata = av_malloc(par->extradata_size + + AV_INPUT_BUFFER_PADDING_SIZE); + if (!par->extradata) { ret = AVERROR(ENOMEM); - codec->extradata_size = 0; + par->extradata_size = 0; } else { int pos = 0; - memcpy(codec->extradata + pos, hevc_data->vps, hevc_data->vps_size); + memcpy(par->extradata + pos, hevc_data->vps, hevc_data->vps_size); pos += hevc_data->vps_size; - memcpy(codec->extradata + pos, hevc_data->sps, hevc_data->sps_size); + memcpy(par->extradata + pos, hevc_data->sps, hevc_data->sps_size); pos += hevc_data->sps_size; - memcpy(codec->extradata + pos, hevc_data->pps, hevc_data->pps_size); + memcpy(par->extradata + pos, hevc_data->pps, hevc_data->pps_size); pos += hevc_data->pps_size; - memcpy(codec->extradata + pos, hevc_data->sei, hevc_data->sei_size); + memcpy(par->extradata + pos, hevc_data->sei, hevc_data->sei_size); pos += hevc_data->sei_size; - memset(codec->extradata + pos, 0, AV_INPUT_BUFFER_PADDING_SIZE); + memset(par->extradata + pos, 0, AV_INPUT_BUFFER_PADDING_SIZE); } av_freep(&hevc_data->vps); |