Commit graph

106 commits

Author SHA1 Message Date
Tim-Philipp Müller
699677ed8a Merge remote-tracking branch 'origin/master' into 0.11 2012-01-13 00:11:54 +00:00
Vincent Penquerc'h
72eb8209a5 hlsdemux: fix queue leak 2012-01-12 15:58:36 +00:00
Vincent Penquerc'h
7521b597f4 various: fix pad template ref leaks
https://bugzilla.gnome.org/show_bug.cgi?id=662664
2011-11-28 13:08:27 +00:00
Wim Taymans
8ec6da7797 more template fixes 2011-11-04 16:41:44 +01:00
Sebastian Dröge
24517ba784 hlsdemux: Fix merge mistake from last commit 2011-09-09 12:27:57 +02:00
Youness Alaoui
55e4206159 hlsdemux: Report the correct timestamp for live streams
Buffers would always start with timestamp 0 and we'd start streaming
from the first buffer, but live streams always start streaming from
the last fragment - 3 fragments in the playlist, which makes its
timestamp, as returned by get_next_fragment, be whatever position
they had in the playlist. This makes sure the position correctly
reports the position of the buffer in the playlist, and added a shifting
variable to allow seeking in the middle of fragments.
2011-09-09 12:21:36 +02:00
Youness Alaoui
894ac8f493 hlsdemux/tsdemux: Add HP copyright on work done on HLS 2011-09-09 12:12:12 +02:00
Youness Alaoui
609bdd6642 hlsdemux: set playlist to NULL after unreffing it to avoid a double-unref in the dispose 2011-09-09 12:11:42 +02:00
Youness Alaoui
84e67767a3 hlsdemux: Do not lock the mutex of the fetcher during EOS
The fetch_location might call stop_fetcher which could generate an EOS
and cause a deadlock
2011-09-09 12:10:56 +02:00
Youness Alaoui
baf875b928 hlsdemux: Do not join the task from the task's thread itself. join it only in the state change 2011-09-07 22:26:47 +02:00
Youness Alaoui
473e71e1ca hlsdemux: If a fetch fails, decrement the sequence number 2011-09-03 09:09:02 +02:00
Youness Alaoui
5aa972eab2 hlsdemux: make hlsdemux lock/unlock the m3u8 client when it accesses it 2011-09-03 09:01:40 +02:00
Youness Alaoui
6133608789 hlsdemux: Add a get_target_duration and get_current_uri api to m3u8_client 2011-09-03 09:00:50 +02:00
Youness Alaoui
a252794a03 hlsdemux: Make the m3u8 client thread-safe 2011-09-03 09:00:35 +02:00
Sebastian Dröge
a82f92aed2 hlsdemux: Reset in PAUSED->READY after chaining up to the parent class
Otherwise there are possible race conditions with the streaming thread.
2011-09-02 19:45:21 +02:00
Sebastian Dröge
0561c3751c hlsdemux: Remove obsolete FIXME comment 2011-09-02 15:00:58 +02:00
Sebastian Dröge
82bbc76f15 hlsdemux: Reset the internal state going to/from READY instead of NULL
This theoretically allows reuse of the element when setting it to READY
instead of NULL.
2011-09-02 14:55:45 +02:00
Sebastian Dröge
445f626016 hlsdemux: Set playlist parsing helper object to NULL after freeing 2011-09-02 14:54:56 +02:00
Youness Alaoui
acacc251fa hlsdemux: Allow up to 3 consecutive failed downloads before erroring
In some networks, especiall in 3G, a fragment download or playlist
update may fail. We allow for up to 3 consecutive failures, while using
the rfc's specs for retry delays before considering that there was an
error on the stream.
2011-09-02 14:52:07 +02:00
Youness Alaoui
8889c5927c hlsdemux: remove unused argument 2011-09-02 14:51:11 +02:00
Sebastian Dröge
cf8f00d57a hlsdemux: Just join the task
gst_task_join() will already stop the task, no need
to stop it additionally.
2011-08-31 14:48:47 +02:00
Sebastian Dröge
119771eaab hlsdemux: Join the task instead of just stopping it and not waiting for it to finish
Fixes interesting race conditions that cause crashes in decodebin2
because pads are added/removed from child elements although they
should be in READY state already.
2011-08-31 14:47:40 +02:00
Sebastian Dröge
c8b7ae1ffa hlsdemux: Remove unused variable 2011-08-31 12:12:59 +02:00
Youness Alaoui
0c97deb59d hlsdemux: switch to higher/lower bitrate by more than one step at a time 2011-08-31 12:12:33 +02:00
Youness Alaoui
6436747eb0 hlsdemux: remove spamming GST_LOG_OBJECT 2011-08-31 12:11:32 +02:00
Youness Alaoui
277a7d05b2 hlsdemux: If paused, do not cache fragments until out of memory error!
We should stop the update thread in PAUSED state and avoid fetching
new fragments when the queue is not empty. The queue should always be
empty since we push data into a queue. Also, in totem, if we seek and
pause the stream while it's buffering, then the state will stay playing
for some reason, so it's best not to continue fetching fragments forever.
2011-08-31 12:11:20 +02:00
Youness Alaoui
917708df82 hlsdemux: start/stop update thread and keep track of status 2011-08-31 12:10:32 +02:00
Youness Alaoui
4724b9a5b6 hlsdemux: Post duration message when we parse the playlist 2011-08-31 12:09:53 +02:00
Youness Alaoui
f93939b46c hlsdemux: Send a flush-stop when switching pads. Fixes A->A/V sync issue.
This is to ensure that we reset the accumulate segment on the sinks
so if we start with audio only then switch to audio+video, then both
sinks will have the same segments and will be synchronized.
2011-08-31 12:09:38 +02:00
Youness Alaoui
ed5a5cc139 hlsdemux: seems there was a typo, free the adapter if it contains data, not if already empty 2011-08-30 16:18:30 +02:00
Youness Alaoui
4a6d888961 hlsdemux: oups, we need to empty the queue after freeing its content 2011-08-30 16:18:08 +02:00
Youness Alaoui
cb30cd242c hlsdemux: do not broadcast the fetcher_cond on bus error if we're cancelled
If we cancel the fetch and call the stop_fetcher, which holds the lock,
when it sets the fetcher's state to NULL, it might send an error
on the bus. In that case, we must ignore it, otherwise it will try
to take the lock and will block forever.
2011-08-30 16:16:54 +02:00
Jonas Larsson
fc0fe37b10 hlsdemux: Split playslist on \r\n not just \n 2011-08-30 16:16:07 +02:00
Youness Alaoui
6e9eeb7678 hlsdemux: Do not succeed a download if the fetcher had an error 2011-08-30 16:15:41 +02:00
Youness Alaoui
e22c300be2 hlsdemux: Rename functions that need to be called with a locked mutex 2011-08-30 16:15:28 +02:00
Youness Alaoui
50d0468241 hlsdemux: We must signal the fetcher_cond while holding its lock 2011-08-30 16:15:03 +02:00
Youness Alaoui
3054355dc1 hlsdemux: We do not need to set the current playlist to the main one
When caching fragments, if we set the current playlist to main, then
it will always think it's a live stream (no endlist in it) so it will
force the redownload of the main playlist after every seek, which is
unnecessary. Also, it causes a race condition where a seek migh happen
during that redownload, and we'll think we're trying to seek a live pipeline.
2011-08-30 16:14:30 +02:00
Youness Alaoui
108493ee51 hlsdemux: do not make the update_thread joinable 2011-08-26 09:51:46 +02:00
Youness Alaoui
8c04ea47d2 hlsdemux: Ensure the task is paused in case of cache error 2011-08-26 09:51:46 +02:00
Youness Alaoui
46ac6a2589 hlsdemux: stop the threads in the proper order
first pause the task, then stop all fetchers, then stop the update thread
then pause the task again, since it might have been restarted by
another thread in the meantime
2011-08-26 09:51:46 +02:00
Youness Alaoui
015d1e11e2 hlsdemux: do not post an error if we seek/cancel during caching of fragments 2011-08-26 09:51:46 +02:00
Youness Alaoui
d69297a23c hlsdemux: if we're canceling a fetcher, we must stop its thread 2011-08-26 09:51:46 +02:00
Youness Alaoui
42401da686 hlsdemux: lock the update_thread mutex before stopping it 2011-08-26 09:51:46 +02:00
Youness Alaoui
39657fa52f hlsdemux: lock the fetcher mutex before stopping it 2011-08-26 09:51:45 +02:00
Youness Alaoui
e1a0bdcdf5 hlsdemux: do not allow two fetchers to run simultanously 2011-08-26 09:51:45 +02:00
Youness Alaoui
adcfcabb14 hlsdemux: Stop the streaming task on PAUSED_TO_READY state change 2011-08-26 09:51:45 +02:00
Youness Alaoui
a3fc3ec443 hlsdemux: Send buffering messages on the bus 2011-08-24 08:12:19 +02:00
Youness Alaoui
e2de4e5870 hlsdemux: cache the number of fragments we are required to cache 2011-08-24 08:12:14 +02:00
Sebastian Dröge
20f9738c10 hlsdemux: Use FALSE instead of 0 for a bool parameter 2011-08-23 09:23:33 +02:00
Youness Alaoui
3f42050c34 hlsdemux: switch pads when we seek (need_segment) since tsdemux doesn't cope well with a reset 2011-08-23 09:22:40 +02:00