From fa74be880c27b350615f62dd4a0d6a32be56c60e Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 11 Jul 2013 19:17:05 +0200 Subject: tv: add hack in preparation of demux_stream removal Currently, all demuxer fill_buffer functions have a demux_stream parameter. We want to remove that, but the TV code still depends on it. Add a hack to remove that dependency. The problem with the TV code is that reading video and audio frames blocks, so in order to avoid a deadlock, you should read either of them only if the decoder actually requests new data. --- demux/demux.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'demux/demux.c') diff --git a/demux/demux.c b/demux/demux.c index 16adfeb795..df68d4ead7 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -559,6 +559,13 @@ bool demux_has_packet(struct sh_stream *sh) return ds && ds->head; } +// Same as demux_has_packet, but to be called internally by demuxers, as +// opposed to the user of the demuxer. +bool demuxer_stream_has_packets_queued(struct demuxer *d, struct sh_stream *stream) +{ + return demux_has_packet(stream); +} + // ==================================================================== void demuxer_help(void) -- cgit v1.2.3