mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
Enable generic index/seeking for mgsts demuxer.
This depends on the proposed parser change for 0-size packets in previous mail, otherwise video now plays far too fast. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
parent
699c61d2f0
commit
60497cb984
@ -50,6 +50,7 @@ static int read_header(AVFormatContext *s)
|
|||||||
if (!st)
|
if (!st)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
|
st->need_parsing = AVSTREAM_PARSE_HEADERS;
|
||||||
st->start_time = 0;
|
st->start_time = 0;
|
||||||
st->nb_frames =
|
st->nb_frames =
|
||||||
st->duration = avio_rb32(pb);
|
st->duration = avio_rb32(pb);
|
||||||
@ -88,6 +89,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
pkt->pos -= 16;
|
||||||
pkt->duration = 1;
|
pkt->duration = 1;
|
||||||
avio_skip(pb, chunk_size - (ret + 16));
|
avio_skip(pb, chunk_size - (ret + 16));
|
||||||
|
|
||||||
@ -100,4 +102,5 @@ AVInputFormat ff_mgsts_demuxer = {
|
|||||||
.read_probe = read_probe,
|
.read_probe = read_probe,
|
||||||
.read_header = read_header,
|
.read_header = read_header,
|
||||||
.read_packet = read_packet,
|
.read_packet = read_packet,
|
||||||
|
.flags = AVFMT_GENERIC_INDEX,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user