summaryrefslogtreecommitdiff
path: root/libavformat/segment.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/segment.c
parent60b75186b2c878b6257b43c8fcc0b1356ada218e (diff)
parent9200514ad8717c63f82101dc394f4378854325bf (diff)
downloadffmpeg-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/segment.c')
-rw-r--r--libavformat/segment.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 9527c87667..6d693f8886 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -165,19 +165,19 @@ static int segment_mux_init(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVStream *st;
- AVCodecContext *icodec, *ocodec;
+ AVCodecParameters *ipar, *opar;
if (!(st = avformat_new_stream(oc, NULL)))
return AVERROR(ENOMEM);
- icodec = s->streams[i]->codec;
- ocodec = st->codec;
- avcodec_copy_context(ocodec, icodec);
+ ipar = s->streams[i]->codecpar;
+ opar = st->codecpar;
+ avcodec_parameters_copy(opar, ipar);
if (!oc->oformat->codec_tag ||
- av_codec_get_id (oc->oformat->codec_tag, icodec->codec_tag) == ocodec->codec_id ||
- av_codec_get_tag(oc->oformat->codec_tag, icodec->codec_id) <= 0) {
- ocodec->codec_tag = icodec->codec_tag;
+ av_codec_get_id (oc->oformat->codec_tag, ipar->codec_tag) == opar->codec_id ||
+ av_codec_get_tag(oc->oformat->codec_tag, ipar->codec_id) <= 0) {
+ opar->codec_tag = ipar->codec_tag;
} else {
- ocodec->codec_tag = 0;
+ opar->codec_tag = 0;
}
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
st->time_base = s->streams[i]->time_base;
@@ -408,7 +408,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last)
if (tcr) {
/* search the first video stream */
for (i = 0; i < s->nb_streams; i++) {
- if (s->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (s->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
rate = s->streams[i]->avg_frame_rate;/* Get fps from the video stream */
err = av_timecode_init_from_string(&tc, rate, tcr->value, s);
if (err < 0) {
@@ -592,7 +592,7 @@ static int select_reference_stream(AVFormatContext *s)
/* select first index for each type */
for (i = 0; i < s->nb_streams; i++) {
- type = s->streams[i]->codec->codec_type;
+ type = s->streams[i]->codecpar->codec_type;
if ((unsigned)type < AVMEDIA_TYPE_NB && type_index_map[type] == -1
/* ignore attached pictures/cover art streams */
&& !(s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC))
@@ -715,7 +715,7 @@ static int seg_init(AVFormatContext *s)
goto fail;
av_log(s, AV_LOG_VERBOSE, "Selected stream id:%d type:%s\n",
seg->reference_stream_index,
- av_get_media_type_string(s->streams[seg->reference_stream_index]->codec->codec_type));
+ av_get_media_type_string(s->streams[seg->reference_stream_index]->codecpar->codec_type));
seg->oformat = av_guess_format(seg->format, s->filename, NULL);