summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY30
-rw-r--r--Makefile5
-rw-r--r--config.c277
-rw-r--r--config.h105
-rw-r--r--device.c13
-rw-r--r--device.h4
-rw-r--r--examples/remote.conf.example3
-rw-r--r--frontend.c6
-rw-r--r--frontend.h4
-rw-r--r--frontend_local.c23
-rw-r--r--frontend_svr.c17
-rw-r--r--frontend_svr.h4
-rw-r--r--media_player.c118
-rw-r--r--menu.c63
-rw-r--r--menuitems.c8
-rw-r--r--po/it_IT.po42
-rw-r--r--setup_menu.c4
-rw-r--r--tools/http.c4
-rw-r--r--tools/iso639.h12
-rw-r--r--tools/playlist.c86
-rw-r--r--tools/sdp.h25
-rw-r--r--tools/udp_pes_scheduler.c29
-rw-r--r--tools/vdrdiscovery.c37
-rw-r--r--xine_frontend.c33
-rw-r--r--xine_frontend_lirc.c6
-rw-r--r--xine_frontend_main.c22
-rw-r--r--xine_input_vdr.c29
-rw-r--r--xine_sxfe_frontend.c16
-rw-r--r--xineliboutput.c279
29 files changed, 670 insertions, 634 deletions
diff --git a/HISTORY b/HISTORY
index fed79500..95aae277 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,25 +1,9 @@
VDR Plugin 'xineliboutput' Revision History
-------------------------------------------
-2009-06-06: Version 1.0.5 (branch-1_0_x)
-Backported bugfixes from CVS trunk:
-- Fixed compilation with gcc-4.4.0
-- Fixed memory leaks
-- Fixed setting focus in vdr-sxfe fullscreen mode
-
-2009-02-12: Version 1.0.4 (branch-1_0_x)
-Backported bugfixes from CVS trunk:
-- Updated Italian translations (Thanks to Diego Pierotto)
-- Fixed default grab quality (Thanks to Jochen Dolze, patch #2454827)
-- Added math library (-lm) to vdr-sxfe when building with
- Xrender / HUD OSD support (Thanks to Anssi Hannula)
-- Reduced H.264 logging
-- Fixed CD track count query
-- Fixed mrl backwards compability
-
2008-10-24: Version 1.0.3 (branch-1_0_x)
Backported bugfixes from CVS trunk:
-- Added missing sxfe display locks (Thanks to Antti Seppälä)
+- Added missing sxfe display locks (Thanks to Antti Seppälä)
- Modified HUD OSD scaling parameters (Thanks to Rolf Ahrenberg)
- Fixes to HUD OSD drawing (Thanks to Rolf Ahrenberg)
- Fixed --aspect=auto:path_to_script option (Thanks to Armin Diedering)
@@ -58,7 +42,7 @@ Backported bugfixes from CVS trunk:
- Added Italian translations (Thanks to Diego Pierotto)
- Added Czech translations (Thanks to Maya)
- Added HUD OSD (Blend OSD using graphics hardware) and --hud command-line option.
- (Thanks to Antti Seppälä and Rolf Ahrenberg)
+ (Thanks to Antti Seppälä and Rolf Ahrenberg)
- Added support for libextractor metadata parsing library (Petri Helin)
- Added service interface for launching media player (Suggested by Tobias Grimm)
- Added configuration options for unsharp and denoise3d post plugins (Petri Helin)
@@ -129,7 +113,7 @@ Backported bugfixes from CVS trunk:
- Adapted for xine-lib 1.1.4
- Adapted for vdr-1.5.1 (Thanks to Rolf Ahrenberg)
- Mac OS X compability fixes (Thanks to Tero Siironen)
-- DXR3 added to list of output devices (experimental; Thanks to Ville Skyttä)
+- DXR3 added to list of output devices (experimental; Thanks to Ville Skyttä)
- Subtitle selection menu updated to use VDR audio menu skin
- New subtitle macro key handling (identical to VDR kAudio)
- Added preferred subtitle language selection for media player
@@ -141,12 +125,12 @@ Backported bugfixes from CVS trunk:
- Added automatic re-connection to remote frontends (--reconnect option)
- Slow down DVD drive speed
- Initialize video size from stream info when playing slave streams,
- (Thanks to Antti Seppälä)
+ (Thanks to Antti Seppälä)
- Makefile shell scripts modified to run in dash (Ubuntu).
(Thanks to realKano@directbox.com)
- Increased frame-based buffering time after channel changes
- Use iconv to translate id3 tags from utf8 to VDR charset
-- Use /dev/dsp as OSS default device (Thanks to Ville Skyttä)
+- Use /dev/dsp as OSS default device (Thanks to Ville Skyttä)
- Lot of small fixes and enhancements, complete log in CVS
2007-01-07: Version 1.0.0pre7
@@ -155,7 +139,7 @@ Backported bugfixes from CVS trunk:
- Added playlist menu to media player
- Added "Play Audio CD" / "Play remote Audio CD" entry to plugin menu
- Makefile modified to allow overriding default directory environment.
- Using "install" to install files. (Thanks to Timo Weingärtner)
+ Using "install" to install files. (Thanks to Timo Weingärtner)
- Added metainfo caching to media player. Cached metainfo is stored to
".xineliboutput-playlist.m3u" files by default.
- Added support for playlists inside playlists
@@ -172,7 +156,7 @@ Backported bugfixes from CVS trunk:
- Subtitle type .ssa added
- Parsing for .pls, .asx and .ram playlists added
- Eliminated some warnings when compiling to 64bit (Thanks to Anssi Hannula)
-- Vidix(fb) added to supported video drivers (Thanks to Antti Seppälä)
+- Vidix(fb) added to supported video drivers (Thanks to Antti Seppälä)
- Media player/audio file browser does not anymore show video files
- When replaying music files, replay moves to next file automatically
- Decoder setup menu moved to Local setup menu
diff --git a/Makefile b/Makefile
index e997f5be..0b1c2941 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
# See the main source file 'xineliboutput.c' for copyright information and
# how to reach the author.
#
-# $Id: Makefile,v 1.38.2.2 2008-11-17 17:01:41 phintuka Exp $
+# $Id: Makefile,v 1.38.2.1 2008-10-21 14:42:21 phintuka Exp $
#
# The official name of this plugin.
@@ -244,8 +244,7 @@ INCLUDES += -I$(VDRINCDIR)
LIBS_XINE += $(shell (pkg-config libxine --atleast-version=1.1.90 && pkg-config libxine --libs) || xine-config --libs)
LIBS_X11 += -L/usr/X11R6/lib -lX11 -lXv -lXext
ifeq ($(HAVE_XRENDER), 1)
-# need -lm for ceil/floor in HUD OSD
- LIBS_X11 += -lXrender -lm
+ LIBS_X11 += -lXrender
endif
ifeq ($(APPLE_DARWIN), 1)
diff --git a/config.c b/config.c
index 5ae099fc..32ccf12e 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c,v 1.63.2.5 2009-06-07 23:40:38 phintuka Exp $
+ * $Id: config.c,v 1.63.2.2 2008-09-26 19:15:48 phintuka Exp $
*
*/
@@ -234,131 +234,12 @@ const char * const config_t::s_osdScalings[] = {
NULL
};
-const char * const config_t::s_decoders_MPEG2[] = {
- trNOOP("automatic"),
- "libmpeg2",
- "FFmpeg",
- NULL
-};
-
-const char * const config_t::s_decoders_H264[] = {
- trNOOP("automatic"),
- "FFmpeg",
- "CoreAVC",
- NULL
-};
-
-const char * const config_t::s_ff_skip_loop_filters[] = {
- trNOOP("automatic"),
- trNOOP("default"),
- trNOOP("none"),
- trNOOP("nonref"),
- trNOOP("bidir"),
- trNOOP("nonkey"),
- trNOOP("all"),
- NULL
-};
-
-const char * const config_t::s_ff_speed_over_accuracy[] = {
- trNOOP("automatic"),
- trNOOP("yes"),
- trNOOP("no"),
-};
-
-static const char exts_playlist[][4] = {
- "asx",
- "m3u",
- "pls",
- "ram",
-};
-
-static const char exts_audio[][8] = {
- "ac3",
- "asf",
- "au",
- "aud",
- "flac",
- "mpa",
- "mpega",
- "mp2",
- "mp3",
- "m4a",
- "ogg",
- "ogm",
- "ra",
- "spx",
- "wav",
- "wma",
-};
-
-static const char exts_video[][8] = {
- "asf",
- "avi",
- "dat",
- "divx",
- "dv",
- "fli",
- "flv",
- "iso", /* maybe dvd */
- "mkv",
- "mov",
- "mpeg",
- "mpg",
- "mpv",
- "mp4",
- "m2v",
- "m2t",
- "m2ts",
- "m4v",
- "mts",
- "pes",
- "rm",
- "ts",
- "vdr",
- "vob",
- "wmv",
- "xvid",
-};
-
-static const char exts_image[][8] = {
- "bmp",
- "gif",
- "jpeg",
- "jpg",
- "mng",
- "png",
- "tiff",
-};
-
-#define DEF_EXT_IS(TYPE) \
-static bool ext_is_ ## TYPE(const char *ext) \
-{ \
- for(unsigned int i=0; i<sizeof(exts_ ## TYPE)/sizeof(exts_ ## TYPE[0]); i++) \
- if(!strcasecmp(ext, exts_ ## TYPE[i])) \
- return true; \
- return false; \
-}
-DEF_EXT_IS(playlist)
-DEF_EXT_IS(audio)
-DEF_EXT_IS(video)
-DEF_EXT_IS(image)
-
-static const char *get_extension(const char *fname)
-{
- if(fname) {
- const char *pos = strrchr(fname, '.');
- if(pos)
- return pos+1;
- }
- return NULL;
-}
-
static char *strcatrealloc(char *dest, const char *src)
{
if (!src || !*src)
return dest;
- size_t l = (dest ? strlen(dest) : 0) + strlen(src) + 1;
+ int l = (dest ? strlen(dest) : 0) + strlen(src) + 1;
if(dest) {
dest = (char *)realloc(dest, l);
strcat(dest, src);
@@ -369,61 +250,103 @@ static char *strcatrealloc(char *dest, const char *src)
return dest;
}
-
bool config_t::IsPlaylistFile(const char *fname)
{
- const char *ext = get_extension(fname);
- return ext && ext_is_playlist(ext);
+ if(fname) {
+ char *pos = strrchr(fname,'.');
+ if(pos) {
+ pos++;
+ if(!strcasecmp(pos, "pls") ||
+ !strcasecmp(pos, "m3u") ||
+ !strcasecmp(pos, "ram") ||
+ !strcasecmp(pos, "asx"))
+ return true;
+ }
+ }
+ return false;
}
bool config_t::IsAudioFile(const char *fname)
{
- const char *ext = get_extension(fname);
- return ext && (ext_is_audio(ext) || ext_is_playlist(ext));
+ if(fname) {
+ char *pos = strrchr(fname,'.');
+ if(pos) {
+ pos++;
+ if(!strcasecmp(pos, "mpa") ||
+ !strcasecmp(pos, "mp2") ||
+ !strcasecmp(pos, "mp3") ||
+ !strcasecmp(pos, "m4a") ||
+ !strcasecmp(pos, "mpega") ||
+ !strcasecmp(pos, "flac") ||
+ !strcasecmp(pos, "ac3") ||
+ !strcasecmp(pos, "ogg") ||
+ !strcasecmp(pos, "ogm") ||
+ !strcasecmp(pos, "au") ||
+ !strcasecmp(pos, "aud") ||
+ !strcasecmp(pos, "wma") ||
+ !strcasecmp(pos, "asf") ||
+ !strcasecmp(pos, "wav") ||
+ !strcasecmp(pos, "spx") ||
+ !strcasecmp(pos, "ra"))
+ return true;
+ return IsPlaylistFile(fname);
+ }
+ }
+ return false;
}
bool config_t::IsVideoFile(const char *fname)
{
- const char *ext = get_extension(fname);
- return ext && (ext_is_video(ext) || ext_is_audio(ext) || ext_is_playlist(ext));
+ if(fname) {
+ char *pos = strrchr(fname,'.');
+ if(pos) {
+ pos++;
+ if(!strcasecmp(pos, "avi") ||
+ !strcasecmp(pos, "mpv") ||
+ !strcasecmp(pos, "m2v") ||
+ !strcasecmp(pos, "m4v") ||
+ !strcasecmp(pos, "vob") ||
+ !strcasecmp(pos, "vdr") ||
+ !strcasecmp(pos, "mpg") ||
+ !strcasecmp(pos, "mpeg")||
+ !strcasecmp(pos, "mp4") ||
+ !strcasecmp(pos, "asf") ||
+ !strcasecmp(pos, "wmv") ||
+ !strcasecmp(pos, "mov") ||
+ !strcasecmp(pos, "ts") ||
+ !strcasecmp(pos, "pes") ||
+ !strcasecmp(pos, "xvid") ||
+ !strcasecmp(pos, "divx") ||
+ !strcasecmp(pos, "fli") ||
+ !strcasecmp(pos, "flv") ||
+ !strcasecmp(pos, "dv") ||
+ !strcasecmp(pos, "dat") ||
+ !strcasecmp(pos, "mkv") ||
+ !strcasecmp(pos, "rm") ||
+ !strcasecmp(pos, "iso")) /* maybe dvd */
+ return true;
+ return IsAudioFile(fname);
+ }
+ }
+ return false;
}
bool config_t::IsImageFile(const char *fname)
{
- const char *ext = get_extension(fname);
- return ext && (ext_is_image(ext) || ext_is_playlist(ext));
-}
-
-bool config_t::IsDvdImage(const char *fname)
-{
- const char *ext = get_extension(fname);
- return (ext && !strcasecmp(ext, "iso")) ? true : false;
-}
-
-bool config_t::IsDvdFolder(const char *fname)
-{
- struct stat st;
- cString buf, folder;
-
- buf = cString::sprintf("%s/VIDEO_TS/", fname);
- if (stat(buf, &st) == 0) {
- folder = buf;
- } else {
- buf = cString::sprintf("%s/video_ts/", fname);
- if (stat(buf, &st) == 0)
- folder = buf;
- else
- return false;
+ if(fname) {
+ char *pos = strrchr(fname,'.');
+ if(pos) {
+ pos++;
+ if(!strcasecmp(pos, "jpg") ||
+ !strcasecmp(pos, "jpeg") ||
+ !strcasecmp(pos, "gif") ||
+ !strcasecmp(pos, "tiff") ||
+ !strcasecmp(pos, "bmp") ||
+ !strcasecmp(pos, "mng") ||
+ !strcasecmp(pos, "png"))
+ return true;
+ }
}
-
- buf = cString::sprintf("%s/video_ts.ifo", *folder);
- if (stat(buf, &st) == 0)
- return true;
-
- buf = cString::sprintf("%s/VIDEO_TS.IFO", *folder);
- if (stat(buf, &st) == 0)
- return true;
-
return false;
}
@@ -496,7 +419,6 @@ config_t::config_t() {
speaker_type = SPEAKERS_STEREO;
post_plugins = NULL;
- config_file = NULL;
audio_delay = 0;
audio_compression = 0;
@@ -549,7 +471,6 @@ config_t::config_t() {
strn0cpy(spu_lang[3], "" , sizeof(spu_lang[3]));
#endif
extsub_size = -1;
- dvb_subtitles = 0;
alpha_correction = 0;
alpha_correction_abs = 0;
@@ -576,7 +497,6 @@ config_t::config_t() {
remote_mode = 0;
listen_port = LISTEN_PORT;
remote_keyboard = 1;
- remote_max_clients = MAXCLIENTS;
remote_usetcp = 1;
remote_useudp = 1;
remote_usertp = 1;
@@ -614,25 +534,17 @@ config_t::config_t() {
saturation = -1;
contrast = -1;
brightness = -1;
- sharpness = -1;
- noise_reduction = -1;
vo_aspect_ratio = 0;
live_mode_sync = 1; // Sync SCR to transponder clock in live mode
scr_tunning = 0; // Fine-tune xine egine SCR (to sync video to graphics output)
scr_hz = 90000; // Current SCR speed (Hz), default is 90000
- decoder_mpeg2 = DECODER_MPEG2_auto;
- decoder_h264 = DECODER_H264_auto;
- ff_h264_speed_over_accurancy = FF_H264_SPEED_OVER_ACCURACY_auto;
- ff_h264_skip_loop_filter = FF_H264_SKIP_LOOPFILTER_auto;
-
strn0cpy(browse_files_dir, VideoDirectory, sizeof(browse_files_dir));
strn0cpy(browse_music_dir, VideoDirectory, sizeof(browse_music_dir));
strn0cpy(browse_images_dir, VideoDirectory, sizeof(browse_images_dir));
cache_implicit_playlists = 1;
enable_id3_scanner = 1;
- dvd_arrow_keys_control_playback = 1;
main_menu_mode = ShowMenu;
force_primary_device = 0;
@@ -655,7 +567,7 @@ bool config_t::ProcessArg(const char *Name, const char *Value)
bool config_t::ProcessArgs(int argc, char *argv[])
{
- static const char short_options[] = "fDw:h:l:r:A:V:d:P:C:pc";
+ static const char short_options[] = "fDw:h:l:r:A:V:d:P:pc";
static const struct option long_options[] = {
{ "fullscreen", no_argument, NULL, 'f' },
@@ -671,7 +583,6 @@ bool config_t::ProcessArgs(int argc, char *argv[])
{ "video", required_argument, NULL, 'V' },
{ "display", required_argument, NULL, 'd' },
{ "post", required_argument, NULL, 'P' },
- { "config", required_argument, NULL, 'C' },
{ "primary", no_argument, NULL, 'p' },
{ "exit-on-close",no_argument, NULL, 'c' },
{ NULL }
@@ -736,8 +647,6 @@ bool config_t::ProcessArgs(int argc, char *argv[])
post_plugins = strcatrealloc(post_plugins, ";");
post_plugins = strcatrealloc(post_plugins, optarg);
break;
- case 'C': config_file = strdup(optarg);
- break;
case 'p': ProcessArg("ForcePrimaryDevice", "1");
break;
case 'c': exit_on_close = 1;
@@ -751,7 +660,7 @@ bool config_t::ProcessArgs(int argc, char *argv[])
bool config_t::SetupParse(const char *Name, const char *Value)
{
- const char *pt;
+ char *pt;
if(*m_ProcessedArgs && NULL != (pt=strstr(m_ProcessedArgs+1, Name)) &&
*(pt-1) == ' ' && *(pt+strlen(Name)) == ' ') {
LOGDBG("Skipping configuration entry %s=%s (overridden in command line)", Name, Value);
@@ -804,12 +713,10 @@ bool config_t::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "OSD.SpuLang3")) STRN0CPY(spu_lang[3], Value);
#endif
else if (!strcasecmp(Name, "OSD.ExtSubSize")) extsub_size = atoi(Value);
- else if (!strcasecmp(Name, "OSD.DvbSubtitles")) dvb_subtitles = atoi(Value);
else if (!strcasecmp(Name, "RemoteMode")) remote_mode = atoi(Value);
else if (!strcasecmp(Name, "Remote.ListenPort")) listen_port = atoi(Value);
else if (!strcasecmp(Name, "Remote.Keyboard")) remote_keyboard = atoi(Value);
- else if (!strcasecmp(Name, "Remote.MaxClients")) remote_max_clients = atoi(Value);
else if (!strcasecmp(Name, "Remote.UseTcp")) remote_usetcp = atoi(Value);
else if (!strcasecmp(Name, "Remote.UseUdp")) remote_useudp = atoi(Value);
else if (!strcasecmp(Name, "Remote.UseRtp")) remote_usertp = atoi(Value);
@@ -839,7 +746,6 @@ bool config_t::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "Video.DeinterlaceOptions")) STRN0CPY(deinterlace_opts, Value);
else if (!strcasecmp(Name, "Video.Deinterlace")) STRN0CPY(deinterlace_method, Value);
else if (!strcasecmp(Name, "Video.FieldOrder")) field_order=atoi(Value)?1:0;
-
else if (!strcasecmp(Name, "Video.AutoCrop")) autocrop = atoi(Value);
else if (!strcasecmp(Name, "Video.AutoCrop.AutoDetect")) autocrop_autodetect = atoi(Value);
else if (!strcasecmp(Name, "Video.AutoCrop.SoftStart")) autocrop_soft = atoi(Value);
@@ -857,22 +763,14 @@ bool config_t::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "Video.Saturation")) saturation = atoi(Value);
else if (!strcasecmp(Name, "Video.Contrast")) contrast = atoi(Value);
else if (!strcasecmp(Name, "Video.Brightness")) brightness = atoi(Value);
- else if (!strcasecmp(Name, "Video.Sharpness")) sharpness = atoi(Value);
- else if (!strcasecmp(Name, "Video.NoiseReduction")) noise_reduction = atoi(Value);
else if (!strcasecmp(Name, "Video.Overscan")) overscan = atoi(Value);
else if (!strcasecmp(Name, "Video.IBPTrickSpeed")) ibp_trickspeed = atoi(Value);
else if (!strcasecmp(Name, "Video.MaxTrickSpeed")) max_trickspeed = atoi(Value);
else if (!strcasecmp(Name, "Video.AspectRatio")) vo_aspect_ratio = atoi(Value);
- else if (!strcasecmp(Name, "Video.Decoder.MPEG2")) decoder_mpeg2 = strstra(Value, s_decoders_MPEG2, 0);
- else if (!strcasecmp(Name, "Video.Decoder.H264")) decoder_h264 = strstra(Value, s_decoders_H264, 0);
- else if (!strcasecmp(Name, "Video.Decoder.H264.SpeedOverAccuracy")) ff_h264_speed_over_accurancy = strstra(Value, s_ff_speed_over_accuracy, 0);
- else if (!strcasecmp(Name, "Video.Decoder.H264.SkipLoopFilter")) ff_h264_skip_loop_filter = strstra(Value, s_ff_skip_loop_filters, 0);
-
else if (!strcasecmp(Name, "Post.pp.Enable")) ffmpeg_pp = atoi(Value);
else if (!strcasecmp(Name, "Post.pp.Quality")) ffmpeg_pp_quality = atoi(Value);
else if (!strcasecmp(Name, "Post.pp.Mode")) STRN0CPY(ffmpeg_pp_mode, Value);
-
else if (!strcasecmp(Name, "Post.unsharp.Enable")) unsharp = atoi(Value);
else if (!strcasecmp(Name, "Post.unsharp.luma_matrix_width")) unsharp_luma_matrix_width = atoi(Value);
else if (!strcasecmp(Name, "Post.unsharp.luma_matrix_height")) unsharp_luma_matrix_height = atoi(Value);
@@ -880,7 +778,6 @@ bool config_t::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "Post.unsharp.chroma_matrix_width")) unsharp_chroma_matrix_width = atoi(Value);
else if (!strcasecmp(Name, "Post.unsharp.chroma_matrix_height")) unsharp_chroma_matrix_height = atoi(Value);
else if (!strcasecmp(Name, "Post.unsharp.chroma_amount")) unsharp_chroma_amount = atoi(Value);
-
else if (!strcasecmp(Name, "Post.denoise3d.Enable")) denoise3d = atoi(Value);
else if (!strcasecmp(Name, "Post.denoise3d.luma")) denoise3d_luma = atoi(Value);
else if (!strcasecmp(Name, "Post.denoise3d.chroma")) denoise3d_chroma = atoi(Value);
@@ -891,8 +788,6 @@ bool config_t::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "Media.BrowseImagesDir")) STRN0CPY(browse_images_dir, Value);
else if (!strcasecmp(Name, "Media.CacheImplicitPlaylists")) cache_implicit_playlists = atoi(Value);
else if (!strcasecmp(Name, "Media.EnableID3Scanner")) enable_id3_scanner = atoi(Value);
- else if (!strcasecmp(Name, "Media.DVD.ArrowKeysControlPlayback")) dvd_arrow_keys_control_playback = atoi(Value);
-
else if (!strcasecmp(Name, "Playlist.Tracknumber")) playlist_tracknumber = atoi(Value);
else if (!strcasecmp(Name, "Playlist.Artist")) playlist_artist = atoi(Value);
else if (!strcasecmp(Name, "Playlist.Album")) playlist_album = atoi(Value);
diff --git a/config.h b/config.h
index bd3f4011..572d08f5 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h,v 1.46.2.3 2009-06-07 23:40:38 phintuka Exp $
+ * $Id: config.h,v 1.46.2.1 2008-09-26 13:03:27 phintuka Exp $
*
*/
@@ -16,9 +16,6 @@
#include <vdr/config.h>
-// Max number of remote clients
-#define MAXCLIENTS 10
-
// Decoder buffer size
#define PES_BUFFERS_CUSTOM 0
#define PES_BUFFERS_TINY_50 1
@@ -135,8 +132,6 @@
#define SPEAKERS_A52_PASSTHRU 12
#define SPEAKERS_count 13
-#define SUBTITLESIZE_count 7
-
// OSD blending methods
#define OSD_BLENDING_SOFTWARE 0 // xine-lib "normal" osd
#define OSD_BLENDING_HARDWARE 1 // xine-lib "unscaled osd"
@@ -156,34 +151,10 @@
#define OSD_SCALING_BILINEAR 2
#define OSD_SCALING_count 3
+#define SUBTITLESIZE_count 7
#if VDRVERSNUM >= 10510
# define DEVICE_SUPPORTS_IBP_TRICKSPEED
#endif
-
-// Video decoder
-#define DECODER_MPEG2_auto 0 /* use value from frontend config_xineliboutput */
-#define DECODER_MPEG2_LIBMPEG2 1
-#define DECODER_MPEG2_FFMPEG 2
-#define DECODER_MPEG2_count 3
-
-#define DECODER_H264_auto 0 /* use value from frontend config_xineliboutput */
-#define DECODER_H264_FFMPEG 1
-#define DECODER_H264_COREAVC 2
-#define DECODER_H264_count 3
-
-#define FF_H264_SKIP_LOOPFILTER_auto 0 /* use value from frontend config_xineliboutput */
-#define FF_H264_SKIP_LOOPFILTER_DEFAULT 1
-#define FF_H264_SKIP_LOOPFILTER_NONE 2
-#define FF_H264_SKIP_LOOPFILTER_NONREF 3
-#define FF_H264_SKIP_LOOPFILTER_BIDIR 4
-#define FF_H264_SKIP_LOOPFILTER_NONKEY 5
-#define FF_H264_SKIP_LOOPFILTER_ALL 6
-#define FF_H264_SKIP_LOOPFILTER_count 7
-
-#define FF_H264_SPEED_OVER_ACCURACY_auto 0 /* use value from frontend config_xineliboutput */
-#define FF_H264_SPEED_OVER_ACCURACY_no 1
-#define FF_H264_SPEED_OVER_ACCURACY_yes 2
-#define FF_H264_SPEED_OVER_ACCURACY_count 3
#define HIDDEN_OPTION(opt) \
(xc.IsOptionHidden(xc.opt))
@@ -203,36 +174,31 @@ typedef enum {
class config_t {
public:
- static const char * const s_bufferSize [PES_BUFFERS_count + 1];
- static const int i_pesBufferSize [PES_BUFFERS_count + 1];
- static const char * const s_aspects [ASPECT_count + 1];
- static const char * const s_vo_aspects [VO_ASPECT_count + 1];
- static const char * const s_deinterlaceMethods [DEINTERLACE_count + 1];
- static const char * const s_deinterlaceMethodNames [DEINTERLACE_count + 1];
- static const char * const s_fieldOrder [FIELD_ORDER_count + 1];
- static const char * const s_audioDriverNames [AUDIO_DRIVER_count + 1];
- static const char * const s_audioDrivers [AUDIO_DRIVER_count + 1];
- static const char * const s_videoDriverNamesX11 [X11_DRIVER_count + 1];
- static const char * const s_videoDriversX11 [X11_DRIVER_count + 1];
- static const char * const s_videoDriverNamesFB [FB_DRIVER_count + 1];
- static const char * const s_videoDriversFB [FB_DRIVER_count + 1];
- static const char * const s_frontendNames [FRONTEND_count + 1];
- static const char * const s_frontends [FRONTEND_count + 1];
- static const char * const s_frontend_files [FRONTEND_count + 1];
- static const char * const s_audioEqNames [AUDIO_EQ_count + 1];
- static const char * const s_audioVisualizations [AUDIO_VIS_count + 1];
- static const char * const s_audioVisualizationNames[AUDIO_VIS_count + 1];
- static const char * const s_speakerArrangements [SPEAKERS_count + 1];
- static const char * const s_subtitleSizes [SUBTITLESIZE_count + 1];
- static const char * const s_osdBlendingMethods [OSD_BLENDING_count + 1];
- static const char * const s_osdMixers [OSD_MIXER_count + 1];
- static const char * const s_osdScalings [OSD_SCALING_count + 1];
- static const char * const s_decoders_MPEG2 [DECODER_MPEG2_count + 1];
- static const char * const s_decoders_H264 [DECODER_H264_count + 1];
- static const char * const s_ff_skip_loop_filters [FF_H264_SKIP_LOOPFILTER_count + 1];
- static const char * const s_ff_speed_over_accuracy [FF_H264_SPEED_OVER_ACCURACY_count + 1];
-
+ static const char * const s_bufferSize[];
+ static const int i_pesBufferSize[];
+ static const char * const s_aspects[];
+ static const char * const s_deinterlaceMethods[];
+ static const char * const s_deinterlaceMethodNames[];
+ static const char * const s_fieldOrder[];
+ static const char * const s_audioDriverNames[];
+ static const char * const s_audioDrivers[];
+ static const char * const s_videoDriverNamesX11[];
+ static const char * const s_videoDriversX11[];
+ static const char * const s_videoDriverNamesFB[];
+ static const char * const s_videoDriversFB[];
+ static const char * const s_frontendNames[];
+ static const char * const s_frontends[];
+ static const char * const s_frontend_files[];
+ static const char * const s_audioEqNames[];
+ static const char * const s_audioVisualizations[];
+ static const char * const s_audioVisualizationNames[];
+ static const char * const s_speakerArrangements[];
+ static const char * const s_subtitleSizes[];
static const char * const s_subExts[];
+ static const char * const s_osdBlendingMethods[];
+ static const char * const s_osdMixers[];
+ static const char * const s_osdScalings[];
+ static const char * const s_vo_aspects[];
public:
@@ -246,7 +212,6 @@ class config_t {
char audio_driver[32];
char audio_port[64];
char *post_plugins; // static post plugins from command line options
- char *config_file; // config file from command line options
int pes_buffers;
char modeline[64];
@@ -278,8 +243,6 @@ class config_t {
int saturation; // 0...0xffff, -1 == off
int contrast; // 0...0xffff, -1 == off
int brightness; // 0...0xffff, -1 == off
- int sharpness; // 0...0xffff, -1 == off
- int noise_reduction; // 0...0xffff, -1 == off
int vo_aspect_ratio;
// OSD settings
@@ -292,8 +255,7 @@ class config_t {
int osd_blending_lowresvideo; // Use hardware blending for low-resolution video
int alpha_correction;
int alpha_correction_abs;
- int extsub_size; // size of separate subtitles ( -1 = xine default ; 0...6 = { tiny small normal large very large huge }
- int dvb_subtitles; // send DVB subtitles in data stream (decode+display using xine-lib or external media player)
+ int extsub_size; /* size of separate subtitles ( -1 = xine default ; 0...6 = { tiny small normal large very large huge } */
// Media player
#if VDRVERSNUM < 10515
@@ -308,8 +270,7 @@ class config_t {
int subtitle_vpos; // used in media player. Not saved !
int playlist_tracknumber;
int playlist_artist;
- int playlist_album;
- int dvd_arrow_keys_control_playback;
+ int playlist_album;
// Audio visualization
char audio_visualization[64];
@@ -362,9 +323,8 @@ class config_t {
char remote_local_if[32]; // Listen only on this interface
char remote_local_ip[32]; // Bind locally to this IP
int remote_keyboard; // Allow remote client to control VDR with keyboard, LIRC, etc.
- int remote_max_clients; // Max. number of clients
- int remote_usebcast; // Use broadcasts to find servers automatically
+ int remote_usebcast; // Use proadcasts to find servers automatically
int remote_usepipe; // enable local pipes for video transport
int remote_usertp; // enable RTP multicast for video transport
int remote_useudp; // enable UDP unicast for video transport
@@ -389,11 +349,6 @@ class config_t {
int scr_tunning; /* Fine-tune xine egine SCR (to sync video to graphics output) */
int scr_hz; /* Current SCR speed (Hz), default is 90000 */
- int decoder_mpeg2; /* DECODER_MPEG2_... */
- int decoder_h264; /* DECODER_H264_... */
- int ff_h264_speed_over_accurancy;
- int ff_h264_skip_loop_filter; /* FF_H264_SKIP_LOOPFILTER_* */
-
config_t();
bool SetupParse(const char *Name, const char *Value);
@@ -403,8 +358,6 @@ class config_t {
bool IsAudioFile(const char *);
bool IsVideoFile(const char *);
bool IsPlaylistFile(const char *);
- bool IsDvdFolder(const char *);
- bool IsDvdImage(const char *);
cString AutocropOptions(void);
cString SwScaleOptions(void);
diff --git a/device.c b/device.c
index 4da02178..cb80a539 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c,v 1.57.2.4 2009-02-12 10:36:00 phintuka Exp $
+ * $Id: device.c,v 1.57.2.1 2008-09-26 13:03:19 phintuka Exp $
*
*/
@@ -867,16 +867,16 @@ bool cXinelibDevice::Flush(int TimeoutMs)
// Playback of files and images
//
-int cXinelibDevice::PlayFileCtrl(const char *Cmd, int TimeoutMs)
+int cXinelibDevice::PlayFileCtrl(const char *Cmd)
{
TRACEF("cXinelibDevice::PlayFile");
int result = -1;
- /*if(m_PlayingFile != pmNone)*/ {
+ if(m_PlayingFile != pmNone) {
if(m_server)
- result = m_server->PlayFileCtrl(Cmd, TimeoutMs);
+ result = m_server->PlayFileCtrl(Cmd);
if(m_local)
- result = m_local->PlayFileCtrl(Cmd, TimeoutMs);
+ result = m_local->PlayFileCtrl(Cmd);
}
return result;
}
@@ -1477,9 +1477,6 @@ uchar *cXinelibDevice::GrabImage(int &Size, bool Jpeg,
{
TRACEF("cXinelibDevice::GrabImage");
- if (Quality < 0)
- Quality = 100;
-
if(m_local)
return m_local->GrabImage(Size, Jpeg, Quality, SizeX, SizeY);
if(m_server)
diff --git a/device.h b/device.h
index d051120f..517c3f6e 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.h,v 1.34.2.2 2008-12-10 22:56:15 phintuka Exp $
+ * $Id: device.h,v 1.34.2.1 2008-09-26 13:41:52 phintuka Exp $
*
*/
@@ -239,7 +239,7 @@ class cXinelibDevice : public cDevice
public:
bool PlayFile(const char *Filename, int Position=0,
bool LoopPlay=false, ePlayMode PlayMode=pmAudioVideo);
- int PlayFileCtrl(const char *Cmd, int TimeoutMs = -1);
+ int PlayFileCtrl(const char *Cmd);
bool EndOfStreamReached(void);
diff --git a/examples/remote.conf.example b/examples/remote.conf.example
index df13bc33..681c2760 100644
--- a/examples/remote.conf.example
+++ b/examples/remote.conf.example
@@ -43,9 +43,6 @@ XKeySym.Channel- Next
XKeySym.Volume+ KP_Add
XKeySym.Volume- KP_Subtract
XKeySym.Mute m
-XKeySym.Info I
-XKeySym.Audio A
-XKeySym.Subtitles S
XKeySym.Schedule F6
XKeySym.Channels F7
XKeySym.Timers F8
diff --git a/frontend.c b/frontend.c
index 341ebd5e..a86ed17f 100644
--- a/frontend.c
+++ b/frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend.c,v 1.59.2.3 2009-06-04 11:58:48 phintuka Exp $
+ * $Id: frontend.c,v 1.59.2.2 2008-09-26 13:46:49 phintuka Exp $
*
*/
@@ -622,9 +622,9 @@ bool cXinelibThread::LogoDisplay(void)
if(Setup.FileName()) {
cString SetupPath = Setup.FileName();
- const char *end = strrchr(SetupPath, '/');
+ char *end = strrchr(SetupPath, '/');
if(end) {
- SetupPath.Truncate(end - (const char *)SetupPath);
+ *end = 0;
fd = open(Path=cString::sprintf("%s/plugins/xineliboutput/logo.mpv", *SetupPath), O_RDONLY);
}
}
diff --git a/frontend.h b/frontend.h
index 7ec5a12e..70c29e12 100644
--- a/frontend.h
+++ b/frontend.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend.h,v 1.22.2.1 2008-12-10 22:56:15 phintuka Exp $
+ * $Id: frontend.h,v 1.22 2008-04-14 19:58:50 phintuka Exp $
*
*/
@@ -98,7 +98,7 @@ class cXinelibThread : public cThread, public cListObject
// Playback files
virtual bool PlayFile(const char *FileName, int Position,
bool LoopPlay = false, ePlayMode PlayMode = pmAudioVideo);
- virtual int PlayFileCtrl(const char *Cmd, int TimeoutMs = -1) { return Xine_Control(Cmd); }
+ virtual int PlayFileCtrl(const char *Cmd) { return Xine_Control(Cmd); }
virtual bool EndOfStreamReached(void);
// Image grabbing
diff --git a/frontend_local.c b/frontend_local.c
index 8f100248..780520a4 100644
--- a/frontend_local.c
+++ b/frontend_local.c
@@ -4,12 +4,10 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_local.c,v 1.31.2.1 2009-06-06 13:25:21 phintuka Exp $
+ * $Id: frontend_local.c,v 1.31 2008-04-03 08:08:27 phintuka Exp $
*
*/
-#define __STDC_CONSTANT_MACROS
-
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -162,18 +160,17 @@ int64_t cXinelibLocal::GetSTC()
{
TRACEF("cXinelibLocal::GetSTC");
- union {
- char buf[32];
- int64_t pts;
- } u = {"GETSTC\r\n"};
+ int64_t pts = -1;
+ char buf[32] = {0};
+ strcpy(buf, "GETSTC\r\n");
LOCK_FE;
-
- if (fe && m_bReady)
- if (0 == fe->xine_control(fe, u.buf))
- return u.pts;
-
- return INT64_C(-1);
+ if(fe && m_bReady)
+ if(0 == fe->xine_control(fe, (char*)buf))
+ //if(*((int64_t *)buf) < MAX_SCR)
+ // if(*((int64_t *)buf) >= 0LL)
+ pts = *((int64_t *)buf);
+ return pts;
}
//
diff --git a/frontend_svr.c b/frontend_svr.c
index 93ccdeab..43c74744 100644
--- a/frontend_svr.c
+++ b/frontend_svr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_svr.c,v 1.56.2.5 2009-06-04 13:16:37 phintuka Exp $
+ * $Id: frontend_svr.c,v 1.56.2.2 2008-09-26 19:37:37 phintuka Exp $
*
*/
@@ -715,7 +715,7 @@ bool cXinelibServer::HasClients(void)
return false;
}
-int cXinelibServer::PlayFileCtrl(const char *Cmd, int TimeoutMs)
+int cXinelibServer::PlayFileCtrl(const char *Cmd)
{
/* Check if there are any clients */
if(!HasClients()) {
@@ -750,7 +750,6 @@ int cXinelibServer::PlayFileCtrl(const char *Cmd, int TimeoutMs)
#endif
int timeout = bPlayfile ? PLAYFILE_TIMEOUT : PLAYFILE_CTRL_TIMEOUT;
- if(TimeoutMs > 0) timeout = TimeoutMs;
future.Wait(timeout);
@@ -1332,12 +1331,11 @@ void cXinelibServer::Handle_Control_HTTP(int cli, const char *arg)
else if(!strncmp(m_State[cli]->Uri(), "/PLAYFILE", 9)) {
if( *m_FileName && m_bPlayingFile) {
- cString file = m_FileName;
- const char *pos = strstr(m_FileName, "#subtitle:");
- if(pos)
- file.Truncate(pos - m_FileName);
- bool Allow = ( !strcmp_escaped(file, m_State[cli]->Uri() + 9)
+ char *pos = strstr(m_FileName, "#subtitle:");
+ if(pos) *pos = 0;
+ bool Allow = ( !strcmp_escaped(m_FileName, m_State[cli]->Uri() + 9)
|| (pos && !strcmp_escaped(pos + 10, m_State[cli]->Uri() + 9)));
+ if(pos) *pos = '#';
if(Allow) {
LOGMSG("HTTP streaming media file");
@@ -1691,8 +1689,7 @@ void cXinelibServer::Handle_ClientConnected(int fd)
bool accepted = SVDRPhosts.Acceptable(sin.sin_addr.s_addr);
if(!accepted) {
LOGMSG("Address not allowed to connect (svdrphosts.conf).");
- if (write(fd, "Access denied.\r\n", 16) != 16)
- LOGERR("Write failed");
+ write(fd, "Access denied.\r\n", 16);
CLOSESOCKET(fd);
return;
}
diff --git a/frontend_svr.h b/frontend_svr.h
index 27dad3dd..f8809f1c 100644
--- a/frontend_svr.h
+++ b/frontend_svr.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_svr.h,v 1.18.2.1 2008-12-10 22:56:15 phintuka Exp $
+ * $Id: frontend_svr.h,v 1.18 2007-03-15 13:29:04 phintuka Exp $
*
*/
@@ -56,7 +56,7 @@ class cXinelibServer : public cXinelibThread
virtual uchar *GrabImage(int &Size, bool Jpeg, int Quality,
int SizeX, int SizeY);
// Playback files
- virtual int PlayFileCtrl(const char *Cmd, int TimeoutMs = -1);
+ virtual int PlayFileCtrl(const char *Cmd);
virtual bool EndOfStreamReached(void);
// Configuration
diff --git a/media_player.c b/media_player.c
index 0cd2502e..df214736 100644
--- a/media_player.c
+++ b/media_player.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: media_player.c,v 1.52.2.7 2009-09-16 09:56:11 phintuka Exp $
+ * $Id: media_player.c,v 1.52.2.5 2008-10-19 17:47:08 phintuka Exp $
*
*/
@@ -46,11 +46,8 @@ class cXinelibPlayer : public cPlayer
cPlaylist m_Playlist;
bool m_Error;
- bool m_UseResumeFile;
int m_Speed;
- void UpdateNumTracks(void);
-
protected:
virtual void Activate(bool On);
@@ -76,7 +73,8 @@ class cXinelibPlayer : public cPlayer
bool NextFile(int step);
bool Playing(void) { return !(m_Error || cXinelibDevice::Instance().EndOfStreamReached()); }
bool Error(void) { return m_Error; }
- void UseResumeFile(bool Val) { m_UseResumeFile = Val; }
+
+ bool m_UseResume;
/* Playlist access */
cPlaylist& Playlist(void) { return m_Playlist; }
@@ -88,7 +86,7 @@ class cXinelibPlayer : public cPlayer
cXinelibPlayer::cXinelibPlayer(const char *File, bool Queue, const char *SubFile)
{
m_ResumeFile = NULL;
- m_UseResumeFile = true;
+ m_UseResume = true;
m_Error = false;
m_Speed = 1;
@@ -203,26 +201,13 @@ bool cXinelibPlayer::NextFile(int step)
return false;
}
-void cXinelibPlayer::UpdateNumTracks(void)
-{
- // cdda tracks
- if(m_Playlist.Count() == 1 && !strcmp("cdda:/", m_Playlist.First()->Filename)) {
- int count = cXinelibDevice::Instance().PlayFileCtrl("GETAUTOPLAYSIZE CD", 10000);
- if(count>1) {
- for(int i=0; i<count; i++)
- m_Playlist.Read(cString::sprintf("cdda:/%d", i+1));
- m_Playlist.Del(m_Playlist.First());
- }
- }
-}
-
void cXinelibPlayer::Activate(bool On)
{
int pos = 0, len = 0, fd = -1;
if(On) {
- if(m_UseResumeFile && !*m_ResumeFile)
+ if(m_UseResume && !*m_ResumeFile)
m_ResumeFile = cString::sprintf("%s.resume", *m_File);
- if(m_UseResumeFile && 0 <= (fd = open(m_ResumeFile, O_RDONLY))) {
+ if(m_UseResume && 0 <= (fd = open(m_ResumeFile, O_RDONLY))) {
if(read(fd, &pos, sizeof(int)) != sizeof(int))
pos = 0;
close(fd);
@@ -232,10 +217,9 @@ void cXinelibPlayer::Activate(bool On)
// (those may contain #subtitle, #volnorm etc. directives)
cString mrl;
if(*m_SubFile)
- mrl = cString::sprintf("%s%s#subtitle:%s%s",
+ mrl = cString::sprintf("%s%s#subtitle:%s",
m_File[0] == '/' ? "file:" : "",
*cPlaylist::EscapeMrl(m_File),
- m_SubFile[0] == '/' ? "file:" : "",
*cPlaylist::EscapeMrl(m_SubFile));
else if((*m_File)[0] == '/')
mrl = cString::sprintf("%s%s",
@@ -243,9 +227,6 @@ void cXinelibPlayer::Activate(bool On)
*cPlaylist::EscapeMrl(m_File));
else
mrl = cPlaylist::EscapeMrl(m_File);
-
- // Start replay
- UpdateNumTracks();
m_Error = !cXinelibDevice::Instance().PlayFile(mrl, pos);
LOGDBG("cXinelibPlayer playing %s (%s)", *m_File, m_Error ? "FAIL" : "OK");
@@ -264,10 +245,18 @@ void cXinelibPlayer::Activate(bool On)
if(ar && ar[0])
m_Playlist.Current()->Artist = ar;
- UpdateNumTracks();
+ // cdda tracks
+ if(m_Playlist.Count() == 1 && !strcmp("cdda:/", m_Playlist.First()->Filename)) {
+ int count = cXinelibDevice::Instance().PlayFileCtrl("GETAUTOPLAYSIZE CD");
+ if(count>1) {
+ for(int i=0; i<count; i++)
+ m_Playlist.Read(cString::sprintf("cdda:/%d", i+1));
+ m_Playlist.Del(m_Playlist.First());
+ }
+ }
}
} else {
- if(m_UseResumeFile && *m_ResumeFile) {
+ if(m_UseResume && *m_ResumeFile) {
pos = cXinelibDevice::Instance().PlayFileCtrl("GETPOS");
len = cXinelibDevice::Instance().PlayFileCtrl("GETLENGTH");
if(pos>10000 && pos < (len-10000)) {
@@ -286,7 +275,7 @@ void cXinelibPlayer::Activate(bool On)
}
m_ResumeFile = NULL;
}
- cXinelibDevice::Instance().PlayFile(NULL);
+ cXinelibDevice::Instance().PlayFile(NULL,0);
m_Error = false;
}
}
@@ -457,7 +446,7 @@ cXinelibPlayerControl::cXinelibPlayerControl(eMainMenuMode Mode, const char *Fil
number = 0;
lastTime.Set();
- m_Player->UseResumeFile( (Mode==ShowFiles) );
+ m_Player->m_UseResume = (Mode==ShowFiles);
MsgReplaying(*m_Player->Playlist().Current()->Title, *m_Player->File());
}
@@ -902,23 +891,21 @@ void cXinelibDvdPlayerControl::Show(void)
eOSState cXinelibDvdPlayerControl::ProcessKey(eKeys Key)
{
- // Check for end of stream and failed open
if ( !m_Player->Playing() ) {
LOGDBG("cXinelibDvdPlayerControl: EndOfStreamReached");
Hide();
return osEnd;
}
-
- // Update DVD title information
- const char *ti = cXinelibDevice::Instance().GetMetaInfo(miTitle);
- if (ti && ti[0] && (!m_CurrentDVDTitle || !strstr(m_CurrentDVDTitle, ti))) {
- memset(m_CurrentDVDTitle, 0, 63);
- strn0cpy(m_CurrentDVDTitle, ti, 63);
- m_Player->Playlist().Current()->Title = m_CurrentDVDTitle;
- MsgReplaying(m_CurrentDVDTitle, NULL);
+ else {
+ const char *ti = cXinelibDevice::Instance().GetMetaInfo(miTitle);
+ if (ti && ti[0] && (!m_CurrentDVDTitle || !strstr(m_CurrentDVDTitle, ti))) {
+ memset(m_CurrentDVDTitle, 0, 63);
+ strn0cpy(m_CurrentDVDTitle, ti, 63);
+ m_Player->Playlist().Current()->Title = m_CurrentDVDTitle;
+ MsgReplaying(m_CurrentDVDTitle, NULL);
+ }
}
- // Handle menu selection
if(Menu) {
if(Key == kRed)
Hide();
@@ -935,13 +922,10 @@ eOSState cXinelibDvdPlayerControl::ProcessKey(eKeys Key)
return osContinue;
}
- // Update progress bar display
if (m_DisplayReplay)
Show();
- // Handle menu navigation
-
- bool MenuDomain = !xc.dvd_arrow_keys_control_playback;
+ bool MenuDomain = false;
if(Key != kNone || m_DisplayReplay) {
const char *dt = cXinelibDevice::Instance().GetMetaInfo(miDvdTitleNo);
if(dt && !strcmp("0", dt))
@@ -969,8 +953,6 @@ eOSState cXinelibDvdPlayerControl::ProcessKey(eKeys Key)
}
}
- // Handle normal keys
-
if(!MenuDomain) {
switch(Key) {
// Replay control
@@ -1094,12 +1076,8 @@ eOSState cXinelibDvdPlayerControl::ProcessKey(eKeys Key)
class cXinelibImagePlayer : public cPlayer {
private:
- cString m_Mrl;
+ cString m_File;
bool m_Active;
- bool m_Error;
- cXinelibDevice *m_Dev;
-
- bool Play(void);
protected:
virtual void Activate(bool On);
@@ -1109,15 +1087,12 @@ class cXinelibImagePlayer : public cPlayer {
virtual ~cXinelibImagePlayer();
bool ShowImage(const char *File);
- bool Error(void) { return m_Error; }
};
cXinelibImagePlayer::cXinelibImagePlayer(const char *File)
{
- m_Mrl = File;
+ m_File = File;
m_Active = false;
- m_Error = false;
- m_Dev = &(cXinelibDevice::Instance());
}
cXinelibImagePlayer::~cXinelibImagePlayer()
@@ -1126,29 +1101,28 @@ cXinelibImagePlayer::~cXinelibImagePlayer()
Detach();
}
-bool cXinelibImagePlayer::Play(void)
-{
- if ((*m_Mrl)[0] == '/')
- m_Mrl = cString::sprintf("file:%s", *cPlaylist::EscapeMrl(m_Mrl));
-
- return m_Dev->PlayFile(m_Mrl, 0, true);
-}
-
void cXinelibImagePlayer::Activate(bool On)
{
- m_Active = On;
- m_Error = false;
- if (On)
- Play();
- else
- m_Dev->PlayFile(NULL);
+ if(On) {
+ m_Active = true;
+ cXinelibDevice::Instance().PlayFile( ( (*m_File)[0]=='/'
+ ? *cString::sprintf("file:%s", *cPlaylist::EscapeMrl(m_File))
+ : *m_File),
+ 0, true);
+ } else {
+ m_Active = false;
+ cXinelibDevice::Instance().PlayFile(NULL, 0);
+ }
}
bool cXinelibImagePlayer::ShowImage(const char *File)
{
- m_Mrl = File;
- if (m_Active)
- return Play();
+ m_File = File;
+ if(m_Active)
+ return cXinelibDevice::Instance().PlayFile( ( (*m_File)[0] == '/'
+ ? *cString::sprintf("file:%s", *cPlaylist::EscapeMrl(m_File))
+ : *m_File ),
+ 0, true);
return true;
}
diff --git a/menu.c b/menu.c
index c48c2363..2395f223 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c,v 1.57.2.2 2009-06-06 13:21:27 phintuka Exp $
+ * $Id: menu.c,v 1.57 2008-05-07 13:27:15 phintuka Exp $
*
*/
@@ -92,7 +92,7 @@ static char *ParentDir(const char *dir)
static char *LastDir(const char *dir)
{
- const char *pt = strrchr(dir, '/');
+ char *pt = strrchr(dir, '/');
if(pt && pt[0] && pt[1])
return strdup(pt+1);
return NULL;
@@ -275,12 +275,11 @@ eOSState cMenuBrowseFiles::Open(bool ForceOpen, bool Parent, bool Queue)
}
const char *d = GetCurrent()->Name();
char *buffer = NULL;
- if (asprintf(&buffer, "%s/%s", m_CurrentDir, d) > 0) {
- while(buffer[0] == '/' && buffer[1] == '/')
- strcpy(buffer, buffer+1);
- free(m_CurrentDir);
- m_CurrentDir = buffer;
- }
+ asprintf(&buffer, "%s/%s", m_CurrentDir, d);
+ while(buffer[0] == '/' && buffer[1] == '/')
+ strcpy(buffer, buffer+1);
+ free(m_CurrentDir);
+ m_CurrentDir = buffer;
Set();
return osContinue;
@@ -318,8 +317,7 @@ eOSState cMenuBrowseFiles::Open(bool ForceOpen, bool Parent, bool Queue)
if(it==Get(Current()))
index = i;
if(!it->IsDir())
- if (asprintf(&files[i++], "%s/%s", m_CurrentDir, it->Name()) < 0)
- i--;
+ asprintf(&files[i++], "%s/%s", m_CurrentDir, it->Name());
}
cControl::Shutdown();
cControl::Launch(new cXinelibImagesControl(files, index, i));
@@ -386,33 +384,36 @@ bool cMenuBrowseFiles::ScanDir(const char *DirName)
} else if(m_Mode == ShowImages && xc.IsImageFile(buffer)) {
Add(new cFileListItem(e->d_name, false));
- // DVD image (.iso)
- } else if (m_Mode == ShowFiles && xc.IsDvdImage(buffer)) {
- Add(new cFileListItem(e->d_name, false, false, false, true));
-
// video
} else if (m_Mode == ShowFiles && xc.IsVideoFile(buffer)) {
+ bool resume = false, subs = false, dvd = false;
+ char *pos = strrchr(e->d_name, '.');
cString subfile;
- cString resumefile;
-
- // separate subtitles ?
- cString basename = cString::sprintf("%s/%s", DirName, e->d_name);
- const char *p = strrchr(basename, '.');
- if (p)
- basename.Truncate(p - basename);
- int i;
- for(i=0; xc.s_subExts[i] && !*subfile; i++) {
- cString tmp = cString::sprintf("%s%s", *basename, xc.s_subExts[i]);
- if (stat(tmp, &st) == 0)
- subfile = tmp;
- }
+
+ if(pos) {
+ // .iso image -> dvd
+ if(pos && !strcasecmp(pos, ".iso"))
+ dvd = true;
+
+ // separate subtitles ?
+ subfile = cString::sprintf("%s/%s____", DirName, e->d_name);
+ char *p = strrchr(subfile, '.');
+ if( p ) {
+ int i;
+ for(i=0; xc.s_subExts[i] && !subs; i++) {
+ strcpy(p, xc.s_subExts[i]);
+ if (stat(subfile, &st) == 0)
+ subs = true;
+ }
+ }
+ }
// resume file ?
- resumefile = cString::sprintf("%s/%s.resume", DirName, e->d_name);
- if (stat(resumefile, &st) != 0)
- resumefile = NULL;
+ buffer = cString::sprintf("%s/%s.resume", DirName, e->d_name);
+ if (stat(buffer, &st) == 0)
+ resume = true;
- Add(new cFileListItem(e->d_name, false, *resumefile, subfile));
+ Add(new cFileListItem(e->d_name, false, resume, subs?*subfile:NULL, dvd));
}
}
}
diff --git a/menuitems.c b/menuitems.c
index f22c6e57..33b1b9b7 100644
--- a/menuitems.c
+++ b/menuitems.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: menuitems.c,v 1.11.2.2 2009-06-04 13:12:33 phintuka Exp $
+ * $Id: menuitems.c,v 1.11.2.1 2008-09-26 13:14:33 phintuka Exp $
*
*/
@@ -165,7 +165,7 @@ cFileListItem::cFileListItem(const char *name, bool IsDir,
void cFileListItem::Set(void)
{
cString txt;
- const char *pt;
+ char *pt;
if(m_ShowFlags) {
if(m_IsDir) {
if(m_IsDvd)
@@ -175,7 +175,7 @@ void cFileListItem::Set(void)
} else {
txt = cString::sprintf("%c\t%c\t%s", m_HasResume ? ' ' : '*', *m_SubFile ? 'S' : m_IsDvd ? 'D' : ' ', *m_Name);
if(NULL != (pt = strrchr(txt,'.')))
- txt.Truncate(pt - txt);
+ *pt = 0;
}
} else {
if(m_IsDir) {
@@ -183,7 +183,7 @@ void cFileListItem::Set(void)
} else {
txt = m_Name;
if(NULL != (pt = strrchr(txt,'.')))
- txt.Truncate(pt - txt);
+ *pt = 0;
}
}
SetText(txt);
diff --git a/po/it_IT.po b/po/it_IT.po
index be40098b..10dba4c4 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -7,15 +7,12 @@ msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <phintuka@users.sourceforge.net>\n"
"POT-Creation-Date: 2008-10-18 13:41+0300\n"
-"PO-Revision-Date: 2009-02-08 20:09+0100\n"
+"PO-Revision-Date: 2008-10-05 02:58+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: <vdr@linuxtv.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Italian\n"
-"X-Poedit-Country: ITALY\n"
-"X-Poedit-SourceCharset: utf-8\n"
msgid "custom"
msgstr "personalizza"
@@ -147,10 +144,10 @@ msgid "transparent grayscale"
msgstr "scala di grigi trasparente"
msgid "yes"
-msgstr "sì"
+msgstr "sì"
msgid "nearest"
-msgstr "più vicino"
+msgstr "più vicino"
msgid "bilinear"
msgstr "bilineare"
@@ -255,7 +252,7 @@ msgid "Audio settings"
msgstr "Impostazioni audio"
msgid "Headphone audio mode"
-msgstr "Modalità cuffie audio"
+msgstr "Modalità cuffie audio"
msgid "Audio Compression"
msgstr "Compressione audio"
@@ -291,7 +288,7 @@ msgid "Default playlist not found"
msgstr "Lista esec. predefinita non trovata"
msgid "Default playlist is not symlink"
-msgstr "La lista esec. predefinita non è un link simbolico"
+msgstr "La lista esec. predefinita non è un link simbolico"
msgid "Default playlist not defined"
msgstr "Lista esec. predefinita non definita"
@@ -331,7 +328,7 @@ msgid " Height"
msgstr " Altezza"
msgid " Speed"
-msgstr " Velocità"
+msgstr " Velocità"
msgid "fps"
msgstr "fps"
@@ -340,22 +337,22 @@ msgid "Audio Equalizer"
msgstr "Equalizzatore audio"
msgid "Use Video-Out Driver"
-msgstr "Utilizza driver uscita video"
+msgstr ""
msgid "none"
-msgstr "nessuno"
+msgstr ""
msgid "vector"
-msgstr "vettoriale"
+msgstr ""
msgid "full"
-msgstr "intero"
+msgstr ""
msgid "half (top)"
-msgstr "metà (superiore)"
+msgstr ""
msgid "half (bottom)"
-msgstr "metà (inferiore)"
+msgstr ""
msgid "Video"
msgstr "Video"
@@ -388,16 +385,16 @@ msgid "Post processing (ffmpeg)"
msgstr "Codifica (ffmpeg)"
msgid " Quality"
-msgstr " Qualità"
+msgstr " Qualità"
msgid " Mode"
-msgstr " Modalità"
+msgstr " Modalità"
msgid " Method"
msgstr " Metodo"
msgid " Cheap mode"
-msgstr " Modalità economica"
+msgstr " Modalità economica"
msgid " Pulldown"
msgstr " Pulldown"
@@ -448,7 +445,7 @@ msgid " Temporal strength"
msgstr " Resistenza temporale"
msgid "HUE"
-msgstr "Tonalità"
+msgstr "Tonalità"
msgid "Saturation"
msgstr "Saturazione"
@@ -457,13 +454,13 @@ msgid "Contrast"
msgstr "Contrasto"
msgid "Brightness"
-msgstr "Luminosità"
+msgstr "Luminosità"
msgid "Smooth fast forward"
msgstr "Avanzamento veloce leggero"
msgid "Fastest trick speed"
-msgstr "Trucco velocità più rapida"
+msgstr "Trucco velocità più rapida"
msgid "On-Screen Display"
msgstr "Messaggi in sovrimpressione (OSD)"
@@ -632,4 +629,3 @@ msgstr "Prova immagini"
msgid "X11/xine-lib output plugin"
msgstr "Plugin uscita X11/xine-lib"
-
diff --git a/setup_menu.c b/setup_menu.c
index c377d0ff..646d9eea 100644
--- a/setup_menu.c
+++ b/setup_menu.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: setup_menu.c,v 1.58.2.2 2009-06-04 13:13:39 phintuka Exp $
+ * $Id: setup_menu.c,v 1.58.2.1 2008-10-18 10:41:06 phintuka Exp $
*
*/
@@ -456,7 +456,7 @@ struct tvtime_s {
judder_correction = strstr(str, "judder_correction=0") ? 0 : 1;
use_progressive_frame_flag = strstr(str, "use_progressive_frame_flag=0") ? 0 : 1;
method=1;
- const char *m = strstr(str, "method=");
+ char *m = strstr(str, "method=");
if(m) {
char *tmp = strdup(m + 7);
if(strchr(tmp, ','))
diff --git a/tools/http.c b/tools/http.c
index 0e7de26a..4a529550 100644
--- a/tools/http.c
+++ b/tools/http.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: http.c,v 1.7 2009-06-02 08:37:58 phintuka Exp $
+ * $Id: http.c,v 1.6 2007-06-21 09:12:52 phintuka Exp $
*
*/
@@ -297,7 +297,7 @@ bool cHttpStreamer::Seek(void)
}
/* content type */
- const char *ext = strrchr(m_Filename, '.');
+ char *ext = strrchr(m_Filename, '.');
if(ext) {
const char *mime = mimetype(ext+1);
if(mime)
diff --git a/tools/iso639.h b/tools/iso639.h
index ae30fa0e..cd0e954f 100644
--- a/tools/iso639.h
+++ b/tools/iso639.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: iso639.h,v 1.4 2009-05-29 14:25:06 phintuka Exp $
+ * $Id: iso639.h,v 1.1.2.1 2008-09-26 13:49:45 phintuka Exp $
*
*/
@@ -60,7 +60,6 @@ static const struct {
{"guj", "gu"},
{"hau", "ha"},
{"heb", "he"},
- {"heb", "iw"},
{"hin", "hi"},
{"hun", "hu"},
{"ice", "is"},
@@ -158,9 +157,9 @@ static const struct {
static const char *iso639_2_to_iso639_1(const char *lang)
{
if (lang && lang[0]) {
- if (lang[1] && !lang[2]) {
+ if(lang[1] && !lang[2]) {
for (unsigned int i = 0 ; i < sizeof(ISO639_map) / sizeof(ISO639_map[0]); i++)
- if (!memcmp(ISO639_map[i].iso639_1, lang, 2))
+ if (((uint16_t*)ISO639_map[i].iso639_1)[0] == ((uint16_t*)lang)[0])
return ISO639_map[i].iso639_2;
LOGMSG("Unknown iso639-2 code: %s", lang);
}
@@ -172,9 +171,10 @@ static const char *iso639_2_to_iso639_1(const char *lang)
static const char *iso639_1_to_iso639_2(const char *lang)
{
if (lang && lang[0]) {
- if (lang[1] && lang[2] && !lang[3]) {
+ if(lang[1] && lang[2] && !lang[3]) {
for (unsigned int i = 0 ; i < sizeof(ISO639_map) / sizeof(ISO639_map[0]); i++)
- if (!memcmp(ISO639_map[i].iso639_2, lang, 3))
+ if (((uint16_t*)ISO639_map[i].iso639_2)[0] == ((uint16_t*)lang)[0] &&
+ ((uint8_t *)ISO639_map[i].iso639_2)[2] == ((uint8_t *)lang)[2])
return ISO639_map[i].iso639_1;
LOGMSG("Unknown iso639-1 code: %s", lang);
}
diff --git a/tools/playlist.c b/tools/playlist.c
index 652253c6..0217eca7 100644
--- a/tools/playlist.c
+++ b/tools/playlist.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: playlist.c,v 1.17.2.4 2009-06-04 21:04:34 phintuka Exp $
+ * $Id: playlist.c,v 1.17.2.1 2008-09-26 19:09:29 phintuka Exp $
*
*/
@@ -36,12 +36,6 @@
#define MAX_PLAYLIST_FILES 1024
-static void strip_extension(cString& fname)
-{
- const char *ext = strrchr(fname, '.');
- if (ext)
- fname.Truncate(ext - fname);
-}
//
// cPlaylistItem
@@ -49,7 +43,7 @@ static void strip_extension(cString& fname)
cPlaylistItem::cPlaylistItem(const char *filename)
{
- const char *pt;
+ char *pt;
Filename = filename;
Position = -1;
@@ -58,8 +52,9 @@ cPlaylistItem::cPlaylistItem(const char *filename)
Title = pt + 1;
else
Title = filename;
-
- strip_extension(Title);
+
+ if(NULL != (pt = strrchr(Title, '.')))
+ *pt = 0;
}
cPlaylistItem::cPlaylistItem(const char *filename,
@@ -67,6 +62,8 @@ cPlaylistItem::cPlaylistItem(const char *filename,
const char *title,
int position)
{
+ char *pt;
+
if(path[strlen(path)-1] != '/')
Filename = cString::sprintf("%s/%s", path, filename);
else
@@ -74,8 +71,8 @@ cPlaylistItem::cPlaylistItem(const char *filename,
Position = position;
Title = title ?: filename;
- if (!title)
- strip_extension(Title);
+ if(!title && (pt = strrchr(Title, '.')))
+ *pt = 0;
}
int cPlaylistItem::Compare(const cListObject &ListObject) const
@@ -145,10 +142,8 @@ class cID3Scanner : public cThread
{
cPlaylistItem *Item = NULL;
unsigned int Version = 0;
- const int priority = 10;
- errno = 0;
- if((nice(priority) == -1) && errno)
- LOGDBG("ID3Scanner: Can't nice to value: %d", priority);
+
+ (void)nice(10);
LOGDBG("ID3Scanner Started");
while(Running()) {
@@ -175,11 +170,11 @@ class cID3Scanner : public cThread
while(md_list) {
if ((key=EXTRACTOR_getKeywordTypeAsString(md_list->keywordType))) {
if (!strcasecmp(key,"title"))
- Item->Title = md_list->keyword;
+ Item->Title = strdup(md_list->keyword);
else if (!strcasecmp(key,"artist"))
- Item->Artist = md_list->keyword;
+ Item->Artist = strdup(md_list->keyword);
else if (!strcasecmp(key,"album"))
- Item->Album = md_list->keyword;
+ Item->Album = strdup(md_list->keyword);
else if (!strcasecmp(key,"track number"))
Item->Tracknumber = cString::sprintf("%s%s", strlen(md_list->keyword) == 1 ? "0" : "", md_list->keyword);
md_list=md_list->next;
@@ -534,7 +529,7 @@ bool cPlaylist::ReadCache(void)
int len = strlen(m_Folder);
cPlaylistItem *it = NULL;
cReadLine r;
- const char *pt;
+ char *pt;
while(NULL != (pt = r.Read(f))) {
if(!strncmp(pt, "File", 4)) {
it = NULL;
@@ -765,26 +760,29 @@ int cPlaylist::ReadPlaylist(const char *file)
if(f) {
LOGDBG("cPlaylist: parsing %s", file);
- const char *ext = strrchr(file, '.');
- if(!strcasecmp(ext, ".pls"))
+ char *pt = strrchr(file, '.');
+ if(!strcasecmp(pt, ".pls"))
parser = new cPlsReader(*this);
- else if(!strcasecmp(ext, ".asx"))
+ else if(!strcasecmp(pt, ".asx"))
parser = new cAsxReader(*this);
- else /*if(!strcasecmp(ext, ".m3u"))*/
+ else /*if(!strcasecmp(pt, ".m3u"))*/
parser = new cM3uReader(*this); /* parses plain lists (.ram, ...) too ...*/
- /* get folder */
- cString Folder = file;
- const char *folder = strrchr(Folder, '/');
- if (folder)
- Folder.Truncate(folder - Folder + 1);
+ cString Base(file);
+ if(NULL != (pt=strrchr(Base,'/')))
+ pt[1]=0;
int n = 0;
cReadLine r;
- char *pt;
while(NULL != (pt = r.Read(f)) && n < MAX_PLAYLIST_FILES) {
if(NULL != (pt = parser->Parse(pt))) {
+ if(depth && n==0) {
+ // TODO
+ // - add "separator" item
+ // Add(new cPlaylistItem(NULL, Base, "---");
+ }
+
if(xc.IsPlaylistFile(pt)) {
parser->ResetCache();
LOGDBG("cPlaylist: found playlist inside playlist");
@@ -797,7 +795,7 @@ int cPlaylist::ReadPlaylist(const char *file)
strchr(pt,'/') - pt < 8))
n += ReadPlaylist(pt);
else
- n += ReadPlaylist(cString::sprintf("%s%s", *Folder, pt));
+ n += ReadPlaylist(cString::sprintf("%s%s", *Base, pt));
depth--;
}
@@ -811,7 +809,7 @@ int cPlaylist::ReadPlaylist(const char *file)
Last()->Title = parser->Title();
} else {
// relative path
- Add(new cPlaylistItem(pt, Folder, parser->Title()));
+ Add(new cPlaylistItem(pt, Base, parser->Title()));
}
Last()->Position = parser->Position();
parser->ResetCache();
@@ -836,10 +834,10 @@ int cPlaylist::ReadPlaylist(const char *file)
static cString LastDir(cString& path)
{
- cString tmp = path;
- const char *pt = strrchr(tmp, '/');
+ cString tmp = strdup(path);
+ char *pt = strrchr(tmp, '/');
if(pt && pt > *tmp) {
- tmp.Truncate(pt - tmp);
+ *pt = 0;
pt = strrchr(tmp, '/');
if(pt)
return cString(pt+1);
@@ -854,10 +852,9 @@ bool cPlaylist::Read(const char *PlaylistFile, bool Recursive)
// extract playlist root folder
if(!*m_Folder) {
- const char *pt;
m_Folder = PlaylistFile;
- if (NULL != (pt=strrchr(m_Folder, '/')))
- m_Folder.Truncate(pt - m_Folder + 1);
+ if(strrchr(m_Folder, '/'))
+ *(strrchr(m_Folder, '/') + 1) = 0;
}
if(xc.IsPlaylistFile(PlaylistFile)) {
@@ -866,14 +863,15 @@ bool cPlaylist::Read(const char *PlaylistFile, bool Recursive)
m_Origin = ePlaylist;
cString dir = LastDir(m_Folder);
- const char *name = strrchr(PlaylistFile, '/');
+ char *name = strrchr(PlaylistFile, '/');
name = name ? name+1 : NULL;
if(*dir && name)
m_Name = cString::sprintf("%s - %s", *dir, name);
else
m_Name = name ?: "";
- strip_extension(m_Name);
+ if(strrchr(m_Name, '.'))
+ *(strrchr(m_Name, '.')) = 0;
} else if(PlaylistFile[ 0] == '/' &&
PlaylistFile[strlen(PlaylistFile)-1] == '/') {
@@ -884,7 +882,7 @@ bool cPlaylist::Read(const char *PlaylistFile, bool Recursive)
if(!*m_Name) {
m_Name = PlaylistFile;
- m_Name.Truncate( strrchr(m_Name, '/') - m_Name);
+ *(strrchr(m_Name, '/')) = 0;
if(strrchr(m_Name, '/')) {
cString dir = LastDir(m_Name);
if(*dir)
@@ -920,7 +918,7 @@ cString cPlaylist::EscapeMrl(const char *mrl)
static const uint8_t hex[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
const uint8_t *fn = (const uint8_t*)mrl;
int size = strlen(mrl) + 16;
- char *buf = (char *)malloc(size);
+ uint8_t *buf = (uint8_t*)malloc(size);
int i = 0, found = 0;
LOGDBG("cPlaylist::EscapeMrl('%s')", fn);
@@ -930,7 +928,7 @@ cString cPlaylist::EscapeMrl(const char *mrl)
while (*fn) {
if(size-7 < i)
- buf = (char *)realloc(buf, (size=size+16));
+ buf = (uint8_t *)realloc(buf, (size=size+16));
switch (*fn) {
case 1 ... ' ':
case 127 ... 255:
@@ -973,7 +971,7 @@ cString cPlaylist::EscapeMrl(const char *mrl)
buf[i] = 0;
LOGDBG(" --> '%s'", buf);
- return cString(buf, true);
+ return cString((const char*)buf, true);
}
cString cPlaylist::GetEntry(cPlaylistItem *i, bool isPlaylist, bool isCurrent)
diff --git a/tools/sdp.h b/tools/sdp.h
index e56f1ebd..47a3a409 100644
--- a/tools/sdp.h
+++ b/tools/sdp.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: sdp.h,v 1.2.2.1 2009-02-12 11:08:15 phintuka Exp $
+ * $Id: sdp.h,v 1.2 2006-12-14 12:52:49 phintuka Exp $
*
*/
@@ -15,16 +15,16 @@
#define SDP_MIME_TYPE "application/sdp"
-static const char *vdr_sdp_description(const char *vdr_ip,
- int vdr_svdrp_port,
- int vdr_xineliboutput_port,
- const char *rtp_ip,
- uint32_t rtp_ssrc,
- int rtp_port,
- int rtp_ttl)
+static char *vdr_sdp_description(const char *vdr_ip,
+ int vdr_svdrp_port,
+ int vdr_xineliboutput_port,
+ const char *rtp_ip,
+ uint32_t rtp_ssrc,
+ int rtp_port,
+ int rtp_ttl)
{
static uint8_t s_serial = 0;
- static cString s_data;
+ static char *s_data = NULL;
static char s_hostname[257] = {0};
uint64_t serial = (time(NULL) << 2) + ((s_serial++) & 0x03);
@@ -32,7 +32,9 @@ static const char *vdr_sdp_description(const char *vdr_ip,
if(!s_hostname[0])
gethostname(s_hostname, 256);
- s_data = cString::sprintf(
+ free(s_data);
+
+ asprintf(&s_data,
/*** session ***/
/* version */ "v=0"
/* origin */ "\r\n" "o=%s %u %"PRIu64" IN IP4 %s"
@@ -84,7 +86,8 @@ static const char *vdr_sdp_description(const char *vdr_ip,
/* tcp control/x-svdrp */
, vdr_ip
, vdr_svdrp_port
- );
+ );
+
return s_data;
}
diff --git a/tools/udp_pes_scheduler.c b/tools/udp_pes_scheduler.c
index 13a59c48..57b20a0b 100644
--- a/tools/udp_pes_scheduler.c
+++ b/tools/udp_pes_scheduler.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: udp_pes_scheduler.c,v 1.34.2.2 2009-06-06 13:27:41 phintuka Exp $
+ * $Id: udp_pes_scheduler.c,v 1.34 2008-04-28 20:53:07 phintuka Exp $
*
*/
@@ -676,11 +676,9 @@ void cUdpScheduler::Action(void)
#endif
/* UDP Scheduler needs high priority */
- const int priority = -5;
- SetPriority(priority);
+ SetPriority(-5);
+ (void)nice(-5);
errno = 0;
- if ((nice(priority) == -1) && errno)
- LOGDBG("cUdpScheduler: Can't nice to value: %d", priority);
m_Lock.Lock();
@@ -821,10 +819,9 @@ void cUdpScheduler::ReSend(int fd, uint64_t Pos, int Seq1, int Seq2)
if(fd < 0) /* no re-send for RTP */
return;
- struct {
- stream_udp_header_t hdr;
- char mem[64-sizeof(stream_udp_header_t)];
- } udp_ctrl = {{(uint64_t)INT64_C(-1), (uint16_t)-1}, {0}};
+ char udp_ctrl[64] = {0};
+ ((stream_udp_header_t *)udp_ctrl)->seq = (uint16_t)(-1);
+ ((stream_udp_header_t *)udp_ctrl)->pos = (uint64_t)(-1);
// Handle buffer wrap
if(Seq1 > Seq2)
@@ -836,10 +833,10 @@ void cUdpScheduler::ReSend(int fd, uint64_t Pos, int Seq1, int Seq2)
LOGDBG("cUdpScheduler::ReSend: requested range too large (%d-%d)",
Seq1, Seq2);
- sprintf((char*)udp_ctrl.hdr.payload,
+ sprintf((udp_ctrl+sizeof(stream_udp_header_t)),
"UDP MISSING %d-%d %" PRIu64,
Seq1, (Seq2 & UDP_BUFFER_MASK), Pos);
- send(fd, &udp_ctrl, sizeof(udp_ctrl), 0);
+ send(fd, udp_ctrl, sizeof(udp_ctrl), 0);
return;
}
@@ -878,19 +875,21 @@ void cUdpScheduler::ReSend(int fd, uint64_t Pos, int Seq1, int Seq2)
// buffer has been lost - send packet missing info
LOGRESEND("cUdpScheduler::ReSend: missing %d-%d @%d (hdr 0x%llx 0x%x)",
- Seq1, Seq1, Pos, udp_ctrl.hdr.pos, udp_ctrl.hdr.seq);
+ Seq1, Seq1, Pos,
+ ((stream_udp_header_t *)udp_ctrl)->pos,
+ ((stream_udp_header_t *)udp_ctrl)->seq);
int Seq0 = Seq1;
- for(; Seq1 < Seq2; Seq1++) {
+ for(; Seq1 <= Seq2; Seq1++) {
stream_rtp_header_impl_t *frame = m_BackLog->Get(Seq1+1);
if(frame && (ntohull(frame->hdr_ext.pos) - Pos < 100000))
break;
}
- sprintf((char*)udp_ctrl.hdr.payload,
+ sprintf((udp_ctrl+sizeof(stream_udp_header_t)),
"UDP MISSING %d-%d %" PRIu64,
Seq0, (Seq1 & UDP_BUFFER_MASK), Pos);
- send(fd, &udp_ctrl, sizeof(udp_ctrl), 0);
+ send(fd, udp_ctrl, sizeof(udp_ctrl), 0);
}
}
diff --git a/tools/vdrdiscovery.c b/tools/vdrdiscovery.c
index 7bc1ec53..82a9a109 100644
--- a/tools/vdrdiscovery.c
+++ b/tools/vdrdiscovery.c
@@ -7,7 +7,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: vdrdiscovery.c,v 1.5.2.1 2009-02-12 11:24:02 phintuka Exp $
+ * $Id: vdrdiscovery.c,v 1.5 2008-04-03 13:59:37 phintuka Exp $
*
*/
@@ -111,28 +111,25 @@ int udp_discovery_broadcast(int fd_discovery, int server_port, const char *serve
char *msg = NULL;
int result;
- if(server_address && *server_address) {
- result = asprintf(&msg,
+ if(server_address && *server_address)
+ asprintf(&msg,
DISCOVERY_1_0_HDR //"VDR xineliboutput DISCOVERY 1.0" "\r\n"
DISCOVERY_1_0_SVR //"Server port: %d" "\r\n"
DISCOVERY_1_0_ADDR //"Server Address: %d.%d.%d.%d \r\n"
DISCOVERY_1_0_VERSION //"Server version: xineliboutput-" XINELIBOUTPUT_VERSION "\r\n"
"\r\n",
server_port, server_address);
- } else {
- result = asprintf(&msg,
+ else
+ asprintf(&msg,
DISCOVERY_1_0_HDR //"VDR xineliboutput DISCOVERY 1.0" "\r\n"
DISCOVERY_1_0_SVR //"Server port: %d" "\r\n"
DISCOVERY_1_0_VERSION //"Server version: xineliboutput-" XINELIBOUTPUT_VERSION "\r\n"
"\r\n",
server_port);
- }
-
- if (result >= 0) {
- result = udp_discovery_send(fd_discovery, DISCOVERY_PORT, msg);
- free(msg);
- }
+
+ result = udp_discovery_send(fd_discovery, DISCOVERY_PORT, msg);
+ free(msg);
return result;
}
#else
@@ -141,18 +138,16 @@ static inline int udp_discovery_search(int fd_discovery, int port)
char *msg = NULL;
int result;
- result = asprintf(&msg,
- DISCOVERY_1_0_HDR /* "VDR xineliboutput DISCOVERY 1.0" "\r\n" */
- DISCOVERY_1_0_CLI /* "Client: %s:%d" "\r\n" */
- "\r\n",
- "255.255.255.255",
- port);
+ asprintf(&msg,
+ DISCOVERY_1_0_HDR /* "VDR xineliboutput DISCOVERY 1.0" "\r\n" */
+ DISCOVERY_1_0_CLI /* "Client: %s:%d" "\r\n" */
+ "\r\n",
+ "255.255.255.255",
+ port);
- if (result >= 0) {
- result = udp_discovery_send(fd_discovery, port, msg);
- free(msg);
- }
+ result = udp_discovery_send(fd_discovery, port, msg);
+ free(msg);
return result;
}
#endif
diff --git a/xine_frontend.c b/xine_frontend.c
index 0fab5c75..79cdf498 100644
--- a/xine_frontend.c
+++ b/xine_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend.c,v 1.53.2.3 2009-02-12 13:03:50 phintuka Exp $
+ * $Id: xine_frontend.c,v 1.53.2.1 2008-09-26 13:12:17 phintuka Exp $
*
*/
@@ -285,8 +285,7 @@ static void fe_frame_output_cb (void *data,
this->aspect_controller, (int)(video_aspect * 10000.0))
< sizeof(cmd)) {
LOGDBG("Aspect ratio changed, executing %s", cmd);
- if (system(cmd) == -1)
- LOGERR("%s failed", cmd);
+ system(cmd);
this->video_aspect = video_aspect;
}
}
@@ -547,23 +546,19 @@ static int fe_xine_init(frontend_t *this_gen, const char *audio_driver,
head = NULL;
else
*head = 0;
- if (asprintf(&tmp, "%sfbdev=%s%s",
- head ? orig : "", this->fb_dev, tail ? tail : "") < 0)
- tmp = NULL;
+ asprintf(&tmp, "%sfbdev=%s%s",
+ head ? orig : "", this->fb_dev, tail ? tail : "");
} else {
- if (asprintf(&tmp, "fbdev=%s%s%s", this->fb_dev, orig?",":"", orig?orig:""))
- tmp = NULL;
+ asprintf(&tmp, "fbdev=%s%s%s", this->fb_dev, orig?",":"", orig?orig:"");
}
LOGMSG("replacing environment variable DFBARGS with %s (original was %s)",
tmp, getenv("DFBARGS"));
free(orig);
} else {
- if (asprintf(&tmp, "fbdev=%s", this->fb_dev) < 0)
- tmp = NULL;
+ asprintf(&tmp, "fbdev=%s", this->fb_dev);
LOGMSG("setting environment variable DFBARGS to %s", tmp);
}
- if (tmp)
- setenv("DFBARGS", tmp, 1);
+ setenv("DFBARGS", tmp, 1);
free(tmp);
/*free(orig);*/
}
@@ -730,8 +725,7 @@ static int fe_xine_open(frontend_t *this_gen, const char *mrl)
this->input = NULL;
this->playback_finished = 1;
- if (asprintf(&url, "%s#nocache;demux:mpeg_block", mrl ? : "xvdr://") < 0)
- url = strdup("xvdr://");
+ asprintf(&url, "%s#nocache;demux:mpeg_block", mrl ? : "xvdr://");
result = xine_open(this->stream, url);
@@ -752,12 +746,11 @@ static int fe_xine_open(frontend_t *this_gen, const char *mrl)
#if !defined(IS_FBFE) && defined(FE_STANDALONE)
if(!strncmp(mrl, "xvdr", 4) && strstr(mrl, "//")) {
char *name = NULL, *end;
- if (asprintf(&name, "VDR - %s", strstr(mrl, "//")+2) >= 0) {
- if(NULL != (end = strstr(name, ":37890"))) *end = 0; /* hide only default port */
- XStoreName(this->display, this->window[0], name);
- XStoreName(this->display, this->window[1], name);
- free(name);
- }
+ asprintf(&name, "VDR - %s", strstr(mrl, "//")+2);
+ if(NULL != (end = strstr(name, ":37890"))) *end = 0; /* hide only default port */
+ XStoreName(this->display, this->window[0], name);
+ XStoreName(this->display, this->window[1], name);
+ free(name);
}
#endif
diff --git a/xine_frontend_lirc.c b/xine_frontend_lirc.c
index dfe2b440..a9c4e251 100644
--- a/xine_frontend_lirc.c
+++ b/xine_frontend_lirc.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend_lirc.c,v 1.10.2.1 2009-02-12 12:45:02 phintuka Exp $
+ * $Id: xine_frontend_lirc.c,v 1.10 2008-02-05 00:56:43 phintuka Exp $
*
*/
/*
@@ -20,7 +20,7 @@
*
* LIRC support added by Carsten Koch <Carsten.Koch@icem.de> 2000-06-16.
*
- * $Id: xine_frontend_lirc.c,v 1.10.2.1 2009-02-12 12:45:02 phintuka Exp $
+ * $Id: xine_frontend_lirc.c,v 1.10 2008-02-05 00:56:43 phintuka Exp $
*/
@@ -102,7 +102,7 @@ static void *lirc_receiver_thread(void *fe)
LOGMSG("lirc forwarding started");
- if (nice(-1) < 0) ;
+ nice(-1);
lircd_connect();
while(lirc_device_name && fd_lirc >= 0) {
diff --git a/xine_frontend_main.c b/xine_frontend_main.c
index 0fd424fd..b31ed9d8 100644
--- a/xine_frontend_main.c
+++ b/xine_frontend_main.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend_main.c,v 1.40.2.7 2009-02-12 12:53:29 phintuka Exp $
+ * $Id: xine_frontend_main.c,v 1.40.2.5 2008-10-21 15:10:02 phintuka Exp $
*
*/
@@ -140,8 +140,8 @@ static void *kbd_receiver_thread(void *fe)
terminate_key_pressed = 0;
- if (system("setterm -cursor off") == -1) ;
- if (system("setterm -blank off") == -1) ;
+ system("setterm -cursor off");
+ system("setterm -blank off");
/* Set stdin to deliver keypresses without buffering whole lines */
tcgetattr(STDIN_FILENO, &saved_tm);
@@ -190,7 +190,7 @@ static void *kbd_receiver_thread(void *fe)
alarm(0);
LOGDBG("Keyboard thread terminated");
tcsetattr(STDIN_FILENO, TCSANOW, &saved_tm);
- if (system("setterm -cursor on") == -1) ;
+ system("setterm -cursor on");
pthread_exit(NULL);
return NULL; /* never reached */
@@ -255,7 +255,7 @@ static void kbd_stop(void)
pthread_join (kbd_thread, &p);
tcsetattr(STDIN_FILENO, TCSANOW, &saved_tm);
- if (system("setterm -cursor on") == -1) ;
+ system("setterm -cursor on");
}
static void SignalHandler(int signum)
@@ -529,7 +529,7 @@ int main(int argc, char *argv[])
!strncmp(mrl, "xvdr:udp:", 9) ||
!strncmp(mrl, "xvdr:rtp:", 9) ||
!strncmp(mrl, "xvdr:pipe:", 10)))
- mrl[4] = '+';
+ mrl[5] = '+';
#endif
/* If server address not given, try to find server automatically */
@@ -547,12 +547,10 @@ int main(int argc, char *argv[])
if(mrl) {
char *tmp = mrl;
mrl = NULL;
- if (asprintf(&mrl, "%s//%s:%d", tmp, address, port) < 0)
- mrl = NULL;
+ asprintf(&mrl, "%s//%s:%d", tmp, address, port);
free(tmp);
} else
- if (asprintf(&mrl, "xvdr://%s:%d", address, port) < 0)
- mrl = NULL;
+ asprintf(&mrl, "xvdr://%s:%d", address, port);
} else {
PRINTF("---------------------------------------------------------------\n"
"WARNING: MRL not given and server not found from local network.\n"
@@ -565,8 +563,8 @@ int main(int argc, char *argv[])
if(mrl && strncmp(mrl, "xvdr:", 5) && strncmp(mrl, "xvdr+", 5)) {
char *mrl2 = mrl;
PRINTF("WARNING: MRL does not start with \'xvdr:\' (%s)", mrl);
- if (asprintf(&mrl, "xvdr://%s", mrl) >= 0)
- free(mrl2);
+ asprintf(&mrl, "xvdr://%s", mrl);
+ free(mrl2);
}
{
diff --git a/xine_input_vdr.c b/xine_input_vdr.c
index fb8d874f..4e46bd52 100644
--- a/xine_input_vdr.c
+++ b/xine_input_vdr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_input_vdr.c,v 1.138.2.15 2009-02-12 12:41:02 phintuka Exp $
+ * $Id: xine_input_vdr.c,v 1.138.2.13 2008-10-21 09:51:05 phintuka Exp $
*
*/
@@ -938,7 +938,6 @@ static int64_t pts_from_pes(const uint8_t *buf, int size)
return pts;
}
-#if 0
static int64_t dts_from_pes(const uint8_t *buf, int size)
{
int64_t dts = INT64_C(-1);
@@ -951,7 +950,6 @@ static int64_t dts_from_pes(const uint8_t *buf, int size)
}
return dts;
}
-#endif
static void pes_strip_pts(uint8_t *buf, int size)
{
@@ -1223,9 +1221,7 @@ static void queue_nosignal(vdr_input_plugin_t *this)
return;
}
- if (asprintf(&home,"%s/.xine/nosignal.mpg", xine_get_homedir()) < 0)
- return;
-
+ asprintf(&home,"%s/.xine/nosignal.mpg", xine_get_homedir());
int fd = open(path=home, O_RDONLY);
if(fd<0) fd = open(path="/etc/vdr/plugins/xineliboutput/nosignal.mpg", O_RDONLY);
if(fd<0) fd = open(path="/etc/vdr/plugins/xine/noSignal.mpg", O_RDONLY);
@@ -2717,10 +2713,9 @@ static void send_meta_info(vdr_input_plugin_t *this)
char *album = (char *)xine_get_meta_info(this->slave_stream, XINE_META_INFO_ALBUM);
char *tracknumber = (char *)xine_get_meta_info(this->slave_stream, XINE_META_INFO_TRACK_NUMBER);
- if (asprintf(&meta,
- "INFO METAINFO title=@%s@ artist=@%s@ album=@%s@ tracknumber=@%s@\r\n",
- title?:"", artist?:"", album?:"", tracknumber?:"") < 0)
- return;
+ asprintf(&meta,
+ "INFO METAINFO title=@%s@ artist=@%s@ album=@%s@ tracknumber=@%s@\r\n",
+ title?:"", artist?:"", album?:"", tracknumber?:"");
if(this->fd_control < 0)
this->funcs.xine_input_event(meta, NULL);
@@ -4017,7 +4012,7 @@ static void slave_track_maps_changed(vdr_input_plugin_t *this)
this->funcs.xine_input_event(tracks, NULL);
else
write_control(this, tracks);
- LOGDBG("%s", tracks);
+ LOGDBG(tracks);
}
#endif
@@ -4758,7 +4753,7 @@ static void *vdr_data_thread(void *this_gen)
LOGDBG("Data thread started");
- if (nice(-1) < 0) ;
+ (void)nice(-1);
if(this->udp || this->rtp) {
while(this->control_running) {
@@ -5148,8 +5143,8 @@ buf_element_t *post_frame_h264(vdr_input_plugin_t *this, buf_element_t *buf)
buf->decoder_info[0] = 0;
if (pts >= INT64_C(0)) {
-#if 0
int64_t dts = dts_from_pes (buf->content, buf->size);
+#if 0
if (dts < INT64_C(0)) {
buf->decoder_info[0] = pts;
} else {
@@ -5169,7 +5164,7 @@ buf_element_t *post_frame_h264(vdr_input_plugin_t *this, buf_element_t *buf)
LOGMSG("H.264: post pts %"PRId64" diff %d", pts, (int)(pts-this->last_delivered_vid_pts));
vdr_x_demux_control_newpts (this->stream, pts, BUF_FLAG_SEEK);
}
-#if 0
+
/* xine ffmpeg decoder does not handle pts <-> dts difference very well if P/B frames have pts */
if (abs(pts - this->last_delivered_vid_pts) < 90000 && pts < this->last_delivered_vid_pts) {
LOGDBG("H.264: -> pts %"PRId64" <- 0", pts);
@@ -5179,11 +5174,9 @@ buf_element_t *post_frame_h264(vdr_input_plugin_t *this, buf_element_t *buf)
/*buf->pts = 0;*/
} else {
LOGDBG("H.264: -> pts %"PRId64, pts);
- buf->pts = pts;
+ buf->pts = pts;
}
-#else
- buf->pts = pts;
-#endif
+
this->last_delivered_vid_pts = pts;
}
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c
index 46eb173a..c89bc3ef 100644
--- a/xine_sxfe_frontend.c
+++ b/xine_sxfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_sxfe_frontend.c,v 1.41.2.11 2009-02-18 21:18:29 phintuka Exp $
+ * $Id: xine_sxfe_frontend.c,v 1.41.2.9 2008-10-26 07:35:17 phintuka Exp $
*
*/
@@ -134,7 +134,6 @@ typedef struct sxfe_s {
Atom atom_wm_delete_window;
Atom atom_sxfe_interrupt;
Atom atom_wm_hints, atom_win_layer;
- Atom xa_NET_ACTIVE_WINDOW;
Atom atom_state, atom_state_add, atom_state_del;
Atom atom_state_above, atom_state_fullscreen, atom_state_on_top;
@@ -236,7 +235,6 @@ static void set_fullscreen_props(sxfe_t *this)
if(this->atom_state == None) {
this->atom_win_layer = XInternAtom(this->display, "_WIN_LAYER", False);
- this->xa_NET_ACTIVE_WINDOW = XInternAtom(this->display, "_NET_ACTIVE_WINDOW", False);
this->atom_state = XInternAtom(this->display, "_NET_WM_STATE", False);
this->atom_state_add = XInternAtom(this->display, "_NET_WM_STATE_ADD", False);
this->atom_state_del = XInternAtom(this->display, "_NET_WM_STATE_DEL", False);
@@ -275,15 +273,6 @@ static void set_fullscreen_props(sxfe_t *this)
XSendEvent(this->display, DefaultRootWindow(this->display), False,
SubstructureNotifyMask|SubstructureRedirectMask, &ev);
XUnlockDisplay(this->display);
-
- /* _NET_ACTIVE_WINDOW */
- XLockDisplay(this->display);
- ev.xclient.message_type = this->xa_NET_ACTIVE_WINDOW;
- ev.xclient.data.l[0] = 0;
- ev.xclient.data.l[1] = 0;
- XSendEvent(this->display, DefaultRootWindow(this->display), False,
- SubstructureNotifyMask|SubstructureRedirectMask, &ev);
- XUnlockDisplay(this->display);
}
static void set_border(sxfe_t *this, int border)
@@ -320,8 +309,7 @@ static void set_above(sxfe_t *this, int stay_above)
if(strstr(name, " (top)"))
*strstr(name, " (top)") = 0;
if(stay_above)
- if (asprintf(&newname, "%s (top)", name) < 0)
- newname = NULL;
+ asprintf(&newname, "%s (top)", name);
XStoreName(this->display, this->window[0], newname ?: name);
XStoreName(this->display, this->window[1], newname ?: name);
XFree(name);
diff --git a/xineliboutput.c b/xineliboutput.c
new file mode 100644
index 00000000..9b4b0f0f
--- /dev/null
+++ b/xineliboutput.c
@@ -0,0 +1,279 @@
+/*
+ * vdr-xineliboutput: xine-lib based output device plugin for VDR
+ *
+ * Copyright (C) 2003-2008 Petri Hintukainen <phintuka@users.sourceforge.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
+ *
+ *
+ * xineliboutput.c: VDR Plugin interface
+ *
+ * $Id: xineliboutput.c,v 1.30.2.3 2008-10-21 09:52:11 phintuka Exp $
+ *
+ */
+
+#include <vdr/plugin.h>
+
+#include "logdefs.h"
+#include "i18n.h"
+#include "config.h"
+#include "device.h"
+#include "setup_menu.h"
+#include "menu.h"
+#include "media_player.h"
+
+#if VDRVERSNUM < 10400
+# error VDR versions < 1.4.0 are not supported !
+#endif
+
+//---------------------------------plugin-------------------------------------
+
+static const char *VERSION = "1.0.3";
+static const char *DESCRIPTION = trNOOP("X11/xine-lib output plugin");
+static const char *MAINMENUENTRY = trNOOP("Media Player");
+
+cOsdObject *g_PendingMenuAction = NULL;
+
+class cPluginXinelibOutput : public cPlugin
+{
+ private:
+ // Add any member variables or functions you may need here.
+
+ public:
+ cPluginXinelibOutput(void);
+ virtual ~cPluginXinelibOutput();
+
+ virtual const char *Version(void) { return VERSION; }
+ virtual const char *Description(void) { return tr(DESCRIPTION); }
+ virtual const char *CommandLineHelp(void);
+
+ virtual bool ProcessArgs(int argc, char *argv[]);
+ virtual bool Initialize(void);
+ virtual bool Start(void);
+ virtual void Stop(void);
+ //virtual void Housekeeping(void);
+ virtual void MainThreadHook();
+ //virtual cString Active(void);
+ //virtual time_t WakeupTime(void);
+
+ virtual const char *MainMenuEntry(void) { return xc.hide_main_menu ? NULL : tr(MAINMENUENTRY); }
+ virtual cOsdObject *MainMenuAction(void);
+
+ virtual cMenuSetupPage *SetupMenu(void);
+ virtual bool SetupParse(const char *Name, const char *Value);
+
+ virtual bool Service(const char *Id, void *Data = NULL);
+ //virtual const char **SVDRPHelpPages(void);
+ //virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
+};
+
+cPluginXinelibOutput::cPluginXinelibOutput(void)
+{
+ // Initialize any member variables here.
+ // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
+ // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
+}
+
+cPluginXinelibOutput::~cPluginXinelibOutput()
+{
+ // Clean up after yourself!
+ cXinelibDevice::Dispose();
+}
+
+
+const char cmdLineHelp[] =
+" -l NAME --local=NAME Use local frontend NAME\n"
+" Supported frontends:\n"
+" sxfe (X11)\n"
+" fbfe (framebuffer)\n"
+" none (only remote frontends)\n"
+" -r PORT --remote=PORT Listen PORT for remote clients\n"
+" (default "LISTEN_PORT_S")\n"
+" none or 0 disables remote mode\n"
+" Also local interface address can be specified:\n"
+" --remote=<ip>:<port> (default is all interfaces)\n"
+" -A NAME --audio=NAME Use audio driver NAME for local frontend\n"
+" Supported values:\n"
+" auto, alsa, oss, esound, none\n"
+" -V NAME --video=NAME Use video driver NAME for local frontend\n"
+" Supported values:\n"
+" for sxfe: auto, x11, xshm, xv, xvmc, xxmc,\n"
+" vidix, sdl, opengl, none\n"
+" for fbfe: auto, fb, DirectFB, vidixfb,\n"
+" sdl, dxr3, aadxr3, none\n"
+#if 0
+" -m M --modeline=M Use modeline M for local frontend\n"
+" (example: )\n"
+#endif
+" -f --fullscreen Fullscreen mode (X11)\n"
+#ifdef HAVE_XRENDER
+" -D --hud Head Up Display OSD (X11)\n"
+#endif
+" -w --width=x Window width\n"
+" -h --height=x Window width\n"
+" -d DISP --display=DISP Use X11 display DISP\n"
+" (or framebuffer device name)\n"
+" -P NAME --post=NAME Use xine post plugin NAME\n"
+" format: pluginname[:arg=val[,arg=val]][,...]\n"
+" example: \n"
+" --post=upmix;tvtime:enabled=1,cheap_mode=1\n"
+" -p --primary Force xineliboutput to be primary device when\n"
+" there are active frontend(s)\n"
+" -c --exit-on-close Exit vdr when local frontend window is closed\n"
+;
+
+const char *cPluginXinelibOutput::CommandLineHelp(void)
+{
+ // Return a string that describes all known command line options.
+ return cmdLineHelp;
+}
+
+bool cPluginXinelibOutput::ProcessArgs(int argc, char *argv[])
+{
+ // Implement command line argument processing here if applicable.
+ return xc.ProcessArgs(argc, argv);
+}
+
+bool cPluginXinelibOutput::Initialize(void)
+{
+ // Initialize any background activities the plugin shall perform.
+ TRACEF("cPluginXinelibOutput::Initialize");
+
+#if VDRVERSNUM < 10507
+ RegisterI18n(Phrases);
+#endif
+
+ cXinelibDevice::Instance();
+ return true;
+}
+
+bool cPluginXinelibOutput::Start(void)
+{
+ // Start any background activities the plugin shall perform.
+ TRACEF("cPluginXinelibOutput::Start");
+ return cXinelibDevice::Instance().StartDevice();
+}
+
+void cPluginXinelibOutput::MainThreadHook(void)
+{
+ TRACEF("cPluginXinelibOutput::MainThreadHook");
+ return cXinelibDevice::Instance().MainThreadHook();
+}
+
+void cPluginXinelibOutput::Stop(void)
+{
+ // Start any background activities the plugin shall perform.
+ TRACEF("cPluginXinelibOutput::Stop");
+ return cXinelibDevice::Instance().StopDevice();
+}
+
+cOsdObject *cPluginXinelibOutput::MainMenuAction(void)
+{
+ // Perform the action when selected from the main VDR menu.
+ TRACEF("cPluginXinelibOutput::MainMenuAction");
+
+ if(xc.main_menu_mode == CloseOsd) {
+ xc.main_menu_mode = ShowMenu;
+ return NULL;
+ }
+
+ if(g_PendingMenuAction) {
+ cOsdObject *tmp = g_PendingMenuAction;
+ g_PendingMenuAction = NULL;
+ return tmp;
+ }
+
+ if(xc.hide_main_menu)
+ return NULL;
+
+#ifdef HAVE_XV_FIELD_ORDER
+ xc.field_order = xc.field_order ? 0 : 1;
+ cXinelibDevice::Instance().ConfigureWindow(xc.fullscreen, xc.width, xc.height,
+ xc.modeswitch, xc.modeline, xc.display_aspect,
+ xc.scale_video, xc.field_order);
+#endif
+ return new cMenuXinelib();
+}
+
+cMenuSetupPage *cPluginXinelibOutput::SetupMenu(void)
+{
+ // Return a setup menu in case the plugin supports one.
+ TRACEF("cPluginXinelibOutput::SetupMenu");
+ return new cMenuSetupXinelib();
+}
+
+bool cPluginXinelibOutput::SetupParse(const char *Name, const char *Value)
+{
+ // Parse your own setup parameters and store their values.
+ return xc.SetupParse(Name, Value);
+}
+
+bool cPluginXinelibOutput::Service(const char *Id, void *Data)
+{
+ if(Id) {
+ char *CData = (char*)Data;
+
+ if(!strcmp(Id, "MediaPlayer-1.0")) {
+ if(CData && *CData) {
+ LOGMSG("Service(%s, %s)", Id, CData);
+ cControl::Launch(new cXinelibPlayerControl(ShowFiles, CData));
+ return true;
+ }
+ LOGMSG("Service(%s) -> true", Id);
+ return true;
+ }
+
+ else if(!strcmp(Id, "MusicPlayer-1.0")) {
+ if(CData && *CData) {
+ LOGMSG("Service(%s, %s)", Id, CData);
+ cControl::Launch(new cXinelibPlayerControl(ShowMusic, CData));
+ return true;
+ }
+ LOGMSG("Service(%s) -> true", Id);
+ return true;
+ }
+
+ else if(!strcmp(Id, "DvdPlayer-1.0")) {
+ if(Data && *CData) {
+ LOGMSG("Service(%s, %s)", Id, CData);
+ cControl::Launch(new cXinelibDvdPlayerControl(CData));
+ return true;
+ }
+ LOGMSG("Service(%s) -> true", Id);
+ return true;
+ }
+
+ else if(!strcmp(Id, "ImagePlayer-1.0")) {
+ if(CData && *CData) {
+ LOGMSG("Service(%s, %s)", Id, CData);
+ char **list = new char*[2];
+ list[0] = strdup(CData);
+ list[1] = NULL;
+ cControl::Launch(new cXinelibImagesControl(list, 0, 1));
+ return true;
+ }
+ LOGMSG("Service(%s) -> true", Id);
+ return true;
+ }
+
+ }
+ return false;
+}
+
+extern "C"
+void *VDRPluginCreator(void) __attribute__((visibility("default")));
+
+VDRPLUGINCREATOR(cPluginXinelibOutput); // Don't touch this!