summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-04-10 20:58:15 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-04-10 20:59:55 +0100
commit6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch)
tree0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavformat/hlsenc.c
parent60b75186b2c878b6257b43c8fcc0b1356ada218e (diff)
parent9200514ad8717c63f82101dc394f4378854325bf (diff)
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/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index fd36b213fd..a9fa5d8aef 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -296,14 +296,14 @@ static int hls_mux_init(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVStream *st;
AVFormatContext *loc;
- if (s->streams[i]->codec->codec_type == AVMEDIA_TYPE_SUBTITLE)
+ if (s->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE)
loc = vtt_oc;
else
loc = oc;
if (!(st = avformat_new_stream(loc, NULL)))
return AVERROR(ENOMEM);
- avcodec_copy_context(st->codec, s->streams[i]->codec);
+ avcodec_parameters_copy(st->codecpar, s->streams[i]->codecpar);
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
st->time_base = s->streams[i]->time_base;
}
@@ -659,9 +659,9 @@ static int hls_write_header(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
hls->has_video +=
- s->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO;
+ s->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO;
hls->has_subtitle +=
- s->streams[i]->codec->codec_type == AVMEDIA_TYPE_SUBTITLE;
+ s->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE;
}
if (hls->has_video > 1)
@@ -763,7 +763,7 @@ static int hls_write_header(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVStream *inner_st;
AVStream *outer_st = s->streams[i];
- if (outer_st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)
+ if (outer_st->codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE)
inner_st = hls->avf->streams[i];
else if (hls->vtt_avf)
inner_st = hls->vtt_avf->streams[0];
@@ -799,7 +799,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
int ret, can_split = 1;
int stream_index = 0;
- if( st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE ) {
+ if( st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE ) {
oc = hls->vtt_avf;
stream_index = 0;
} else {
@@ -812,9 +812,9 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
}
if (hls->has_video) {
- can_split = st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
+ can_split = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
pkt->flags & AV_PKT_FLAG_KEY;
- is_ref_pkt = st->codec->codec_type == AVMEDIA_TYPE_VIDEO;
+ is_ref_pkt = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO;
}
if (pkt->pts == AV_NOPTS_VALUE)
is_ref_pkt = can_split = 0;
@@ -853,7 +853,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0)
return ret;
- if( st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE )
+ if( st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE )
oc = hls->vtt_avf;
else
oc = hls->avf;