diff options
-rw-r--r-- | HISTORY | 21 | ||||
-rw-r--r-- | config.c | 11 | ||||
-rw-r--r-- | config.h | 5 | ||||
-rw-r--r-- | device.c | 5 | ||||
-rw-r--r-- | device.h | 5 | ||||
-rw-r--r-- | frontend.c | 26 | ||||
-rw-r--r-- | frontend_svr.c | 6 | ||||
-rw-r--r-- | i18n.c | 4 | ||||
-rw-r--r-- | media_player.c | 49 | ||||
-rw-r--r-- | menuitems.c | 13 | ||||
-rw-r--r-- | osd.c | 20 | ||||
-rw-r--r-- | po/de_DE.po | 4 | ||||
-rw-r--r-- | tools/iconv.h | 6 | ||||
-rw-r--r-- | tools/iso639.h | 17 | ||||
-rw-r--r-- | tools/metainfo_menu.c | 3 | ||||
-rw-r--r-- | tools/pes.c | 10 | ||||
-rw-r--r-- | tools/playlist.c | 5 | ||||
-rw-r--r-- | xine/post.c | 13 | ||||
-rw-r--r-- | xine/post_util.h | 4 | ||||
-rw-r--r-- | xine_frontend.c | 4 | ||||
-rw-r--r-- | xine_frontend_main.c | 39 | ||||
-rw-r--r-- | xine_input_vdr.c | 190 | ||||
-rw-r--r-- | xine_post_audiochannel.c | 6 | ||||
-rw-r--r-- | xine_post_autocrop.c | 7 | ||||
-rw-r--r-- | xine_post_swscale.c | 8 | ||||
-rw-r--r-- | xine_sxfe_frontend.c | 46 | ||||
-rw-r--r-- | xineliboutput.c | 8 |
27 files changed, 344 insertions, 191 deletions
@@ -1,6 +1,27 @@ VDR Plugin 'xineliboutput' Revision History ------------------------------------------- +2008-10-04: Version 1.0.2 (branch-1_0_x) +Backported bugfixes from CVS trunk: +- Fixed segfault when committing uninitialized OSD (Thanks to Rolf Ahrenberg) +- Fixed buffer errors when switching from HD channel to SD channel +- Fixed selecting DVD subtitles language from DVD menus +- Fixed setting DVD subtitles preferred language +- Fixed missing VDR OSD while playing DVDs +- Fixed DVD menu navigation when menu is not in title 0 +- Fixed infinite loop when trying to replay unaccessible DVD +- Fixed infinite loop when trying to play only one unacessible or very short music file +- Fixed replaying images from network sources (http://, ...) (Thanks to Rolf Ahrenberg) +- Fixed segfault when media file meta info contains thumbnails (Thanks to Petri Helin) +- Fixed smooth trickspeed setup menu entry with VDR-1.5.10+ (Thanks to Timo Eskola) +- Fixed vdr-sxfe icon in 64-bit systems +- Fixed updating window title when protocol is part of mrl +- Fixed German translation for "Play DVD disc >>" (Thanks to Helmar Gerloni) +- Increased timeout when opening media files from network sources (Thanks to Tobias Grimm) +- OS X build fixes (Thanks to Tero Siironen) +- xine-lib 1.2 updates +- Added WM class hint ("VDR") to vdr-sxfe windows (Thanks to Rolf Ahrenberg) + 2008-05-07: Version 1.0.1 - Fixed freezes while zapping and/or seeking @@ -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 2008-04-29 12:44:25 phintuka Exp $ + * $Id: config.c,v 1.63.2.2 2008-09-26 19:15:48 phintuka Exp $ * */ @@ -596,6 +596,9 @@ bool config_t::ProcessArgs(int argc, char *argv[]) case 'f': ProcessArg("Fullscreen", "1"); break; case 'D': ProcessArg("X11.HUDOSD", "1"); +#ifndef HAVE_XRENDER + LOGMSG("HUD OSD not supported\n"); +#endif break; case 'w': ProcessArg("Fullscreen", "0"); ProcessArg("X11.WindowWidth", optarg); @@ -789,9 +792,9 @@ bool config_t::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name, "Playlist.Artist")) playlist_artist = atoi(Value); else if (!strcasecmp(Name, "Playlist.Album")) playlist_album = atoi(Value); - else if (!strcasecmp(Name, "Advanced.LiveModeSync")) xc.live_mode_sync = atoi(Value); - else if (!strcasecmp(Name, "Advanced.AdjustSCR")) xc.scr_tunning = atoi(Value); - else if (!strcasecmp(Name, "Advanced.SCRSpeed")) xc.scr_hz = atoi(Value); + else if (!strcasecmp(Name, "Advanced.LiveModeSync")) live_mode_sync = atoi(Value); + else if (!strcasecmp(Name, "Advanced.AdjustSCR")) scr_tunning = atoi(Value); + else if (!strcasecmp(Name, "Advanced.SCRSpeed")) scr_hz = atoi(Value); else if (!strcasecmp(Name, "Audio.Equalizer")) sscanf(Value,"%d %d %d %d %d %d %d %d %d %d", @@ -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 2008-04-29 12:44:25 phintuka Exp $ + * $Id: config.h,v 1.46.2.1 2008-09-26 13:03:27 phintuka Exp $ * */ @@ -152,6 +152,9 @@ #define OSD_SCALING_count 3 #define SUBTITLESIZE_count 7 +#if VDRVERSNUM >= 10510 +# define DEVICE_SUPPORTS_IBP_TRICKSPEED +#endif #define HIDDEN_OPTION(opt) \ (xc.IsOptionHidden(xc.opt)) @@ -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 2008-04-14 19:58:50 phintuka Exp $ + * $Id: device.c,v 1.57.2.1 2008-09-26 13:03:19 phintuka Exp $ * */ @@ -26,9 +26,6 @@ //#define FORWARD_DVD_SPUS //#define DEBUG_SWITCHING_TIME //#define LOG_TRICKSPEED -#if VDRVERSNUM >= 10510 -# define DEVICE_SUPPORTS_IBP_TRICKSPEED -#endif #include "logdefs.h" #include "config.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 2008-04-14 19:58:50 phintuka Exp $ + * $Id: device.h,v 1.34.2.1 2008-09-26 13:41:52 phintuka Exp $ * */ @@ -26,7 +26,8 @@ typedef enum { miArtist = 2, miAlbum = 3, miDvdTitleNo = 4, - mi_Count = 5 + miDvdButtons = 5, + mi_Count = 6 } eMetainfoType; # define ttXSubtitleNone (-2) @@ -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 2008-04-14 19:58:54 phintuka Exp $ + * $Id: frontend.c,v 1.59.2.2 2008-09-26 13:46:49 phintuka Exp $ * */ @@ -198,6 +198,12 @@ void cXinelibThread::InfoHandler(const char *info) } } + else if(!strncmp(info, "DVDBUTTONS ", 11)) { + map += 11; + while(*map == ' ') map++; + cXinelibDevice::Instance().SetMetaInfo(miDvdButtons, map); + } + else if(!strncmp(info, "TITLE ", 6)) { map += 6; while(*map == ' ') map++; @@ -769,6 +775,24 @@ bool cXinelibThread::PlayFile(const char *FileName, int Position, } else { if(xc.extsub_size >= 0) Xine_Control("EXTSUBSIZE", xc.extsub_size); + +#if VDRVERSNUM >= 10515 + // set preferred subtitle language + if (Setup.DisplaySubtitles) { + const char *langs = I18nLanguageCode(Setup.SubtitleLanguages[0]); + if (langs) { + char lang1[5]; + strn0cpy(lang1, langs, 4); /* truncate */ + const char *spu_lang = iso639_1_to_iso639_2(lang1); + LOGMSG("Preferred SPU language: %s (%s)", lang1, spu_lang); + if (spu_lang && spu_lang[0] && spu_lang[1] && !spu_lang[2]) + Xine_Control(cString::sprintf("SPUSTREAM %s", spu_lang)); + } + } else { + LOGMSG("Preferred SPU language: (none)"); + Xine_Control(cString::sprintf("SPUSTREAM %d", ttXSubtitleNone)); + } +#endif } return (!GetStopSignal()) && (result==0); diff --git a/frontend_svr.c b/frontend_svr.c index 720106f8..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 2008-04-10 20:21:45 phintuka Exp $ + * $Id: frontend_svr.c,v 1.56.2.2 2008-09-26 19:37:37 phintuka Exp $ * */ @@ -52,7 +52,7 @@ #define LOG_OSD_BANDWIDTH (128*1024) /* log messages if OSD bandwidth > 1 Mbit/s */ #define PLAYFILE_CTRL_TIMEOUT 300 /* ms */ -#define PLAYFILE_TIMEOUT 5000 /* ms */ +#define PLAYFILE_TIMEOUT 20000 /* ms */ typedef struct { int Size; @@ -1108,7 +1108,7 @@ void cXinelibServer::Handle_Control_KEY(int cli, const char *arg) bool repeat = false, release = false; strn0cpy(buf, arg, sizeof(buf)); - int n = strlen(buf)-1; + size_t n = *buf ? strlen(buf)-1 : 0; while(n && buf[n]==' ') buf[n--]=0; /* trailing spaces */ if(NULL != (key=strchr(buf, ' '))) { while(*key == ' ') @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: i18n.c,v 1.36 2008-04-14 21:22:08 phintuka Exp $ + * $Id: i18n.c,v 1.36.2.1 2008-09-26 13:37:19 phintuka Exp $ * * Translations provided by: * @@ -1742,7 +1742,7 @@ const tI18nPhrase Phrases[] = { "", // Czech }, { "Play DVD disc >>", // English - "DVD abspielen", // Deutsch + "DVD abspielen >>", // Deutsch "", // Slovenski "Riproduci disco DVD >>", // Italiano "", // Nederlands diff --git a/media_player.c b/media_player.c index ebaced6d..b4cf474a 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 2008-05-07 13:27:15 phintuka Exp $ + * $Id: media_player.c,v 1.52.2.4 2008-09-26 19:37:37 phintuka Exp $ * */ @@ -45,7 +45,7 @@ class cXinelibPlayer : public cPlayer cPlaylist m_Playlist; - bool m_Replaying; + bool m_Error; int m_Speed; protected: @@ -71,7 +71,8 @@ class cXinelibPlayer : public cPlayer int Speed(void) { return m_Speed; }; bool NextFile(int step); - bool Replaying(void) { return m_Replaying; } + bool Playing(void) { return !(m_Error || cXinelibDevice::Instance().EndOfStreamReached()); } + bool Error(void) { return m_Error; } bool m_UseResume; @@ -86,11 +87,11 @@ cXinelibPlayer::cXinelibPlayer(const char *File, bool Queue, const char *SubFile { m_ResumeFile = NULL; m_UseResume = true; - m_Replaying = false; + m_Error = false; m_Speed = 1; if(File) { - int len = strlen(File); + size_t len = strlen(File); if(len && File[len-1] == '/') { // whole directory, create temporary playlist m_Playlist.Read(File, true); @@ -194,9 +195,7 @@ bool cXinelibPlayer::NextFile(int step) m_SubFile = NULL; Activate(true); - if(!m_Replaying) - return false; - return true; + return !m_Error; } return false; @@ -228,10 +227,10 @@ void cXinelibPlayer::Activate(bool On) *cPlaylist::EscapeMrl(m_File)); else mrl = cPlaylist::EscapeMrl(m_File); - m_Replaying = cXinelibDevice::Instance().PlayFile(mrl, pos); - LOGDBG("cXinelibPlayer playing %s (%s)", *m_File, m_Replaying?"OK":"FAIL"); + m_Error = !cXinelibDevice::Instance().PlayFile(mrl, pos); + LOGDBG("cXinelibPlayer playing %s (%s)", *m_File, m_Error ? "FAIL" : "OK"); - if(m_Replaying) { + if(!m_Error) { // update playlist metainfo const char *ti = cXinelibDevice::Instance().GetMetaInfo(miTitle); const char *tr = cXinelibDevice::Instance().GetMetaInfo(miTracknumber); @@ -277,7 +276,7 @@ void cXinelibPlayer::Activate(bool On) m_ResumeFile = NULL; } cXinelibDevice::Instance().PlayFile(NULL,0); - m_Replaying = false; + m_Error = false; } } @@ -487,7 +486,7 @@ void cXinelibPlayerControl::Queue(const char *File) OpenPlayer(File, true); cControl::Launch(new cXinelibPlayerControl(ShowMusic, NULL)); } else { - int len = strlen(File); + size_t len = strlen(File); if(len && File[len-1] == '/') m_Player->Playlist().Read(File, true); else @@ -582,11 +581,9 @@ cOsdObject *cXinelibPlayerControl::GetInfo(void) eOSState cXinelibPlayerControl::ProcessKey(eKeys Key) { - if (cXinelibDevice::Instance().EndOfStreamReached() || - !m_Player->Replaying() ) { + if ( !m_Player->Playing() ) { LOGDBG("cXinelibPlayerControl: EndOfStreamReached"); - LOGDBG("cXinelibPlayerControl: Replaying = %d", m_Player->Replaying()); - if (m_Mode == ShowMusic && m_Player->Files() == 1) { + if (m_Mode == ShowMusic && m_Player->Files() == 1 && !m_Player->Error()) { m_Player->NextFile(0); return osContinue; } @@ -894,7 +891,8 @@ void cXinelibDvdPlayerControl::Show(void) eOSState cXinelibDvdPlayerControl::ProcessKey(eKeys Key) { - if (cXinelibDevice::Instance().EndOfStreamReached()) { + if ( !m_Player->Playing() ) { + LOGDBG("cXinelibDvdPlayerControl: EndOfStreamReached"); Hide(); return osEnd; } @@ -932,6 +930,11 @@ eOSState cXinelibDvdPlayerControl::ProcessKey(eKeys Key) const char *dt = cXinelibDevice::Instance().GetMetaInfo(miDvdTitleNo); if(dt && !strcmp("0", dt)) MenuDomain = true; + else { + dt = cXinelibDevice::Instance().GetMetaInfo(miDvdButtons); + if(dt && *dt && *dt != '0') + MenuDomain = true; + } } if(MenuDomain) { @@ -1102,7 +1105,10 @@ void cXinelibImagePlayer::Activate(bool On) { if(On) { m_Active = true; - cXinelibDevice::Instance().PlayFile(*cString::sprintf("file:%s", *cPlaylist::EscapeMrl(m_File)), 0, 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); @@ -1113,7 +1119,10 @@ bool cXinelibImagePlayer::ShowImage(const char *File) { m_File = File; if(m_Active) - return cXinelibDevice::Instance().PlayFile(*cString::sprintf("file:%s", *cPlaylist::EscapeMrl(m_File)), 0, true); + return cXinelibDevice::Instance().PlayFile( ( (*m_File)[0] == '/' + ? *cString::sprintf("file:%s", *cPlaylist::EscapeMrl(m_File)) + : *m_File ), + 0, true); return true; } diff --git a/menuitems.c b/menuitems.c index 719f221d..33b1b9b7 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,12 +4,10 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c,v 1.11 2008-03-13 21:29:00 phintuka Exp $ + * $Id: menuitems.c,v 1.11.2.1 2008-09-26 13:14:33 phintuka Exp $ * */ -#include <math.h> - #include "i18n.h" #include "menuitems.h" @@ -103,6 +101,13 @@ cMenuEditFpIntItem::cMenuEditFpIntItem(const char *Name, int *Value, int Min, in Set(); } +static int my_exp10(int x) +{ + int r = 1; + for (; x > 0; x--, r *= 10) ; + return r; +} + void cMenuEditFpIntItem::Set(void) { if(*value == 0 && *zeroString) @@ -112,7 +117,7 @@ void cMenuEditFpIntItem::Set(void) else if (maxString && *value == max) SetValue(maxString); else - SetValue(cString::sprintf("%1.1f", ((float)(*value)) / exp10f(decimals))); + SetValue(cString::sprintf("%1.1f", ((float)(*value)) / (float)my_exp10(decimals))); } // --- cMenuEditStraI18nItem ------------------------------------------------- @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: osd.c,v 1.24 2008-04-29 12:44:25 phintuka Exp $ + * $Id: osd.c,v 1.24.2.1 2008-09-26 13:17:43 phintuka Exp $ * */ @@ -333,14 +333,16 @@ void cXinelibOsd::Flush(void) /* XXX what if only palette has been changed ? */ int NumColors; const tColor *Colors = Bitmap->Colors(NumColors); - osd_rect_t DirtyArea = {x1:x1, y1:y1, x2:x2, y2:y2}; - CmdRle(i, - Left() + Bitmap->X0(), Top() + Bitmap->Y0(), - Bitmap->Width(), Bitmap->Height(), - (unsigned char *)Bitmap->Data(0,0), - NumColors, (unsigned int *)Colors, - &DirtyArea); - SendDone++; + if (Colors) { + osd_rect_t DirtyArea = {x1:x1, y1:y1, x2:x2, y2:y2}; + CmdRle(i, + Left() + Bitmap->X0(), Top() + Bitmap->Y0(), + Bitmap->Width(), Bitmap->Height(), + (unsigned char *)Bitmap->Data(0,0), + NumColors, (unsigned int *)Colors, + &DirtyArea); + SendDone++; + } } Bitmap->Clean(); } diff --git a/po/de_DE.po b/po/de_DE.po index 002c4daa..d25eb449 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <phintuka@users.sourceforge.net>\n" -"POT-Creation-Date: 2008-04-21 10:36+0300\n" +"POT-Creation-Date: 2008-05-23 12:36+0300\n" "PO-Revision-Date: 2007-11-23 10:17+0200\n" "Last-Translator: Udo Richter\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -223,7 +223,7 @@ msgid "Play remote DVD >>" msgstr "Entfernte DVD abspielen >>" msgid "Play DVD disc >>" -msgstr "DVD abspielen" +msgstr "DVD abspielen >>" msgid "Play remote CD >>" msgstr "Entfernte CD abspielen >>" diff --git a/tools/iconv.h b/tools/iconv.h index 3ce0fb28..947ecd50 100644 --- a/tools/iconv.h +++ b/tools/iconv.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: iconv.h,v 1.5 2007-09-18 09:13:13 phintuka Exp $ + * $Id: iconv.h,v 1.5.2.1 2008-09-26 13:14:37 phintuka Exp $ * */ @@ -74,11 +74,7 @@ cString cIConv::Translate(const char *Text) const size_t inc = strlen(Text); size_t outc = inc<2048 ? 2048 : inc+1; -#ifdef __APPLE__ - const char *in = Text; -#else char *in = (char*)Text; -#endif char *buf = (char*)malloc(outc+1); char *out = buf; diff --git a/tools/iso639.h b/tools/iso639.h index 66438f13..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.1 2008-02-20 03:55:11 phintuka Exp $ + * $Id: iso639.h,v 1.1.2.1 2008-09-26 13:49:45 phintuka Exp $ * */ @@ -168,4 +168,19 @@ static const char *iso639_2_to_iso639_1(const char *lang) return NULL; } +static const char *iso639_1_to_iso639_2(const char *lang) +{ + if (lang && lang[0]) { + if(lang[1] && lang[2] && !lang[3]) { + for (unsigned int i = 0 ; i < sizeof(ISO639_map) / sizeof(ISO639_map[0]); i++) + 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); + } + return lang; + } + return NULL; +} + #endif diff --git a/tools/metainfo_menu.c b/tools/metainfo_menu.c index 56a3f388..0477916d 100644 --- a/tools/metainfo_menu.c +++ b/tools/metainfo_menu.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: metainfo_menu.c,v 1.1 2008-05-07 13:27:15 phintuka Exp $ + * $Id: metainfo_menu.c,v 1.1.2.1 2008-09-26 13:16:49 phintuka Exp $ * */ @@ -47,6 +47,7 @@ void cMetainfoMenu::Display(void) md_list = EXTRACTOR_getKeywords(plugins, m_Filename); md_list = EXTRACTOR_removeEmptyKeywords (md_list); md_list = EXTRACTOR_removeDuplicateKeywords(md_list, 0); + md_list = EXTRACTOR_removeKeywordsOfType(md_list, EXTRACTOR_THUMBNAILS); const char *key; char * buf; diff --git a/tools/pes.c b/tools/pes.c index 2845bf07..c2d54a30 100644 --- a/tools/pes.c +++ b/tools/pes.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: pes.c,v 1.2 2008-02-04 23:49:50 phintuka Exp $ + * $Id: pes.c,v 1.2.2.1 2008-09-26 19:08:25 phintuka Exp $ * */ @@ -24,7 +24,7 @@ int64_t pes_get_pts(const uint8_t *buf, int len) if ((buf[6] & 0x30) != 0) return INT64_C(-1); - if ((len > 14) && (buf[7] & 0x80)) { /* pts avail */ + if ((len > 13) && (buf[7] & 0x80)) { /* pts avail */ int64_t pts; pts = ((int64_t)(buf[ 9] & 0x0E)) << 29 ; pts |= ((int64_t) buf[10]) << 22 ; @@ -69,7 +69,7 @@ void pes_change_pts(uint8_t *buf, int len, int64_t new_pts) if ((buf[6] & 0x30) != 0) return; - if ((len > 14) && (buf[7] & 0x80)) { /* pts avail */ + if ((len > 13) && (buf[7] & 0x80)) { /* pts avail */ buf[ 9] = ((new_pts >> 29) & 0x0E) | (buf[ 9] & 0xf1); buf[10] = ((new_pts >> 22) & 0xFF); buf[11] = ((new_pts >> 14) & 0xFE) | (buf[11] & 0x01); @@ -94,8 +94,8 @@ int pes_strip_pts_dts(uint8_t *buf, int size) pes_len -= n; /* update packet len */ buf[4] = pes_len >> 8; /* packet len (hi) */ buf[5] = pes_len & 0xff; /* packet len (lo) */ - buf[7] &= 0x7f; /* clear pts flag */ - buf[8] -= 5; /* update header len */ + buf[7] &= 0x3f; /* clear pts and dts flags */ + buf[8] -= n; /* update header len */ memmove(buf+4+n, buf+9+n, size-9-n); return size - n; } diff --git a/tools/playlist.c b/tools/playlist.c index 9f4c85c3..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 2008-04-03 15:11:26 phelin Exp $ + * $Id: playlist.c,v 1.17.2.1 2008-09-26 19:09:29 phintuka Exp $ * */ @@ -873,7 +873,8 @@ bool cPlaylist::Read(const char *PlaylistFile, bool Recursive) if(strrchr(m_Name, '.')) *(strrchr(m_Name, '.')) = 0; - } else if(PlaylistFile[strlen(PlaylistFile)-1] == '/') { + } else if(PlaylistFile[ 0] == '/' && + PlaylistFile[strlen(PlaylistFile)-1] == '/') { // Scan folder Result = ScanFolder(PlaylistFile, Recursive) > 0; m_Origin = eImplicit; diff --git a/xine/post.c b/xine/post.c index 51ba3188..9846c411 100644 --- a/xine/post.c +++ b/xine/post.c @@ -83,7 +83,7 @@ static int __pplugin_retrieve_parameters(post_object_t *pobj) post_api->get_parameters(pobj->post, pobj->param_data); if(!pnum) - pobj->properties_names = (char **) xine_xmalloc(sizeof(char *) * 2); + pobj->properties_names = (char **) calloc(2, sizeof(char *)); else pobj->properties_names = (char **) realloc(pobj->properties_names, sizeof(char *) * (pnum + 2)); @@ -276,13 +276,12 @@ static post_element_t **pplugin_parse_and_load(fe_t *fe, if(post) { if(!(*post_elements_num)) - post_elements = (post_element_t **) xine_xmalloc(sizeof(post_element_t *) * 2); + post_elements = (post_element_t **) calloc(2, sizeof(post_element_t *)); else post_elements = (post_element_t **) realloc(post_elements, sizeof(post_element_t *) * ((*post_elements_num) + 2)); - post_elements[(*post_elements_num)] = (post_element_t *) - xine_xmalloc(sizeof(post_element_t)); + post_elements[(*post_elements_num)] = calloc(1, sizeof(post_element_t)); post_elements[(*post_elements_num)]->post = post; post_elements[(*post_elements_num)]->name = strdup(plugin); #if 1 @@ -500,8 +499,7 @@ static post_element_t **_pplugin_join_deinterlace_and_post_elements(fe_t *fe, in if( *post_elements_num == 0 ) return NULL; - post_elements = (post_element_t **) - xine_xmalloc(sizeof(post_element_t *) * (*post_elements_num)); + post_elements = calloc( (*post_elements_num), sizeof(post_element_t *)); if(fe->post_pip_enable) for( i = 0; i < fe->post_pip_elements_num; i++ ) { @@ -572,8 +570,7 @@ static post_element_t **_pplugin_join_visualization_and_post_elements(fe_t *fe, if( *post_elements_num == 0 ) return NULL; - post_elements = (post_element_t **) - xine_xmalloc(sizeof(post_element_t *) * (*post_elements_num)); + post_elements = calloc( (*post_elements_num), sizeof(post_element_t *)); if(fe->post_audio_enable) for( j = 0; j < fe->post_audio_elements_num; j++ ) { diff --git a/xine/post_util.h b/xine/post_util.h index 06154ed7..a5d57b8d 100644 --- a/xine/post_util.h +++ b/xine/post_util.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: post_util.h,v 1.3 2008-02-28 06:10:54 phintuka Exp $ + * $Id: post_util.h,v 1.3.2.1 2008-09-26 13:33:31 phintuka Exp $ * */ @@ -53,7 +53,7 @@ static void draw_internal(vo_frame_t *frame, vo_frame_t *new_frame); static void *init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = calloc(1, sizeof(post_class_t)); if (!class) return NULL; diff --git a/xine_frontend.c b/xine_frontend.c index 11034235..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 2008-04-13 23:11:51 phintuka Exp $ + * $Id: xine_frontend.c,v 1.53.2.1 2008-09-26 13:12:17 phintuka Exp $ * */ @@ -744,7 +744,7 @@ static int fe_xine_open(frontend_t *this_gen, const char *mrl) x_upd_num("engine.buffers.video_num_buffers", this->pes_buffers); #if !defined(IS_FBFE) && defined(FE_STANDALONE) - if(!strncmp(mrl, "xvdr:", 5) && strstr(mrl, "//")) { + if(!strncmp(mrl, "xvdr", 4) && strstr(mrl, "//")) { char *name = NULL, *end; asprintf(&name, "VDR - %s", strstr(mrl, "//")+2); if(NULL != (end = strstr(name, ":37890"))) *end = 0; /* hide only default port */ diff --git a/xine_frontend_main.c b/xine_frontend_main.c index 7c8a3171..3bf2a747 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 2008-04-28 20:03:52 phintuka Exp $ + * $Id: xine_frontend_main.c,v 1.40.2.4 2008-09-26 19:36:01 phintuka Exp $ * */ @@ -17,29 +17,6 @@ #include "tools/vdrdiscovery.h" -#if 0 -static void xine_log_cb(void *data, int section) -{ - fprintf(stderr, "xine: log section %d\n",section); -} - -static void print_xine_log(xine_t *xine) -{ - int i, j; - int logs = xine_get_log_section_count(xine); - const char * const * names = xine_get_log_names(xine); - for(i=0; i<logs; i++) { - const char * const * lines = xine_get_log(xine, i); - if(lines[0]) { - printf("\nLOG: %s\n",names[i]); - j=-1; - while(lines[++j] && *lines[++j] ) - printf(" %2d: %s", j, lines[j]); - } - } -} -#endif - static void list_plugins_type(xine_t *xine, const char *msg, typeof (xine_list_audio_output_plugins) list_func) { static xine_t *tmp_xine = NULL; @@ -291,7 +268,7 @@ static void SignalHandler(int signum) static char *strcatrealloc(char *dest, const char *src) { - int l; + size_t l; if (!src || !*src) return dest; @@ -322,7 +299,9 @@ static const char help_str[] = " Use script to control HW aspect ratio:\n" " --aspect=auto:path_to_script\n" " --fullscreen Fullscreen mode\n" +#ifdef HAVE_XRENDER " --hud Head Up Display OSD mode\n" +#endif " --width=x Video window width\n" " --height=x Video window height\n" " --noscaling Disable all video scaling\n" @@ -338,8 +317,8 @@ static const char help_str[] = " --nokbd Disable keyboard input\n" " --daemon Run as daemon (disable keyboard,\n" " log to syslog and fork to background)\n" - " --slave Enable slave mode (read commands from stdin)\r\n" - " --reconnect Automatically reconnect when connection has been lost" + " --slave Enable slave mode (read commands from stdin)\n" + " --reconnect Automatically reconnect when connection has been lost\n" " --tcp Use TCP transport\n" " --udp Use UDP transport\n" " --rtp Use RTP transport\n\n" @@ -464,7 +443,11 @@ int main(int argc, char *argv[]) PRINTF("Fullscreen mode\n"); break; case 'D': hud=1; +#ifdef HAVE_XRENDER PRINTF("HUD OSD mode\n"); +#else + PRINTF("HUD OSD not supported\n"); +#endif break; case 'w': width = atoi(optarg); PRINTF("Width: %d\n", width); @@ -669,7 +652,7 @@ int main(int argc, char *argv[]) } /* Connect to VDR xineliboutput server */ - if(!fe_xine_open(fe, mrl)) { + if(!fe->xine_open(fe, mrl)) { /*print_xine_log(((fe_t *)fe)->xine);*/ if(!firsttry) { PRINTF("Error opening %s\n", mrl); diff --git a/xine_input_vdr.c b/xine_input_vdr.c index 43015253..bdb0cbc6 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 2008-05-06 23:14:19 phintuka Exp $ + * $Id: xine_input_vdr.c,v 1.138.2.11 2008-10-04 06:51:35 phintuka Exp $ * */ @@ -48,6 +48,13 @@ #include <xine/buffer.h> #include <xine/post.h> +#if XINE_VERSION_CODE >= 10190 +# include <libavutil/mem.h> +#endif +#ifndef XINE_VERSION_CODE +# error XINE_VERSION_CODE undefined ! +#endif + #include "xine_input_vdr.h" #include "xine_input_vdr_net.h" #include "xine_osd_command.h" @@ -247,6 +254,7 @@ typedef struct vdr_input_plugin_s { int send_pts; int padding_cnt; int loop_play; + int dvd_menu; int hd_stream; /* true if current stream is HD */ int h264; /* -1: unknown, 0: no, 1: yes */ @@ -356,7 +364,7 @@ struct udp_data_s { static udp_data_t *init_udp_data(void) { - udp_data_t *data = (udp_data_t *)xine_xmalloc(sizeof(udp_data_t)); + udp_data_t *data = calloc(1, sizeof(udp_data_t)); data->received_frames = -1; @@ -1248,6 +1256,8 @@ static void queue_nosignal(vdr_input_plugin_t *this) buf->type = BUF_VIDEO_MPEG; xine_fast_memcpy(buf->content, &data[pos], buf->size); pos += buf->size; + if(pos >= datalen) + buf->decoder_flags |= BUF_FLAG_FRAME_END; this->stream->video_fifo->put(this->stream->video_fifo, buf); } else { LOGMSG("Error: queue_nosignal: no buffers !"); @@ -1255,6 +1265,20 @@ static void queue_nosignal(vdr_input_plugin_t *this) } } + /* sequence end */ + buf = this->stream->video_fifo->buffer_pool_try_alloc(this->stream->video_fifo); + if (buf) { + static const uint8_t seq_end[] = {0x00, 0x00, 0x01, 0xb7}; /* mpeg2 */ + buf->type = BUF_VIDEO_MPEG; + buf->size = sizeof(seq_end); + buf->decoder_flags = BUF_FLAG_FRAME_END; + memcpy(buf->content, seq_end, sizeof(seq_end)); + this->stream->video_fifo->put(this->stream->video_fifo, buf); + + /*put_control_buf(this->stream->video_fifo, this->stream->video_fifo, BUF_CONTROL_FLUSH_DECODER);*/ + /*put_control_buf(this->stream->video_fifo, this->stream->video_fifo, BUF_CONTROL_NOP);*/ + } + free(tmp); } @@ -1400,11 +1424,10 @@ static fifo_buffer_t *fifo_buffer_new (xine_stream_t *stream, int num_buffers, u fifo_buffer_t *ref = stream->video_fifo; fifo_buffer_t *this; int i; - int alignment = 2048; - unsigned char *multi_buffer = NULL; + unsigned char *multi_buffer; LOGDBG("fifo_buffer_new..."); - this = xine_xmalloc (sizeof (fifo_buffer_t)); + this = calloc(1, sizeof (fifo_buffer_t)); this->first = NULL; this->last = NULL; @@ -1430,13 +1453,7 @@ static fifo_buffer_t *fifo_buffer_new (xine_stream_t *stream, int num_buffers, u * init buffer pool, allocate nNumBuffers of buf_size bytes each */ - if (buf_size % alignment != 0) - buf_size += alignment - (buf_size % alignment); - - multi_buffer = xine_xmalloc_aligned (alignment, num_buffers * buf_size, - &this->buffer_pool_base); - - this->buffer_pool_top = NULL; + multi_buffer = this->buffer_pool_base = av_mallocz (num_buffers * buf_size); pthread_mutex_init (&this->buffer_pool_mutex, NULL); pthread_cond_init (&this->buffer_pool_cond_not_empty, NULL); @@ -1450,7 +1467,7 @@ static fifo_buffer_t *fifo_buffer_new (xine_stream_t *stream, int num_buffers, u for (i = 0; i<num_buffers; i++) { buf_element_t *buf; - buf = xine_xmalloc (sizeof (buf_element_t)); + buf = calloc(1, sizeof (buf_element_t)); buf->mem = multi_buffer; multi_buffer += buf_size; @@ -1479,22 +1496,8 @@ static buf_element_t *get_buf_element(vdr_input_plugin_t *this, int size, int fo buf_element_t *buf = NULL; /* HD buffer */ - if(this->hd_stream) { - if(!this->hd_buffer) - this->hd_buffer = fifo_buffer_new(this->stream, HD_BUF_NUM_BUFS, HD_BUF_ELEM_SIZE); - - if(size <= HD_BUF_ELEM_SIZE && this->hd_buffer && this->hd_stream) - buf = this->hd_buffer->buffer_pool_try_alloc(this->hd_buffer); - } else { - if(this->hd_buffer) { - LOGMSG("hd_buffer still exists ..."); - if(this->hd_buffer->num_free(this->hd_buffer) == this->hd_buffer->buffer_pool_capacity) { - LOGMSG("disposing hd_buffer ..."); - this->hd_buffer->dispose(this->hd_buffer); - this->hd_buffer = NULL; - } - } - } + if(this->hd_stream && size <= HD_BUF_ELEM_SIZE) + buf = this->hd_buffer->buffer_pool_try_alloc(this->hd_buffer); /* limit max. buffered data */ if(!force && !buf) { @@ -1724,7 +1727,7 @@ static input_plugin_t *fifo_class_get_instance (input_class_t *class_gen, xine_stream_t *stream, const char *data) { - fifo_input_plugin_t *slave = (fifo_input_plugin_t *) xine_xmalloc (sizeof(fifo_input_plugin_t)); + fifo_input_plugin_t *slave = calloc(1, sizeof(fifo_input_plugin_t)); unsigned long int imaster; vdr_input_plugin_t *master; LOGDBG("fifo_class_get_instance"); @@ -1978,6 +1981,7 @@ static int exec_osd_command(vdr_input_plugin_t *this, osd_command_t *cmd) video_overlay_event_t ov_event; vo_overlay_t ov_overlay; video_overlay_manager_t *ovl_manager; + xine_stream_t *stream = this->slave_stream ?: this->stream; int handle = -1, i; /* Caller must have locked this->osd_lock ! */ @@ -1986,7 +1990,7 @@ static int exec_osd_command(vdr_input_plugin_t *this, osd_command_t *cmd) /* Check parameters */ - if(!cmd || !this || !this->stream) { + if(!cmd || !this || !stream) { LOGMSG("exec_osd_command: Stream not initialized !"); return CONTROL_DISCONNECTED; } @@ -2005,7 +2009,7 @@ static int exec_osd_command(vdr_input_plugin_t *this, osd_command_t *cmd) /* we already have port ticket */ ovl_manager = - this->stream->video_out->get_overlay_manager(this->stream->video_out); + stream->video_out->get_overlay_manager(stream->video_out); if(!ovl_manager) { LOGMSG("exec_osd_command: Stream has no overlay manager !"); @@ -2016,11 +2020,10 @@ static int exec_osd_command(vdr_input_plugin_t *this, osd_command_t *cmd) /* calculate exec time */ if(cmd->pts || cmd->delay_ms) { - int64_t vpts = xine_get_current_vpts(this->stream); + int64_t vpts = xine_get_current_vpts(stream); if(cmd->pts) { ov_event.vpts = cmd->pts + - this->stream->metronom->get_option(this->stream->metronom, - METRONOM_VPTS_OFFSET); + stream->metronom->get_option(stream->metronom, METRONOM_VPTS_OFFSET); } else { if(this->last_changed_vpts[cmd->wnd]) ov_event.vpts = this->last_changed_vpts[cmd->wnd] + cmd->delay_ms*90; @@ -2040,7 +2043,7 @@ static int exec_osd_command(vdr_input_plugin_t *this, osd_command_t *cmd) this->vdr_osd_height = cmd->h; } else if(cmd->cmd == OSD_Nop) { - this->last_changed_vpts[cmd->wnd] = xine_get_current_vpts(this->stream); + this->last_changed_vpts[cmd->wnd] = xine_get_current_vpts(stream); } else if(cmd->cmd == OSD_SetPalette) { /* TODO */ @@ -2082,6 +2085,8 @@ static int exec_osd_command(vdr_input_plugin_t *this, osd_command_t *cmd) int xmove = 0, ymove = 0; int unscaled_supported = 1; + stream->video_out->enable_ovl(stream->video_out, 1); + if(handle < 0) handle = this->osdhandle[cmd->wnd] = ovl_manager->get_handle(ovl_manager,0); @@ -2111,7 +2116,7 @@ static int exec_osd_command(vdr_input_plugin_t *this, osd_command_t *cmd) ov_event.object.overlay->trans[i] = (cmd->palette[i].alpha + 0x7)/0xf; } - if(!(this->stream->video_out->get_capabilities(this->stream->video_out) & + if(!(stream->video_out->get_capabilities(stream->video_out) & VO_CAP_UNSCALED_OVERLAY)) unscaled_supported = 0; else if(cmd->flags & OSDFLAG_UNSCALED) @@ -2184,10 +2189,10 @@ static int exec_osd_command(vdr_input_plugin_t *this, osd_command_t *cmd) } if(use_unscaled) { - int win_width = this->stream->video_out->get_property(this->stream->video_out, - VO_PROP_WINDOW_WIDTH); - int win_height = this->stream->video_out->get_property(this->stream->video_out, - VO_PROP_WINDOW_HEIGHT); + int win_width = stream->video_out->get_property(stream->video_out, + VO_PROP_WINDOW_WIDTH); + int win_height = stream->video_out->get_property(stream->video_out, + VO_PROP_WINDOW_HEIGHT); if(cmd->scaling > 0) { /* it is not nice to have subs in _middle_ of display when using 1440x900 etc... */ @@ -2250,7 +2255,7 @@ static int exec_osd_command(vdr_input_plugin_t *this, osd_command_t *cmd) break; } while(1); - this->last_changed_vpts[cmd->wnd] = xine_get_current_vpts(this->stream); + this->last_changed_vpts[cmd->wnd] = xine_get_current_vpts(stream); } else { LOGMSG("Unknown OSD command %d", cmd->cmd); @@ -2846,6 +2851,19 @@ static void select_spu_channel(xine_stream_t *stream, int channel) } } +static void dvd_menu_domain(vdr_input_plugin_t *this, int value) +{ + if (value) { + LOGDBG("dvd_menu_domain(1)"); + this->dvd_menu = 1; + this->slave_stream->spu_channel_user = SPU_CHANNEL_AUTO; + this->slave_stream->spu_channel = this->slave_stream->spu_channel_auto; + } else { + LOGDBG("dvd_menu_domain(0)"); + this->dvd_menu = 0; + } +} + static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd) { const char *pt = cmd + 9; @@ -2954,6 +2972,7 @@ static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd) vdr_event_cb, this); } select_spu_channel(this->slave_stream, SPU_CHANNEL_AUTO); + this->dvd_menu = 0; errno = 0; err = !xine_open(this->slave_stream, filename); @@ -3520,7 +3539,7 @@ static int vdr_plugin_parse_control(input_plugin_t *this_gen, const char *cmd) if(!strcmp(cmd+6, eventmap[i].name)) { xine_event_t ev; ev.type = eventmap[i].type; - ev.stream = this->slave_stream ? this->slave_stream : this->stream; + ev.stream = this->slave_stream ?: this->stream; /* tag event to prevent circular input events (vdr -> here -> event_listener -> vdr -> ...) */ ev.data = "VDR"; @@ -3545,7 +3564,13 @@ static int vdr_plugin_parse_control(input_plugin_t *this_gen, const char *cmd) } else if(!strncasecmp(cmd, "HDMODE ", 7)) { if(1 == sscanf(cmd, "HDMODE %d", &tmp32)) { pthread_mutex_lock(&this->lock); - this->hd_stream = tmp32 ? 1 : 0; + if(tmp32) { + if(!this->hd_buffer) + this->hd_buffer = fifo_buffer_new(this->stream, HD_BUF_NUM_BUFS, HD_BUF_ELEM_SIZE); + this->hd_stream = 1; + } else { + this->hd_stream = 0; + } pthread_mutex_unlock(&this->lock); } @@ -3709,16 +3734,34 @@ static int vdr_plugin_parse_control(input_plugin_t *this_gen, const char *cmd) int old_ch = _x_get_spu_channel (stream); int max_ch = xine_get_stream_info(stream, XINE_STREAM_INFO_MAX_SPU_CHANNEL); int ch = old_ch; + int ch_auto = strstr(cmd+10, "auto") ? 1 : 0; + if(strstr(cmd, "NEXT")) ch = ch < max_ch ? ch+1 : -2; else if(strstr(cmd, "PREV")) ch = ch > -2 ? ch-1 : max_ch-1; else if(1 == sscanf(cmd, "SPUSTREAM %d", &tmp32)) { ch = tmp32; + } else if(cmd[10] && cmd[11] && (cmd[12] < 'a' || cmd[12] > 'z')) { + /* ISO 639-1 language code */ + const char spu_lang[3] = {cmd[10], cmd[11], 0}; + LOGMSG("Preferred SPU language: %s", spu_lang); + this->class->xine->config->update_string(this->class->xine->config, + "media.dvd.language", spu_lang); + ch = old_ch = 0; } else err = CONTROL_PARAM_ERROR; - if(ch != old_ch) { - select_spu_channel(stream, ch); + + if (old_ch == SPU_CHANNEL_AUTO) + old_ch = stream->spu_channel_auto; + + if (ch != old_ch) { + if (ch_auto && stream->spu_channel_user == SPU_CHANNEL_AUTO) { + LOGDBG("Automatic SPU channel %d->%d ignored", old_ch, ch); + } else { + LOGDBG("Forced SPU channel %d->%d", old_ch, ch); + select_spu_channel(stream, ch); + } LOGDBG("SPU channel selected: [%d]", _x_get_spu_channel (stream)); } @@ -3941,8 +3984,24 @@ static void *vdr_control_thread(void *this_gen) static void slave_track_maps_changed(vdr_input_plugin_t *this) { char tracks[1024], lang[128]; - int i, current, n = 0, cnt; - + int i, current, n = 0; + size_t cnt; + + /* DVD title and menu domain detection */ +#ifdef XINE_STREAM_INFO_DVD_TITLE_NUMBER + i = _x_stream_info_get(this->slave_stream, XINE_STREAM_INFO_DVD_TITLE_NUMBER); + if(i >= 0) { + if (i == 0) + dvd_menu_domain(this, 1); + sprintf(tracks, "INFO DVDTITLE %d\r\n", i); + if(this->funcs.xine_input_event) + this->funcs.xine_input_event(tracks, NULL); + else + write_control(this, tracks); + LOGDBG(tracks); + } +#endif + /* Audio tracks */ strcpy(tracks, "INFO TRACKMAP AUDIO "); @@ -3980,6 +4039,8 @@ static void slave_track_maps_changed(vdr_input_plugin_t *this) "*%d:%s ", current, current==SPU_CHANNEL_NONE ? "none" : "auto"); n++; + if(current == SPU_CHANNEL_AUTO) + current = this->slave_stream->spu_channel_auto; } for(i=0; i<32 && cnt<sizeof(tracks)-32; i++) if(xine_get_spu_lang(this->slave_stream, i, lang)) { @@ -3998,18 +4059,6 @@ static void slave_track_maps_changed(vdr_input_plugin_t *this) strcpy(tracks+cnt, "\r\n"); write_control(this, tracks); } - -#ifdef XINE_STREAM_INFO_DVD_TITLE_NUMBER - i = _x_stream_info_get(this->slave_stream,XINE_STREAM_INFO_DVD_TITLE_NUMBER); - if(i >= 0) { - sprintf(tracks, "INFO DVDTITLE %d\r\n", i); - if(this->funcs.xine_input_event) - this->funcs.xine_input_event(tracks, NULL); - else - write_control(this, tracks); - LOGDBG(tracks); - } -#endif } /* Map some xine input events to vdr input (remote key names) */ @@ -4123,6 +4172,8 @@ static void vdr_event_cb (void *user_data, const xine_event_t *event) #ifdef XINE_STREAM_INFO_DVD_TITLE_NUMBER int tt = _x_stream_info_get(this->slave_stream,XINE_STREAM_INFO_DVD_TITLE_NUMBER); snprintf(titlen, sizeof(titlen), "INFO DVDTITLE %d\r\n", tt); + if (tt == 0) + dvd_menu_domain(this, 1); #endif snprintf(msg, sizeof(msg), "INFO TITLE %s\r\n%s", data->str, titlen); msg[sizeof(msg)-1] = 0; @@ -4133,6 +4184,20 @@ static void vdr_event_cb (void *user_data, const xine_event_t *event) break; } + case XINE_EVENT_UI_NUM_BUTTONS: + if (event->stream == this->slave_stream) { + xine_ui_data_t *data = (xine_ui_data_t*)event->data; + char msg[64]; + dvd_menu_domain(this, data->num_buttons > 0); + snprintf(msg, sizeof(msg), "INFO DVDBUTTONS %d\r\n", data->num_buttons); + msg[sizeof(msg)-1] = 0; + if (this->funcs.xine_input_event) + this->funcs.xine_input_event(msg, NULL); + else + write_control(this, msg); + break; + } + case XINE_EVENT_UI_CHANNELS_CHANGED: if(event->stream==this->slave_stream) slave_track_maps_changed(this); @@ -4953,7 +5018,6 @@ static void post_frame_end(vdr_input_plugin_t *this, int type) /* Should not be here ... Failing to send BUF_FLAG_FRAME_END 's freezes the decoder */ LOGERR("get_buf_element() for H.264 BUF_FLAG_FRAME_END failed - aborting"); - abort(); } } @@ -6327,7 +6391,7 @@ static input_plugin_t *vdr_class_get_instance (input_class_t *class_gen, return fifo_class_get_instance(class_gen, stream, data); } - this = (vdr_input_plugin_t *) xine_xmalloc (sizeof(vdr_input_plugin_t)); + this = calloc(1, sizeof(vdr_input_plugin_t)); this->stream = stream; this->mrl = strdup(mrl); @@ -6480,7 +6544,7 @@ static void *init_class (xine_t *xine, void *data) } } - this = (vdr_input_class_t *) xine_xmalloc (sizeof (vdr_input_class_t)); + this = calloc(1, sizeof (vdr_input_class_t)); this->xine = xine; diff --git a/xine_post_audiochannel.c b/xine_post_audiochannel.c index 3d1ad609..3b932c14 100644 --- a/xine_post_audiochannel.c +++ b/xine_post_audiochannel.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_post_audiochannel.c,v 1.5 2008-01-02 01:55:19 phintuka Exp $ + * $Id: xine_post_audiochannel.c,v 1.5.2.1 2008-09-26 13:33:27 phintuka Exp $ * */ @@ -222,7 +222,7 @@ static post_plugin_t *audioch_open_plugin(post_class_t *class_gen, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - audioch_post_plugin_t *this = (audioch_post_plugin_t*)xine_xmalloc(sizeof(audioch_post_plugin_t)); + audioch_post_plugin_t *this = calloc(1, sizeof(audioch_post_plugin_t)); post_in_t *input; post_out_t *output; post_audio_port_t *port; @@ -292,7 +292,7 @@ static void audioch_class_dispose(post_class_t *class_gen) static void *audioch_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t*)malloc(sizeof(post_class_t)); + post_class_t *class = calloc(1, sizeof(post_class_t)); if(!class) return NULL; diff --git a/xine_post_autocrop.c b/xine_post_autocrop.c index 26edcaf6..57e120c2 100644 --- a/xine_post_autocrop.c +++ b/xine_post_autocrop.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_post_autocrop.c,v 1.12 2008-01-02 01:55:19 phintuka Exp $ + * $Id: xine_post_autocrop.c,v 1.12.2.1 2008-09-26 13:33:28 phintuka Exp $ * */ @@ -27,7 +27,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_post_autocrop.c,v 1.12 2008-01-02 01:55:19 phintuka Exp $ * * autocrop video filter by Petri Hintukainen 25/03/2006 * @@ -1512,7 +1511,7 @@ static post_plugin_t *autocrop_open_plugin(post_class_t *class_gen, xine_video_port_t **video_target) { if (video_target && video_target[ 0 ]) { - autocrop_post_plugin_t *this = (autocrop_post_plugin_t*)xine_xmalloc(sizeof(autocrop_post_plugin_t)); + autocrop_post_plugin_t *this = calloc(1, sizeof(autocrop_post_plugin_t)); post_in_t *input; post_out_t *output; post_video_port_t *port; @@ -1594,7 +1593,7 @@ static void autocrop_class_dispose(post_class_t *class_gen) static void *autocrop_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t*)malloc(sizeof(post_class_t)); + post_class_t *class = calloc(1, sizeof(post_class_t)); if(class) { class->open_plugin = autocrop_open_plugin; diff --git a/xine_post_swscale.c b/xine_post_swscale.c index 26ca43fc..f4967976 100644 --- a/xine_post_swscale.c +++ b/xine_post_swscale.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_post_swscale.c,v 1.7 2008-03-13 23:08:18 phintuka Exp $ + * $Id: xine_post_swscale.c,v 1.7.2.1 2008-09-26 13:33:29 phintuka Exp $ * * Simple (faster) resize for avisynth * Copyright (C) 2002 Tom Barry @@ -1392,8 +1392,8 @@ static void init_tables(warp_plugin_t *this) #define BP(x) ((uint8_t*)(x)) /* allocate memory for scaling tables and workspace */ free(this->pMem); - this->pMem = xine_xmalloc(this->input_width*3 + this->output_width*sizeof(uint32_t)*3*2 + - this->output_height*sizeof(uint32_t)*4 + 2*9*128); + this->pMem = malloc(this->input_width*3 + this->output_width*sizeof(uint32_t)*3*2 + + this->output_height*sizeof(uint32_t)*4 + 2*9*128); /* - aligned for P4 cache line */ this->vWorkY = (uint32_t*)ALIGN(128, this->pMem); @@ -1492,7 +1492,7 @@ static post_plugin_t *open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - warp_plugin_t *this = (warp_plugin_t *) xine_xmalloc(sizeof(warp_plugin_t)); + warp_plugin_t *this = calloc(1, sizeof(warp_plugin_t)); post_plugin_t *this_gen = (post_plugin_t *) this; post_in_t *input; post_out_t *output; diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index e576a903..0dc427aa 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 2008-04-10 15:01:31 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.41.2.2 2008-09-26 13:08:22 phintuka Exp $ * */ @@ -204,8 +204,6 @@ typedef struct sxfe_s { /* Common (non-X11/FB) frontend functions */ #include "xine_frontend.c" -#include "vdrlogo_32x32.c" - #define DOUBLECLICK_TIME 500 // ms #define OSD_DEF_WIDTH 720 @@ -792,6 +790,31 @@ static void hud_osd_close(frontend_t *this_gen) #endif /* HAVE_XRENDER */ +static void set_icon(sxfe_t *this) +{ +# include "vdrlogo_32x32.c" + +#if defined(__WORDSIZE) && (__WORDSIZE == 32) + /* Icon */ + XChangeProperty(this->display, this->window[0], + XInternAtom(this->display, "_NET_WM_ICON", False), + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *) &vdrlogo_32x32, + 2 + vdrlogo_32x32.width*vdrlogo_32x32.height); +#else + long q[2+32*32]; + uint32_t *p = (uint32_t*)&vdrlogo_32x32; + int i; + for (i = 0; i < 2 + vdrlogo_32x32.width*vdrlogo_32x32.height; i++) + q[i] = p[i]; + XChangeProperty(this->display, this->window[0], + XInternAtom(this->display, "_NET_WM_ICON", False), + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *) q, + 2 + vdrlogo_32x32.width*vdrlogo_32x32.height); +#endif +} + /* * sxfe_display_open * @@ -960,6 +983,17 @@ static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fu if(this->window_id <= 0) { + + /* Window hint */ + XClassHint *classHint = XAllocClassHint(); + if(classHint) { + classHint->res_name = "VDR"; + classHint->res_class = "VDR"; + XSetClassHint(this->display, this->window[0], classHint); + XSetClassHint(this->display, this->window[1], classHint); + XFree(classHint); + } + /* Window name */ #ifdef FE_STANDALONE XStoreName(this->display, this->window[0], "VDR - "); @@ -970,11 +1004,7 @@ static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fu #endif /* Icon */ - XChangeProperty(this->display, this->window[0], - XInternAtom(this->display, "_NET_WM_ICON", False), - XA_CARDINAL, 32, PropModeReplace, - (unsigned char *) &vdrlogo_32x32, - 2 + vdrlogo_32x32.width*vdrlogo_32x32.height); + set_icon(this); } /* Map current window */ diff --git a/xineliboutput.c b/xineliboutput.c index 1789160b..3a521b0c 100644 --- a/xineliboutput.c +++ b/xineliboutput.c @@ -1,7 +1,7 @@ /* * vdr-xineliboutput: xine-lib based output device plugin for VDR * - * Copyright (C) 2003-2006 Petri Hintukainen <phintuka@cc.hut.fi> + * 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 @@ -21,7 +21,7 @@ * * xineliboutput.c: VDR Plugin interface * - * $Id: xineliboutput.c,v 1.30 2008-05-07 12:31:55 phintuka Exp $ + * $Id: xineliboutput.c,v 1.30.2.2 2008-09-26 19:38:45 phintuka Exp $ * */ @@ -41,7 +41,7 @@ //---------------------------------plugin------------------------------------- -static const char *VERSION = "1.0.1"; +static const char *VERSION = "1.0.2"; static const char *DESCRIPTION = trNOOP("X11/xine-lib output plugin"); static const char *MAINMENUENTRY = trNOOP("Media Player"); @@ -119,7 +119,9 @@ const char cmdLineHelp[] = " (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" |