Commit 3726d07a authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '28816050'

* commit '28816050':
  lavf: Set the stream time base hint properly for chained muxers

Conflicts:
	libavformat/segment.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 4db0e8fd 28816050
...@@ -405,6 +405,7 @@ static int hds_write_header(AVFormatContext *s) ...@@ -405,6 +405,7 @@ static int hds_write_header(AVFormatContext *s)
} }
avcodec_copy_context(st->codec, s->streams[i]->codec); avcodec_copy_context(st->codec, s->streams[i]->codec);
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio; st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
st->time_base = s->streams[i]->time_base;
} }
if (c->streams[c->nb_streams].ctx) if (c->streams[c->nb_streams].ctx)
c->nb_streams++; c->nb_streams++;
......
...@@ -101,6 +101,7 @@ static int hls_mux_init(AVFormatContext *s) ...@@ -101,6 +101,7 @@ static int hls_mux_init(AVFormatContext *s)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
avcodec_copy_context(st->codec, s->streams[i]->codec); avcodec_copy_context(st->codec, s->streams[i]->codec);
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio; st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
st->time_base = s->streams[i]->time_base;
} }
hls->start_pos = 0; hls->start_pos = 0;
......
...@@ -721,6 +721,7 @@ static int mpegts_write_header(AVFormatContext *s) ...@@ -721,6 +721,7 @@ static int mpegts_write_header(AVFormatContext *s)
ret = avcodec_copy_context(ast->codec, st->codec); ret = avcodec_copy_context(ast->codec, st->codec);
if (ret != 0) if (ret != 0)
goto fail; goto fail;
ast->time_base = st->time_base;
ret = avformat_write_header(ts_st->amux, NULL); ret = avformat_write_header(ts_st->amux, NULL);
if (ret < 0) if (ret < 0)
goto fail; goto fail;
......
...@@ -162,6 +162,7 @@ static int segment_mux_init(AVFormatContext *s) ...@@ -162,6 +162,7 @@ static int segment_mux_init(AVFormatContext *s)
ocodec->codec_tag = 0; ocodec->codec_tag = 0;
} }
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio; st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
st->time_base = s->streams[i]->time_base;
av_dict_copy(&st->metadata, s->streams[i]->metadata, 0); av_dict_copy(&st->metadata, s->streams[i]->metadata, 0);
} }
......
...@@ -343,6 +343,7 @@ static int ism_write_header(AVFormatContext *s) ...@@ -343,6 +343,7 @@ static int ism_write_header(AVFormatContext *s)
} }
avcodec_copy_context(st->codec, s->streams[i]->codec); avcodec_copy_context(st->codec, s->streams[i]->codec);
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio; st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
st->time_base = s->streams[i]->time_base;
ctx->pb = avio_alloc_context(os->iobuf, sizeof(os->iobuf), AVIO_FLAG_WRITE, os, NULL, ism_write, ism_seek); ctx->pb = avio_alloc_context(os->iobuf, sizeof(os->iobuf), AVIO_FLAG_WRITE, os, NULL, ism_write, ism_seek);
if (!ctx->pb) { if (!ctx->pb) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment