mirror of https://git.ffmpeg.org/ffmpeg.git
hls: Copy the time base from the chained demuxer
When a variant stream isn't mpegts but e.g. raw adts, the default time base (90k) isn't correct. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
eb33ba04e0
commit
82bf8c8783
|
@ -530,11 +530,13 @@ static int hls_read_header(AVFormatContext *s)
|
||||||
/* Create new AVStreams for each stream in this variant */
|
/* Create new AVStreams for each stream in this variant */
|
||||||
for (j = 0; j < v->ctx->nb_streams; j++) {
|
for (j = 0; j < v->ctx->nb_streams; j++) {
|
||||||
AVStream *st = avformat_new_stream(s, NULL);
|
AVStream *st = avformat_new_stream(s, NULL);
|
||||||
|
AVStream *ist = v->ctx->streams[j];
|
||||||
if (!st) {
|
if (!st) {
|
||||||
ret = AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
st->id = i;
|
st->id = i;
|
||||||
|
avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den);
|
||||||
avcodec_copy_context(st->codec, v->ctx->streams[j]->codec);
|
avcodec_copy_context(st->codec, v->ctx->streams[j]->codec);
|
||||||
if (v->bandwidth)
|
if (v->bandwidth)
|
||||||
av_dict_set(&st->metadata, "variant_bitrate", bitrate_str,
|
av_dict_set(&st->metadata, "variant_bitrate", bitrate_str,
|
||||||
|
|
Loading…
Reference in New Issue