Commit Graph

327 Commits

Author SHA1 Message Date
Jim Broadus 236cfa7adf Don't include cdda code if HAVE_AUDIOCD isn't defined 2020-06-01 22:09:46 +01:00
Jim Broadus 3616a50d83 Don't modify the original request URLs when doing cdda fixup
The current URL is compared againt the unmodified next in some cases.
2020-06-01 22:09:46 +01:00
Jim Broadus 7e3cd84b5d Fix cdda playback
QUrl interprets a single number as an ip address, so the track URL cdda://1
would become cdda://0.0.0.1. A previous fix addresses this issue by adding an
extra character "a" to the affected URLs then removing the last instance of the
character upon usage. However, this didn't apply when a path was present
(cdda:///dev/sr0/1), but would still attempt to reverse the change later
(cdd:///dev/sr0/1).

This change applies the fix-up to all cdda urls and moves the conversion
utilities to a single location.

See: 335bc89c9 ("Workaround for broken CD playback in Qt5 (#6021)")
2020-06-01 22:09:46 +01:00
Jim Broadus 7378e5b141 gstengine: Clean up buffer references in error cases 2020-05-23 11:07:34 +01:00
Jim Broadus 407a99b2fa gstengine: Use proper free function for gstreamer object
Use g_free instead of free for gstreamer allocated string. Ultimately g_free
calls free, but it also adds some glib debug instrumentation.
2020-05-23 11:07:34 +01:00
Jim Broadus 6a5cb0712d gstengine: Fix gtreamer request pad leak
According to the gst_element_request_pad documentation, request pads must be
released after usage. They aren't automatically released and dereferenced when
the element is destroyed.
2020-05-15 11:12:34 +01:00
Jim Broadus 94eb2dcfc1 Preserve auth headers when redirecting.
When redirecting, copy the original request, which may include extra headers.
2020-03-13 10:38:47 +00:00
Jim Broadus 3c7b509d59 Add headers to MediaPlaybackRequest.
Add a name/value map for headers to MediaPlaybackRequest. When adding a new
gst source that accepts extra-headers (souphttpsrc), add these headers.
2020-03-12 18:08:14 +00:00
Jim Broadus 9ed5503ee3 Add MediaPlaybackRequest class.
Add a class to wrap the URL in the playback engines. In the future, this will
contain authentication information for the specified URL. It can also include
the start and end time as well as other data that is currently specified along
with the URL.
2020-03-11 10:57:21 +00:00
Jim Broadus 2c1ae986c5 Create a GstEngine::IsCurrentPipeline helper function for callbacks. 2020-03-09 10:21:07 +00:00
Jim Broadus 5983ecfac0 Scrub gstreamer error strings for url query strings.
Media URLs may include tokens or other auth info.
2020-02-17 20:31:06 +00:00
Jim Broadus d45a9f5c53 Enable debug logging for GstEnginePipeline by default.
Use qLogCat to put verbose GStreamer callback messages into a new
GstEnginePipelineCallbacks category. Filter that category instead of
the entire class by default.
2020-01-31 10:24:53 +00:00
Jim Broadus d3d6c1ff3c Fix UNC paths.
The fix-up for URLs for files that that begin with // no longer works since the
QUrl class determines that these modifications are invalid, resulting in an
empty string when converted. Instead of attempting to modify the QUrl, add a
utility function that makes the correction on the encoded byte array at time of
usage.
2020-01-29 00:38:43 -08:00
John Maguire 28f6bfd898
Merge pull request #6442 from jonaski/probequeue
Switch to queue2 for probe queue and set properties
2019-11-11 23:23:37 +00:00
Jonas Kvinge 2a2a71281a Switch to queue2 for probe queue and set properties 2019-11-11 21:26:11 +01:00
Jonas Kvinge d09c27f719 Remove extra ';' 2019-11-10 00:30:18 +01:00
Dmitry Valter 18c2b41615 Revert "Attempt to fix track change hang"
Queue2 tends to hang up on pause, unable to start playing
again. Pipeline actually stays PLAYING with ASYNC state
change, so it becomes impossible to unpause the player
without stop or forward/backward seeks.

This reverts commit 2b280de663.
2019-11-02 10:16:42 +03:00
John Maguire cb6cd7c485 Merge remote-tracking branch 'origin/master' into qt5 2019-10-04 16:51:43 +01:00
luz.paz fb93ae4b02 Fix misc. source comment typos
Typos found via `codespell`
2019-08-21 23:43:16 -04:00
Jonas Kvinge 66fdc935ac Fix formatting 2019-07-21 14:38:15 +02:00
Jonas Kvinge 1a2274bd2b Merge branch 'master' into qt5-update 2019-07-21 14:20:59 +02:00
Jim Broadus 5c2ceb3490 Fix several gstreamer object leaks.
There are a number of cases where gst_pipeline_get_bus,
gst_element_get_static_pad, and g_object_get are called without releasing
references. In addition to memory usage, some of these elements hold file
descriptors. In normal operation, two file descriptors are leaked for each
played track. The default fd ulimit for many linux distros is 1024. This
is likely the cause of the crash reported in issue 6309.

This change fixes the obvious and consistent leaks, but it's probably not a
complete solution. There are many error and corner conditions that need to be
examined.
2019-03-25 23:22:09 -07:00
Jim Broadus ca8db288d5 Free decoder bin if error occurs during setup.
In the case that an error occurs in ReplaceDecodeBin before the bin is added to
the pipeline, unreference the object to allow cleanup. This change also separates
CreateDecodeBinFromUrl from ReplaceDecodeBin, following the pattern of
CreateDecodeBinFromString.
2019-03-23 22:33:17 -07:00
Jim Broadus 102c529f80 Fix potential use of streamer element after deletion.
If ReplaceDecodeBin fails from TransitionToNext, uridecodebin_ will not be
replaced with a new element. Since TransitionToNext does not check the return
value, it unknowingly deletes uridecodebin_.
2019-03-19 18:47:19 -07:00
Jonas Kvinge 9f946a2898 Improvements to makefiles and make components optional (#6221) 2018-11-29 21:32:12 +00:00
Jonas Kvinge 8c198a99a5 Qt 5 fixes 2018-11-21 10:31:17 +00:00
Jonas Kvinge c29c2e95cc Fixed merge conflicts 2018-09-30 15:11:06 +02:00
Eoin O'Neill 8902776b32 SPC playback fix to prevent end-of-track signal hang.
This fixes an issue with SPC playback where tracks would not properly register End-of-track
notifications when a new track begins.
2018-09-03 01:17:51 -07:00
Mark Furneaux 2b280de663 Attempt to fix track change hang
When switching between tracks with different sample rates, the probe queue blocks before the pipeline can emit EOS.
This prevents the track change from proceeding without manual intervention. This appears to be because the queue
element doesn't handle the rate change correctly (either due to buffer length, or cap negotiation).
The queue2 element however does handle this without blocking indefinitely.
2018-07-09 12:05:48 +01:00
Jonas Kvinge b897651cdb Device fixes for MacOs (#6098)
* Fix setting device for newer MacOs

* Fix setting device if there is an empty description
2018-07-06 10:04:40 +01:00
Jonas Kvinge a5e8eba91c Merge remote-tracking branch 'upstream/master' into qt5-update 2018-06-29 02:38:19 +02:00
Jonas Kvinge 5dbdcca54f Set empty string for sinks with default devices and auto sink 2018-06-14 21:39:16 +01:00
Jonas Kvinge f3aab34d3a Add ALSA Device Finder (#6079) 2018-06-13 09:56:42 +01:00
Jonas Kvinge da648fd08f Fix setting device on windows (#6081) 2018-06-12 09:27:10 +01:00
Jonas Kvinge 925e74f909 Fix crash when uridecodebin fails. (#6077)
Let's the user see the error message what failed instead of Clementine crashing.

Also don't do gst_object_unref unless bin is set.
This fixes GStreamer-CRITICAL gst_object_unref: assertion 'object != NULL' failed
2018-06-06 23:53:25 +01:00
Jonas Kvinge 335bc89c97 Workaround for broken CD playback in Qt5 (#6021)
* Workaround for cdda URL in qUrl()

* Workaround for cdda URL in qUrl()

* Fix code formatting

* Fix code style
2018-03-09 23:09:55 +00:00
Chocobozzz 70f68b1926
Merge remote-tracking branch 'upstream/master' into qt5 2018-02-01 09:50:42 +01:00
benpicco 27bef68cf6 Attempt to reload stream on "Server does not support seeking." error (#5923)
When the network connection changes while playing an HTTP stream, I always get the "Server does not support seeking." error from GStreamer.
It seems like GStreamer tries to seek on reconnect, which fails, an propagates the error to Clementine which in turn ceases playback with
the error message handed through from GStreamer, even though there is now a perfectly fine network connection again.

As a workaround, try to reload the stream when this error occurs.

fixes #5116
2017-12-11 00:13:30 +00:00
Florian Bigard 69b2a832db Merge branch 'master' into qt5 2017-01-18 15:57:07 +01:00
Santiago Gil d3898d2f47 Add dialog to display streams' audio details (#5547)
* Add Stream Details window

* Fix capitalization in StreamDiscoverer::Discover()

* StreamDiscoverer::Discover(): get URL by const reference

* Refactor StreamDiscoverer::Discover

* Rename StreamDiscoverer callbacks

* StreamDiscoverer::OnDiscovered: fix nullptr comparison

* StreamDiscoverer: rename DiscoverFinished signal

* StreamDiscoverer::DataReady: receive const reference

* StreamDiscoverer: Remove unsigned types

* StreamDetailsDialog: rename Close slot

* StreamDetailsDialog: rename ui pointer to ui_

* MainWindow::ShowStreamDetails: receive a const reference

* StreamDetailsDialog: use unique_ptr, remove unsigned types
2016-12-21 16:57:04 +00:00
Santiago Gil 1c0891202d Let the audio sink autonegotiate the bit depth. (Possible fix for #5533) (#5541) 2016-12-21 14:40:40 +00:00
Chocobozzz 18a89f78a9 Merge remote-tracking branch 'upstream/master' into qt5 2016-10-07 14:30:09 +02:00
Mark Furneaux 41d323332a Fix pipeline wit direct output to ALSA
In the new version of gstreamer, alsasink supports floating samples, so it seems to be bypassing audioconvert.
Integer samples make downmixing work correctly.
2016-06-03 11:49:22 -04:00
John Maguire 0beb6d3c59 Remove support for Amazon Cloud Drive. 2016-05-16 18:00:10 +01:00
Mark Furneaux bcf29dc670 Fix caps on audio pipeline
Fixes #1747

The pipeline has the caps for the analyzer applied in the wrong place. This results in the audio output being limited to 16 bit regardless of the input file.
This change also cleans up the mono/sample rate caps as well.
2016-05-15 13:31:00 -04:00
Chocobozzz 0aa3405274 Merge remote-tracking branch 'upstream/master' into qt5 2016-05-09 12:46:08 +02:00
Santi ed7375d7da Add dummy bands to equalizer (Fixes #695) 2016-03-08 15:26:45 -03:00
Chocobozzz ff7026c9fe Merge remote-tracking branch 'upstream/master' into qt5 2015-12-13 20:05:12 +01:00
John Maguire 2d61fe6c87 Changed my mind about automatically passing QFutures. 2015-11-27 12:04:14 +00:00
Arnaud Bienner ec98a68c3d Update SLOT signatures.
There weren't update as part of commit 33494dcddcb64f9fccae215f1100cfa885c72039: this prevented the slider to be updated, among other things.
2015-11-27 11:44:59 +01:00