Commit graph

2362 commits

Author SHA1 Message Date
Guillaume Desmottes
e9a6cafa13 basetextoverlay: fix buffer leak in chain function
If we don't consume the buffer by passing its reference to
overlay->text_buffer then we need to unref it.

Fix a leak with validate.file.playback.fast_forward.test5_mkv
when running inside Valgrind.

https://bugzilla.gnome.org/show_bug.cgi?id=747602
2015-04-10 10:12:19 +01:00
Vincent Penquerc'h
a44258dbe8 oggdemux: fix wrong duration on partial streams with a skeleton index
When a stream has a skeleton index, the stream time is taken from that
index. However, when part of the stream is captured, the index is
invalid as its offsets are now wrong. To avoid this, we ignore the index
when the last offset points beyond the end of the stream (when its
byte length is known).

https://bugzilla.gnome.org/show_bug.cgi?id=744070
2015-04-03 16:40:04 +01:00
Vincent Penquerc'h
b247001aa9 textoverlay: fix disappearing text with high deltax
When deltax is large enough to cause the text to push past the
width of the frame, it would disappear due to a bug in setting
the layout width.

While there, fix a log printing an incorrect width to set.

https://bugzilla.gnome.org/show_bug.cgi?id=739689
2015-04-03 16:14:23 +01:00
Vincent Penquerc'h
b590a843f4 oggmux: fix deadlock when not pulling a buffer from collectpads
oggmux keeps a cached buffer per pad, and pulls buffers from
collectpads to this cached buffer for all pads before processing
the best pad. In some cases, the move from collectpads buffer
to cached buffer is delayed till next call. However, when there
is only one pad, this can't be delayed till next call as there
will be a deadlock since collectpads has no other pad to push to.

https://bugzilla.gnome.org/show_bug.cgi?id=740565
2015-04-03 15:52:54 +01:00
Guillaume Desmottes
452d7b04e3 oggdemux: don't use GST_ERROR() for debug messages
Fix https://bugzilla.gnome.org/show_bug.cgi?id=746457
2015-04-01 16:06:42 +01:00
Mark Nauwelaerts
d1f91723be oggdemux: resurrect some flow return handling
https://bugzilla.gnome.org/show_bug.cgi?id=744572
2015-03-29 13:51:05 +02:00
Nicolas Dufresne
6ba8d385e3 Revert "theoradec: Disable usage of crop meta"
This reverts commit da52868f46.
2015-03-24 15:47:20 -04:00
Nicolas Dufresne
da52868f46 theoradec: Disable usage of crop meta
This is a temporary workaround that simply disables usage of crop
meta for now.

https://bugzilla.gnome.org/show_bug.cgi?id=741030
2015-03-24 14:36:12 -04:00
Wonchul Lee
b45941219e oggdemux: Fix compiler warning
gstoggdemux.c:1233:11: error: format specifies type 'long' but the argument has type 'ogg_int64_t' (aka 'long long') [-Werror,-Wformat]
          granule);
          ^~~~~~~

https://bugzilla.gnome.org/show_bug.cgi?id=746512
2015-03-23 09:15:02 +01:00
Vincent Penquerc'h
1ee2fccfdf oggdemux: fix playback regression on streams with clipped data at start
The code that was calculating the start granule from packet durations
was interpreting a negative value as an error, but this is actually a
valid case, to indicate clipping of data at start.

https://bugzilla.gnome.org/show_bug.cgi?id=743900
2015-03-16 11:59:19 +00:00
Vincent Penquerc'h
c47004d3db oggdemux: recover from EOS when searching for chain in push mode
If we get EOS when we're trying to build a chain, we disable seeking
and continue instead of posting an error. This can happen for corner
cases such as a stream with a video that stops before the end, for
instance.

https://bugzilla.gnome.org/show_bug.cgi?id=745980
2015-03-12 14:53:32 +00:00
Vincent Penquerc'h
87fd62811d oggdemux: fix seeking in files with a "missing" stream
When looking for pages when seeking, we stop looking for non sparse
streams if we don't find one within a given threshold. This fixes
seeking filling up queues and blocking in corner cases such as an
audio file with a pathological 1 frame video stream (yes, I saw one).

https://bugzilla.gnome.org/show_bug.cgi?id=745980
2015-03-12 14:53:27 +00:00
Jan Schmidt
9a541157cf theoradec: Fix decoding in the presence of GstVideoCropMeta
Store the video info of the internal frame decode width/height
separate to the exposed (cropped) frame info, so that it can be
used for mapping the downstream allocated video frame buffer correctly
when using GstVideoCropMeta.

Fixes playback of files with sizes that aren't a multiple of 16-pixels
width or height.

https://bugzilla.gnome.org/show_bug.cgi?id=741030
2015-03-12 22:38:37 +11:00
Vincent Penquerc'h
e77b60a73f oggdemux: do not send seek events from the streaming thread
This will usually deadlock, despite this patch being in master for
quite some time and working fine. Nevertheless, we deem it to be
not working, disregarding facts.

As such, we fix it by keeping track of seek events, and sending
them upstream from a separate thread. Buffers are then discarded
till we get a new segment with the expected seqnum.
2015-03-11 14:40:49 +00:00
Vincent Penquerc'h
5f3fc5db05 oggdemux: set correct seqnum on segment events after a seek in push mode
There is already a seqnum field for this, which was used to overwrite
the seqnum that was set by the push specific code.
2015-03-11 12:04:23 +00:00
Vincent Penquerc'h
acaf534714 oggdemux: try harder to query duration from upstream
READY->PAUSED can be too early as souphttpsrc can get the HTTP
headers after this. Try again in the chain function.

Also use seeking query to disable seeking if upstream reports
being unseekable.
2015-03-11 12:04:23 +00:00
Vincent Penquerc'h
969cf47a82 oggdemux: add non flushing time seeking in push mode
Some resetting code has to be done in the NEW_SEGMENT
event handler, instead of the missing FLUSH_STOP one.

Segment base was also wrongly accounted for. This was hidden
by the fact that flushing resets the base.

A discontinuity is now also signalled on seeking. We have to
also ensure that the discontinuity "sticks" till a buffer
with a valid timestamp goes out, or the audio decoder base
class will ignore the discontinuity for purposes of keeping
track of the current time.

This allows using non flushing segment seeks for looping
HTML audio in particular, and more generally non flushing seeks.

https://bugzilla.gnome.org/show_bug.cgi?id=729198
2015-03-11 12:04:23 +00:00
Vincent Penquerc'h
ca136e3648 oggdemux: fix wrong first granule
The code was using the first nonnegative granulepos to seed the
granule tracking, which appeared to work since headers have zero
granulepos. However, this does not work for files with a hole at
start, which are common in live streaming.

The correct behavior is to look for the first granule, and subtract
the duration of all the packets finishing on this page.

The function which does this relies on the fact that the ogg_stream
structure can be duplicated by shallow copy, in order to pull the
packets from the first page(s) on the copy without affecting the
original stream state.
2015-03-11 12:04:23 +00:00
Tim-Philipp Müller
c53ba4beeb Fix double semicolons 2015-03-10 09:27:08 +00:00
Nicolas Dufresne
ace35b78ee textoverlay: Re-render if video size changed
https://bugzilla.gnome.org/show_bug.cgi?id=745554
2015-03-03 16:38:33 -05:00
Tim-Philipp Müller
725906bb71 audiovisualizer: don't use private GMutex implementation details
Don't use private GMutex implementation details to check
whether it has been freed already or not. Just turn dispose
function into finalize function which will only be called
once, that way we can just clear the mutex unconditionally.
2015-02-16 23:54:28 +00:00
Jan Schmidt
f04afa938f oggmux: Don't pass GstCollectData as a GstObject to GST_DEBUG 2015-02-07 04:08:38 +11:00
Jan Schmidt
d3f6d2b887 oggdemux: Add a little timestamping debug output 2015-02-06 04:05:27 +11:00
Jan Schmidt
f852f3bc75 theora: If no header packets in stream, look for them in the caps
Makes theora work in cases where the header packets are only in the caps
(because theoradec was connected to oggdemux late and missed the
beginning of the stream)
2015-02-06 04:05:27 +11:00
Jan Schmidt
615118dea8 theora: Remove FIXME and return GST_CUSTOM_FLOW_DROP for header packet handling
This FIXME is easily fixed :)
2015-02-06 04:05:27 +11:00
Vincent Penquerc'h
9491157f1a oggdemux: do not throw a flow error on flushing
If the streaming task attempts to read a chain while the pipeline
is stopping (which can happen if the pipeline stops shortly after
start or a new URI being setup in gapless playback case), it will
see a flushing return from upstream, and should then also return
flushing to the caller, rather than emit a flow error.

https://bugzilla.gnome.org/show_bug.cgi?id=722442
2015-01-29 17:58:27 +00:00
Luis de Bethencourt
945afe6cc4 visual: fix caps leak
Fix leak of caps event and of caps objects when setting caps on sink and src
pads. Sync audiovisualizer class implementation to the one in gst-plugins-bad.
This commit matches c5ef1bee73 in that module.

https://bugzilla.gnome.org/show_bug.cgi?id=742875
2015-01-21 15:22:15 +00:00
Luis de Bethencourt
684e5e0c87 visual: post QoS messages when dropping frames due to QoS
https://bugzilla.gnome.org/show_bug.cgi?id=742875
2015-01-21 14:47:19 +00:00
Sebastian Dröge
2bd4ea6e8e Constify some static arrays everywhere 2015-01-21 09:49:47 +01:00
Sebastian Dröge
69e338d7dd alsa: Constify channel position table 2015-01-21 09:42:35 +01:00
Sebastian Dröge
8e6fb92886 alsa: Fix indention 2015-01-21 09:42:35 +01:00
Thomas Roos
485ad66a11 alsa: Allow to use 8 bit samples with ALSA
8 bit samples have no (0) as endianness, not the native endianness.

https://bugzilla.gnome.org/show_bug.cgi?id=739446
2015-01-21 09:42:35 +01:00
Vincent Penquerc'h
fbff44711a oggmux: fix clipped duration determination for non 0 based segments
https://bugzilla.gnome.org/show_bug.cgi?id=740422
2015-01-16 15:55:10 +00:00
Luis de Bethencourt
4d6f318fc9 visual: cleanup
Shameful fix to a silly mistake in the previous commit. Above email address for
any mockery
2015-01-13 16:58:34 +00:00
Luis de Bethencourt
1bb169410e visual: handle the return of the setup function
Make the baseclass future proof by handling the gboolean return of the setup
function. So if/when a child class uses this the base class is ready.
2015-01-13 16:36:09 +00:00
Luis de Bethencourt
d3a73827e0 Revert "visual: remove unnecessary variable"
This reverts commit a91d521a36.

Being a base class it is better to check the value instead of ignoring it since
a child class could be created that returns valuable information.
2015-01-13 16:09:49 +00:00
Luis de Bethencourt
a91d521a36 visual: remove unnecessary variable
klass->setup (scope) will always return TRUE since all children of this class
do so, no need to store the return. Besides, the value is overwritten a few
lines down before it is ever used. Save the unnecessary memory and instructions.

CID #1226467
2015-01-13 15:14:38 +00:00
Luis de Bethencourt
7cc048f4df visual: use unused value
ret is assigned but not used and in the next cycle of the loop it is overwritten
with default_prepare_output_buffer (). If there is a flow error the function
should return instead.

CID #1226475
2015-01-12 15:27:18 +00:00
Tim-Philipp Müller
cd45983e86 oggmux: remove unused enum 2015-01-02 15:27:23 +00:00
Tim-Philipp Müller
a4f0be6e33 oggmux: fix silly GQueue iteration code 2015-01-02 15:17:58 +00:00
Thiago Santos
68fcf7ef52 oggmux: only clip by duration if end of buffer is ahead of segment
It might happen that the timestamp is before the segment and the
check would succeed. In this case reducing the duration makes no
sense and would lead to broken results.
2014-12-26 18:56:09 -03:00
Sebastian Dröge
46251a7bef pango: Add license/copyright header to header file 2014-12-15 10:35:35 +01:00
Mathieu Duponchelle
4e228e0a1f oggdemux: Fix seeking before the first frame.
The previous code was setting keytarget to target
to make sure the keyframe found for each pad was
indeed before the target.

Then if target == keytarget, it assumed a keyframe had been
found, which was not the case if target was before the first frame
in the file.

This patch checks that a keyframe was indeed found, and if not
seeks to 0, without bisecting again.

Assuming default gst qa assets in $HOME/gst-validate

seek_before_first_frame.scenario:

description, seek=true, handles-states=true
pause, playback-time=0.0
seek, playback-time=0.0, start=0.0, flags=accurate+flush
seek, playback-time=0.0, start=0.01, flags=accurate+flush
seek, playback-time=0.0, start=0.1, flags=accurate+flush

GST_DEBUG=*theoradec*:2 gst-validate-1.0 playbin \
uri=file://$HOME/gst-validate/gst-qa-assets/medias/ogg/vorbis_theora.0.ogg \
--set-scenario seek_before_first_frame.scenario

https://bugzilla.gnome.org/show_bug.cgi?id=741097
2014-12-05 10:13:57 +01:00
Thomas Klausner
a4b94e6c69 alsa: Use EPIPE instead of ESTRPIPE if the latter does not exist
NetBSD does not have ESTRPIPE.

https://bugzilla.gnome.org/show_bug.cgi?id=740952
2014-12-01 09:51:12 +01:00
Sebastian Dröge
90eb93c2ef Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.
2014-12-01 09:51:12 +01:00
Tim-Philipp Müller
b6d49d2a12 alsasrc: debug message fixes
In the same vein as 74e9640a.
2014-11-25 22:01:08 +00:00
Tim-Philipp Müller
6306cce41e timeoverlay: add "time-line" property
So we can also show running time or stream time, not just the
buffer time stamps.
2014-11-25 14:52:47 +00:00
Branislav Katreniak
5e8e6276cd alsa: Change the log messages in xrun_recovery() from DEBUG to WARNING
xrun_recovery() runs when there is an error

https://bugzilla.gnome.org/show_bug.cgi?id=740615
2014-11-24 15:30:32 +00:00
Tim-Philipp Müller
46e727ebde Revert "basetextoverlay: Fix segfault when overlay outside the frame"
This is not correct. overlay->silent is a property and we
should not just flip the property forever because one text
we render is outside of the frame. The next one might not
be, the positioning properties can be changed after all.

The lower layers should handle clipping, and now do.

This reverts commit 1cc311156c.

https://bugzilla.gnome.org/show_bug.cgi?id=738984
https://bugzilla.gnome.org/show_bug.cgi?id=739281
2014-11-17 09:49:54 +00:00
Tim-Philipp Müller
a003423bc3 Revert "basetextoverlay: segfault when xpos >= video size"
This is not right, even if it might avoid a crash. We don't
want to just set xpos/ypos to 0 in those cases. Clipping
should be done properly, see bug #739281 for that.

This reverts commit 900d0267d5.

https://bugzilla.gnome.org/show_bug.cgi?id=738984
https://bugzilla.gnome.org/show_bug.cgi?id=739281
2014-11-17 09:48:42 +00:00