demux_lavf: set stream_pts

demux_mpg did the same, and doing this in demux_lavf fixes DVD playback
when using this demuxer.

Additionally this might make bluray work better in the future (but for
now, bluray playback doesn't change as it doesn't report stream PTS yet).
This commit is contained in:
wm4 2013-05-03 20:30:08 +02:00
parent 4ba4d6ef3f
commit 4ed22795bb
1 changed files with 6 additions and 0 deletions

View File

@ -640,6 +640,12 @@ static int demux_lavf_fill_buffer(demuxer_t *demux, demux_stream_t *dsds)
}
dp->pos = demux->filepos;
dp->keyframe = pkt->flags & AV_PKT_FLAG_KEY;
// Use only one stream for stream_pts, otherwise PTS might be jumpy.
if (stream->type == STREAM_VIDEO) {
double pts;
if (stream_control(demux->stream, STREAM_CTRL_GET_CURRENT_TIME, &pts) > 0)
dp->stream_pts = pts;
}
demuxer_add_packet(demux, stream, dp);
return 1;
}