summaryrefslogtreecommitdiffstats
path: root/stream/stream_radio.c
Commit message (Collapse)AuthorAgeFilesLines
* Use O_CLOEXEC when creating FDswm42013-11-301-2/+5
| | | | | | | | | | | | | | This is needed so that new processes (created with fork+exec) don't inherit open files, which can be important for a number of reasons. Since O_CLOEXEC is relatively new (POSIX.1-2008, before that Linux specific), we #define it to 0 in io.h to prevent compilation errors on older/crappy systems. At least this is the plan. input.c creates a pipe. For that, add a mp_set_cloexec() function (which is based on Weston's code in vo_wayland.c, but more correct). We could use pipe2() instead, but that is Linux specific. Technically, we have a race condition, but it won't matter.
* Reduce stheader.h includes, move stream types to mp_common.hwm42013-11-231-1/+0
|
* stream: don't include linux/types.h in some fileswm42013-11-131-2/+0
| | | | | | Apparently this is not portable to FreeBSD. It turns out that we (probably) don't use any symbols defined by this header directly, so the includes are not needed.
* configure: uniform the defines to #define HAVE_xxx (0|1)Stefano Pigozzi2013-11-031-20/+20
| | | | | | | | | | | | | | | | | | | | | The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
* stream: fix url_options field, make protocols field not fixed lengthwm42013-08-261-7/+7
| | | | | | | | | | | | | | | | | | | | The way the url_options field was handled was not entirely sane: it's actually a flexible array member, so it points to garbage for streams which do not initialize this member (it just points to the data right after the struct, which is garbage in theory and practice). This was not actually a problem, since the field is only used if priv_size is set (due to how this stuff is used). But it doesn't allow setting priv_size only, which might be useful in some cases. Also, make the protocols array not a fixed size array. Most stream implementations have only 1 protocol prefix, but stream_lavf.c has over 10 (whitelists ffmpeg protocols). The high size of the fixed size protocol array wastes space, and it is _still_ annoying to add new prefixes to stream_lavf (have to bump the maximum length), so make it arbitrary length. The two changes (plus some more cosmetic changes) arte conflated into one, because it was annoying going over all the stream implementations.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-2/+2
| | | | Followup commit. Fixes all the files references.
* stream_radio: fix some thingswm42013-08-051-2/+2
| | | | | | | | | Using the radio set/step channel commands would have crashed (that was broken for about a year, nobody ever noticed). The "capture" part of a radio:// URI was incorrectly passed (this was broken quite recently). Still couldn't test it fully. I have no radio device. I suspect nobody uses this feature or will ever use it again.
* stream: redo URL parsing, replace m_struct usage with m_configwm42013-08-021-18/+15
| | | | | | | | | | | | | Move the URL parsing code from m_option.c to stream.c, and simplify it dramatically. This code originates from times when http code used this, but now it's just relict from other stream implementations reusing this code. Remove the unused bits and simplify the rest. stream_vcd is insane, and the priv struct is different on every platform, so drop the URL parsing. This means you can't specify a track anymore, only the device. (Does anyone use stream_vcd? Not like this couldn't be fixed, but it doesn't seem worth the effort, especially because it'd require potentially touching platform specific code.)
* stream: remove useless author/comment fieldswm42013-07-121-4/+1
| | | | | | | | | These were printed only with -v. Most streams had them set to useless or redundant values, so it's just badly maintained bloat. Since we remove the "author" field too, and since this may have copyright implications, we add the contents of the author fields to the file headers, except if the name is already part of the file header.
* core: change open_stream and demux_open signaturewm42013-07-121-2/+3
| | | | | | | | | | | This removes the dependency on DEMUXER_TYPE_* and the file_format parameter from the stream open functions. Remove some of the playlist handling code. It looks like this was needed only for loading linked mov files with demux_mov (which was removed long ago). Delete a minor bit of dead network-related code from stream.c as well.
* stream_radio: fix buildwm42013-07-081-0/+4
| | | | | | | This was accidentally broken with 37c5c11 and has been nroken for 5 months. Does anyone (want to) use this at all?
* cache: make the stream cache a proper stream that wraps other streamswm42013-06-161-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, the cache was franken-hacked on top of the stream API. You had to use special functions (like cache_stream_fill_buffer() instead of stream_fill_buffer()), which would access the stream in a cached manner. The whole idea about the previous design was that the cache runs in a thread or in a forked process, while the cache awa functions made sure the stream instance looked consistent to the user. If you used the normal functions instead of the special ones while the cache was running, you were out of luck. Make it a bit more reasonable by turning the cache into a stream on its own. This makes it behave exactly like a normal stream. The stream callbacks call into the original (uncached) stream to do work. No special cache functions or redirections are needed. The only different thing about cache streams is that they are created by special functions, instead of being part of the auto_open_streams[] array. To make things simpler, remove the threading implementation, which was messed into the code. The threading code could perhaps be kept, but I don't really want to have to worry about this special case. A proper threaded implementation will be added later. Remove the cache enabling code from stream_radio.c. Since enabling the cache involves replacing the old stream with a new one, the code as-is can't be kept. It would be easily possible to enable the cache by requesting a cache size (which is also much simpler). But nobody uses stream_radio.c and I can't even test this thing, and the cache is probably not really important for it either.
* Remove BSD legacy TV/radio support (BT848 stuff)wm42013-02-061-136/+0
| | | | | FreeBSD actually supports V4L2, and V4L2 supports this chip. Also, this chip is from 1997. Farewell.
* Rename directories, move files (step 2 of 2)wm42012-11-121-4/+4
| | | | | | | | | | | | Finish renaming directories and moving files. Adjust all include statements to make the previous commit compile. The two commits are separate, because git is bad at tracking renames and content changes at the same time. Also take this as an opportunity to remove the separation between "common" and "mplayer" sources in the Makefile. ("common" used to be shared between mplayer and mencoder.)
* stream: remove V4L TV input and V4L radio supportwm42012-08-021-138/+0
| | | | There are V4L2 drivers, and the old V4L stuff seems plain unnecessary.
* cleanup: don't check for NULL before free()diego2010-11-081-4/+2
| | | | | | patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove #warning preprocessor directivesdiego2010-11-021-1/+0
| | | | | | | | The #warning preprocessor directive is non-standard and not available with all compilers. Furthermore, the warnings it causes are noisy and have not led to getting any of the underlying issues fixed in the space of a decade. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32480 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream_radio.c: fix corrupt line from e3061749Uoti Urpala2010-06-021-1/+1
|
* Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* Remove trailing whitespace from most filesUoti Urpala2009-07-071-14/+13
|
* Translation system changes part 2: replace macros by stringsAmar Takhar2009-07-071-64/+64
| | | | | Replace all MSGTR_ macros in the source by the corresponding English string.
* Translation system changes part 1: wrap translated stringsAmar Takhar2009-07-071-64/+64
| | | | | Replace mp_msg() calls which have a translated string as the format argument with mp_tmsg and add _() around all other translated strings.
* Merge svn changes up to r27441Uoti Urpala2008-08-081-17/+17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cfg-common-opts.h command.c configure input/input.c libmpcodecs/dec_video.c libmpcodecs/vd.c libmpdemux/stheader.h libvo/sub.c libvo/video_out.c libvo/vo_xv.c libvo/vosub_vidix.c libvo/x11_common.c libvo/x11_common.h mp_core.h mplayer.c stream/stream.h
| * Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.diego2008-08-061-3/+3
| | | | | | | | | | | | | | Use it in all the places that checked for either ALSA 0.9 or 1.x. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27422 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Rename some audio-output-related preprocessor directives.diego2008-08-051-3/+3
| | | | | | | | | | | | | | Switch them from a HAVE_ prefix to a CONFIG_ prefix. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27419 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Change a bunch of video/audio-output-specific preprocessor directives fromdiego2008-08-031-14/+14
| | | | | | | | | | | | | | a HAVE_ prefix to a CONFIG_ prefix. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27402 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27374Uoti Urpala2008-07-301-12/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cfg-common-opts.h cfg-mplayer.h command.c configure libmpcodecs/dec_video.c libmpcodecs/vd.c libmpcodecs/vf_vo.c libmpdemux/demuxer.h libmpdemux/stheader.h mp_core.h mplayer.c stream/stream_radio.c
| * Start unifying names of internal preprocessor directives.diego2008-07-301-12/+12
| | | | | | | | | | | | | | | | Replace all USE_ prefixes by CONFIG_ prefixes to indicate options which are configurable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27373 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r26783Uoti Urpala2008-05-151-20/+21
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile common.mak configure libmpcodecs/vd_ffmpeg.c libmpdemux/demux_mkv.c libvo/vo_xv.c mplayer.c
| * Use standard license headers with standard formatting.diego2008-05-141-20/+21
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26769 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove _s/_st suffix from some struct namesUoti Urpala2008-04-251-9/+9
|/ | | | | Since the names are always used after the keyword "struct" having a suffix as in "struct demuxer_st" is almost completely pointless.
* typo fix: inited --> initializeddiego2008-02-141-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25994 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream_opts should be constreimar2008-01-131-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25719 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream_opts arrays should be constreimar2007-12-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25270 b3059339-0415-0410-9bf9-f77b7e298cf2
* Mark all stream_info_t as constreimar2007-12-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25239 b3059339-0415-0410-9bf9-f77b7e298cf2
* Don't wait for filling entire audio ringbuffer at each call to grab_audio_frame.voroshil2007-10-251-1/+1
| | | | | | | | | Fixes 2 minutes delay before starting playback and audio clicks in sound (at least for my SAA7134 based card while capturing radio through saa7134-alsa module). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24849 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add missing call to audio_in_start_capture.voroshil2007-10-251-0/+1
| | | | | | | | | Fixes capturing sound from ALSA devices (repeated xrun errors, buffer underruns and son on). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24848 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix compilation with enabled radio capture and disabled OSS audio.voroshil2007-09-241-2/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24603 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: typo fix UNSUPORTED --> UNSUPPORTEDdiego2007-08-281-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24277 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix warning: too many arguments for formatcehoyos2007-08-081-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24039 b3059339-0415-0410-9bf9-f77b7e298cf2
* Replacing global variables in radio:// withvoroshil2007-07-291-64/+50
| | | | | | | | context-sensitive structure. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23910 b3059339-0415-0410-9bf9-f77b7e298cf2
* Avoid code duplication and ugly config.h hack by using av_strlcat/av_strlcpyreimar2007-07-051-1/+2
| | | | | | | instead of plain strlcat/strlcpy git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23723 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix compiler warnings.voroshil2007-06-081-1/+2
| | | | | | | | Remove unused tv_param_on variable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23505 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rework of *BSD BT848 detection for radio://voroshil2007-04-111-8/+11
| | | | | | | | to reuse recently added BT848 interface headers detection code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22966 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix typo in r22772 which causes compilation error under *BSD.voroshil2007-04-081-8/+8
| | | | | | | Slightly modified patch from Bernd Ernesti. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22946 b3059339-0415-0410-9bf9-f77b7e298cf2
* Radio driver loading rework.voroshil2007-03-211-133/+86
| | | | | | | Available interfaces are showed in verbose mode. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22772 b3059339-0415-0410-9bf9-f77b7e298cf2
* new slave command: radio_step_freqvoroshil2006-11-191-0/+21
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21058 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add *BSD BT848 radio supportvoroshil2006-11-181-1/+152
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21001 b3059339-0415-0410-9bf9-f77b7e298cf2
* add public wrapper for get_frequencyvoroshil2006-11-171-0/+15
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20984 b3059339-0415-0410-9bf9-f77b7e298cf2
* Change verbosity level from MSGL_V to MSGL_INFO for "Current frequency is"voroshil2006-11-171-1/+1
| | | | | | | | message in stream_radio. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20983 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add missed 'break'.voroshil2006-11-091-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20822 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move non driver-specific block to non-driver specific procedure, to avoidvoroshil2006-11-091-17/+15
| | | | | | | | | unnecceduplicating code. Avoid calling set_volume on no-initialized radio device in close_s. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20812 b3059339-0415-0410-9bf9-f77b7e298cf2
* Adding ability to check allowed frequency range.voroshil2006-11-081-2/+17
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20774 b3059339-0415-0410-9bf9-f77b7e298cf2
* Replace enneccesery O_RDWR with O_RDONLYvoroshil2006-11-071-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20754 b3059339-0415-0410-9bf9-f77b7e298cf2
* Restoring volume level of radio card on exit.voroshil2006-11-071-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20753 b3059339-0415-0410-9bf9-f77b7e298cf2
* ability to pass channel name (not only number) to radio_set_channelvoroshil2006-09-111-1/+16
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19799 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove stray and superflous #ifdef checks.diego2006-09-011-5/+0
| | | | | | | patch by Vladimir Voroshilov, voroshil [at] gmail [dot] com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19624 b3059339-0415-0410-9bf9-f77b7e298cf2
* Check for requirements at configure-time, not at run-time.diego2006-08-311-5/+1
| | | | | | | patch by Vladimir Voroshilov, voroshil <at> gmail <dot> com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19614 b3059339-0415-0410-9bf9-f77b7e298cf2
* Do not cast calloc/malloc resultsreimar2006-08-311-5/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19612 b3059339-0415-0410-9bf9-f77b7e298cf2
* Radio support, patch by Vladimir Voroshilov (voroshil gmail com)reimar2006-08-281-0/+1108
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19574 b3059339-0415-0410-9bf9-f77b7e298cf2