asfdemux: Fix prerolling files with "empty" streams
authorEdward Hervey <edward@centricular.com>
Mon, 13 Nov 2017 10:13:30 +0000 (11:13 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Mon, 13 Nov 2017 10:13:30 +0000 (11:13 +0100)
commitf86751d9f7a90ceea7a331edb5f54b314e7e3dd3
tree42ea2e8cd3e90df3b9b32b00876556f3d19cc67b
parent2d9867b120bab04daec9ff20d1673ee7af52aada
asfdemux: Fix prerolling files with "empty" streams

This is a regression that was introduced by
commit 1803b3c18530cb0100d140c2b8e49a8dfe41f941
"    asfdemux: Add support for dvr-ms"

The problem is that some files/streams might contain stream definition
but there is no actual packets for those streams.

This was used to "define" streams with different bitrates for example.

The first_ts calculation resulted in never ever finding a valid first_ts
since some streams were empty, and therefore never "activating" itself.

Instead of that we first check if we are prerolled. And if we are we
unconditionally get the "first_ts"

The preroll check has been adapted to check whether streams of
each defined type (i.e. audio/video/sub) has been prerolled. This solves
the problem of having different streams of a particular type where only
one stream actually has data.
gst/asfdemux/gstasfdemux.c