We should instead be counting the number of errors and exiting if
they're too numerous. This makes a number of broken ASF files playable.
https://bugzilla.gnome.org/show_bug.cgi?id=678543
Conflicts:
gst/asfdemux/asfpacket.c
gst/asfdemux/gstasfdemux.c
Also ensure we get a proper EOS when seeking past the end of the
file, or (when the snap after flag is set) between the last keyframe
and the end of the file.
Two things were suboptimal from a performance point of view:
a) consider a large media object such as a video keyframe, which
may be split up into multiple fragments. We would assemble
the media object as follows:
buf = join (join (join (frag1, frag2), frag3), frag4)
which causes many unnecessary memcpy()s, and malloc/free,
which could easily add up to a multiple of the actual object
size. To avoid this, we allocate a buffer of the size needed
from the start and copy fragments into that directly.
b) for every fragment to join, we would create a sub-buffer
before joining it (which would discard the sub-buffer again),
leading to unnecessary miniobject create/free churn.
Conflicts:
gst/asfdemux/asfpacket.c
gst/asfdemux/asfpacket.h
We have already retrieved the stream for that stream number and
made sure it's not NULL, so no need to do it again here; neither
the number nor the streams changed since the last time.
Add private replacements for deprecated functions such as
g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly
to avoid the deprecation warnings. We can't change most of
these in 0.10 because they're part of our API and ABI.
Suppress deprecation warnings in selected files, mostly for
g_static_rec_mutex_*. StaticRecMutex is part of our API/ABI,
not much we can do here in 0.10.