Commit Graph

25 Commits

Author SHA1 Message Date
Ismael Luceno 8682d4de48 Fix sentinels in variadic function calls
Replace sentinel NULL with nullptr, guaranteed to be correctly expanded.

NULL may be defined as plain 0 in C++; which may lead to undefined upper
bits passed in variadic function arguments, causing crashes.

See: https://ewontfix.com/11/
2021-08-23 21:33:46 +01:00
Lukas Prediger d2240ec0ae Device change watchdog timer no longer freezes main thread while CddaSongLoader is active. 2021-06-21 12:51:44 +01:00
Lukas Prediger 6ea20336c2 CddaSongLoader: Only run one song loading thread at once.
- CddaSongLoader destructor waits for thread to end.
- Added flag to interrupt LoadSongsFromCdda
- Only start song loading if not already running
- Removed (now obsolete) mutex
2021-06-21 12:51:44 +01:00
Lukas Prediger d2c636ab46 Introducing CdDevice, simple wrapper for cdio that watches disc changes.
CddaDevice now relies on this to update song list. CddaDevice::Refresh is now a no-op.
2021-06-21 12:51:44 +01:00
Lukas Prediger e756f2d686 CddaSongLoader: explicitly reading discid as UTF8 2021-05-18 12:12:01 +01:00
Lukas Prediger 8d69da28f3 Fixing freeing of memory in cddasongloader 2021-05-18 12:12:01 +01:00
Lukas Prediger 8668699977 CddaSongLoader: handle potential multiple tag messages correctly 2021-05-18 12:12:01 +01:00
Lukas Prediger e9945bcbc6 do NOT free toc entries in CddaSongLoader (reverting previous change) 2021-05-18 12:12:01 +01:00
Lukas Prediger 86bbd2ace6 Formatting/linting fixes. 2021-05-18 12:12:01 +01:00
Lukas Prediger 436c53870a Correctly freeing memory in CddaSongLoader::LoadSongsFromCdda 2021-05-18 12:12:01 +01:00
Lukas Prediger 97800e613a Fix for #7019: CddaSongLoader obtaining metadata on first try. 2021-05-18 12:12:01 +01:00
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +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
Jonas Kvinge 1a2274bd2b Merge branch 'master' into qt5-update 2019-07-21 14:20:59 +02:00
Filip Gawin be827f4f7f Simplify some statements 2019-02-22 18:49:48 +01:00
Jonas Kvinge 1d17bee44a Merge with master and fix conflicts 2019-01-18 01:38:12 +01:00
Jim Broadus 95187ed0a1 Fix encoding of GError messages when logging. (#6228)
GError messages contain non-ascii characters. This normally just produces some garbage when we use the default QString contructor that assumes ASCII for logging. However, when a message includes the right double quote, UTF-8 sequence 0xE2 0x80 0x9D, the final byte is OSC. VT100 expects a command sequence to follow and stops echoing output until it sees ST or BEL character, which may never come. Thus, the console output is halted.

This change uses QString::fromLocal8Bit instead of depending on the default constructor. About half of the sites in the codebase had already been converted.

One side effect is that log messages are quoted. There are additional options to control this, but those were only introduced in Qt 5.4.
2018-12-02 09:51:19 +00:00
Jonas Kvinge c29c2e95cc Fixed merge conflicts 2018-09-30 15:11:06 +02:00
Mattias Andersson 3e53e23bb8 Fix formatting 2018-07-06 17:09:21 +01:00
Mattias Andersson 84f1b7bae0 Load the audio cd in a separate thread 2018-07-06 17:09:21 +01:00
Mattias Andersson 4458d45200 Give the cd device some more time to spin up 2018-07-06 17:09:21 +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
Arnaud Bienner 7ac9e4c6d1 Fix a bug in InsertItems functions that makes Cdda tracks to not be saved/restored correctly when restarting Clementine 2014-10-26 17:08:12 +01:00
Arnaud Bienner 5a7c462fc3 Remove useless includes 2014-10-26 03:37:17 +01:00
Arnaud Bienner dc0d3436c8 Finish CD integration update to Gstreamer 1.0
Move everything related to CDDA to a seperate class, so we can more easily reuse it in SongLoader
2014-10-26 03:32:37 +01:00