diff options
author | wm4 <wm4@nowhere> | 2016-01-11 20:36:23 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-01-11 20:36:23 +0100 |
commit | 8135838018e0f0822dbec540c427508c44f92fc1 (patch) | |
tree | b32f42ef855a7daf75b70bb24c6822386f9bf14a /demux | |
parent | f54ae2031e8d914783c023dc0491c0a5c62a622d (diff) |
player: eliminate demux_get_next_pts()
This slightly changes behavior when seeking with external audio/subtitle
tracks if transport streams and mpeg files are played, as well as
behavior when seeking with such external tracks.
get_main_demux_pts() is evil because it always blocks on the demuxer (if
there isn't already a packet queued). Thus it could lock up the player,
which is a shame because all other possible causes have been removed.
The reduced "precision" when seeking in the ts/mpeg cases (where
SEEK_FACTOR is used, resulting in byte seeks instead of timestamp seeks)
might lead to issues. We should probably drop this heuristic. (It was
introduced because there is no other way to seek in files with PTS
resets with libavformat, but its value is still questionable.)
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux.c | 16 | ||||
-rw-r--r-- | demux/demux.h | 1 |
2 files changed, 0 insertions, 17 deletions
diff --git a/demux/demux.c b/demux/demux.c index bf8f236f27..d8a3030d33 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -738,22 +738,6 @@ int demux_read_packet_async(struct sh_stream *sh, struct demux_packet **out_pkt) return r; } -// Return the pts of the next packet that demux_read_packet() would return. -// Might block. Sometimes used to force a packet read, without removing any -// packets from the queue. -double demux_get_next_pts(struct sh_stream *sh) -{ - double res = MP_NOPTS_VALUE; - if (sh) { - pthread_mutex_lock(&sh->ds->in->lock); - ds_get_packets(sh->ds); - if (sh->ds->head) - res = MP_ADD_PTS(sh->ds->head->pts, sh->ds->in->ts_offset); - pthread_mutex_unlock(&sh->ds->in->lock); - } - return res; -} - // Return whether a packet is queued. Never blocks, never forces any reads. bool demux_has_packet(struct sh_stream *sh) { diff --git a/demux/demux.h b/demux/demux.h index db3b504c39..d274be5ae7 100644 --- a/demux/demux.h +++ b/demux/demux.h @@ -242,7 +242,6 @@ void demux_add_packet(struct sh_stream *stream, demux_packet_t *dp); struct demux_packet *demux_read_packet(struct sh_stream *sh); int demux_read_packet_async(struct sh_stream *sh, struct demux_packet **out_pkt); bool demux_stream_is_selected(struct sh_stream *stream); -double demux_get_next_pts(struct sh_stream *sh); bool demux_has_packet(struct sh_stream *sh); struct demux_packet *demux_read_any_packet(struct demuxer *demuxer); |