Merge pull request #41 from Dima73/master
authorlittlesat <littlesat99@yahoo.com>
Wed, 16 Sep 2015 16:44:52 +0000 (18:44 +0200)
committerlittlesat <littlesat99@yahoo.com>
Wed, 16 Sep 2015 16:44:52 +0000 (18:44 +0200)
[InfoBarPiP] add sanity check for self.servicelist

data/rc_models/rc_models.cfg
lib/gdi/picload.cpp
lib/gdi/picload.h
lib/python/Plugins/Extensions/DVDPlayer/plugin.py
lib/python/Screens/InputBox.py
lib/python/Screens/LocationBox.py
lib/python/Screens/MovieSelection.py
lib/python/Screens/SoftwareUpdate.py
po/fr.po
po/lv.po

index 5b60e7e..9b2461d 100644 (file)
@@ -50,3 +50,4 @@ et7500 et7x00
 et8500 et8000
 hd2400 hd2400
 hd1100 hd1100
+hd1200 hd1100
index 1e3834c..1d2c253 100644 (file)
@@ -27,55 +27,6 @@ static std::string getSize(const char* file)
        return tmp;
 }
 
-static unsigned char *simple_resize_24(unsigned char *orgin, int ox, int oy, int dx, int dy)
-{
-       unsigned char *cr = new unsigned char[dx * dy * 3];
-       if (cr == NULL)
-       {
-               eDebug("[ePicLoad] resize24 Error malloc");
-               return orgin;
-       }
-       const int stride = 3 * dx;
-       #pragma omp parallel for
-       for (int j = 0; j < dy; ++j)
-       {
-               unsigned char* k = cr + (j * stride);
-               const unsigned char* p = orgin + (j * oy / dy * ox) * 3;
-               for (int i = 0; i < dx; i++)
-               {
-                       const unsigned char* ip = p + (i * ox / dx) * 3;
-                       *k++ = ip[0];
-                       *k++ = ip[1];
-                       *k++ = ip[2];
-               }
-       }
-       delete [] orgin;
-       return cr;
-}
-
-static unsigned char *simple_resize_8(unsigned char *orgin, int ox, int oy, int dx, int dy)
-{
-       unsigned char* cr = new unsigned char[dx * dy];
-       if (cr == NULL)
-       {
-               eDebug("[ePicLoad] resize8 Error malloc");
-               return(orgin);
-       }
-       const int stride = dx;
-       #pragma omp parallel for
-       for (int j = 0; j < dy; ++j)
-       {
-               unsigned char* k = cr + (j * stride);
-               const unsigned char* p = orgin + (j * oy / dy * ox);
-               for (int i = 0; i < dx; i++)
-               {
-                       *k++ = p[i * ox / dx];
-               }
-       }
-       delete [] orgin;
-       return cr;
-}
-
 static unsigned char *color_resize(unsigned char * orgin, int ox, int oy, int dx, int dy)
 {
        unsigned char* cr = new unsigned char[dx * dy * 3];
@@ -266,7 +217,7 @@ static unsigned char *bmp_load(const char *file,  int *x, int *y)
 
 //---------------------------------------------------------------------
 
-static void png_load(Cfilepara* filepara, int background)
+static void png_load(Cfilepara* filepara, int background, bool forceRGB = false)
 {
        png_uint_32 width, height;
        unsigned int i;
@@ -297,7 +248,7 @@ static void png_load(Cfilepara* filepara, int background)
        png_read_info(png_ptr, info_ptr);
        png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
 
-       if (color_type == PNG_COLOR_TYPE_GRAY || color_type & PNG_COLOR_MASK_PALETTE)
+       if (!forceRGB && (color_type == PNG_COLOR_TYPE_GRAY || color_type & PNG_COLOR_MASK_PALETTE))
        {
                if (bit_depth < 8)
                {
@@ -345,13 +296,13 @@ static void png_load(Cfilepara* filepara, int background)
        }
        else
        {
-               if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
-                       png_set_expand(png_ptr);
                if (bit_depth == 16)
                        png_set_strip_16(png_ptr);
                if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
                        png_set_gray_to_rgb(png_ptr);
-               if ((color_type == PNG_COLOR_TYPE_RGB_ALPHA) || (color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
+               if (color_type & PNG_COLOR_MASK_PALETTE)
+                       png_set_palette_to_rgb(png_ptr);
+               if (color_type & PNG_COLOR_MASK_ALPHA || png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
                {
                        png_set_strip_alpha(png_ptr);
                        png_color_16 bg;
@@ -362,7 +313,6 @@ static void png_load(Cfilepara* filepara, int background)
                        bg.index = 0;
                        png_set_background(png_ptr, &bg, PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
                }
-               int number_passes = png_set_interlace_handling(png_ptr);
                png_read_update_info(png_ptr, info_ptr);
 
                if (width * 3 != png_get_rowbytes(png_ptr, info_ptr))
@@ -377,6 +327,7 @@ static void png_load(Cfilepara* filepara, int background)
                filepara->oy = height;
                filepara->pic_buffer = pic_buffer;
 
+               int number_passes = png_set_interlace_handling(png_ptr);
                for(int pass = 0; pass < number_passes; pass++)
                {
                        fbptr = (png_byte *)pic_buffer;
@@ -516,11 +467,10 @@ inline void m_rend_gif_decodecolormap(unsigned char *cmb, unsigned char *rgbb, C
        }
 }
 
-static void gif_load(Cfilepara* filepara)
+static void gif_load(Cfilepara* filepara, bool forceRGB = false)
 {
        unsigned char *pic_buffer = NULL;
        int px, py, i, j;
-       unsigned char *fbptr;
        unsigned char *slb=NULL;
        GifFileType *gft;
        GifRecordType rt;
@@ -562,10 +512,9 @@ static void gif_load(Cfilepara* filepara)
                                                filepara->palette[i].b = cmap->Colors[i].Blue;
                                        }
 
-                                       fbptr = pic_buffer;
                                        if (!(gft->Image.Interlace))
                                        {
-                                               for (i = 0; i < py; i++, fbptr += px * 3)
+                                               for (i = 0; i < py; i++)
                                                {
                                                        if (DGifGetLine(gft, slb, px) == GIF_ERROR)
                                                                goto ERROR_R;
@@ -574,17 +523,37 @@ static void gif_load(Cfilepara* filepara)
                                        }
                                        else
                                        {
+                                               int IOffset[] = { 0, 4, 2, 1 }; // The way Interlaced image should.
+                                               int IJumps[] = { 8, 8, 4, 2 };  // be read - offsets and jumps...
                                                for (j = 0; j < 4; j++)
                                                {
-                                                       slb = pic_buffer;
-                                                       for (i = 0; i < py; i++)
+                                                       for (i = IOffset[j]; i < py; i += IJumps[j])
                                                        {
-                                                               if (DGifGetLine(gft, slb, px) == GIF_ERROR)
+                                                               if (DGifGetLine(gft, pic_buffer + i*px, px) == GIF_ERROR)
                                                                        goto ERROR_R;
-                                                               slb += px;
                                                        }
                                                }
                                        }
+                                       if (forceRGB) {
+                                               unsigned char *pic_buffer2 = new unsigned char[px * py * 3];
+                                               if (pic_buffer2 != NULL) {
+                                                       unsigned char *slb2 = pic_buffer2;
+                                                       slb = pic_buffer;
+                                                       for (j = 0; j < py; j++) {
+                                                               for (i = 0; i < px; i++) {
+                                                                       int c = *slb++;
+                                                                       *slb2++ = filepara->palette[c].r;
+                                                                       *slb2++ = filepara->palette[c].g;
+                                                                       *slb2++ = filepara->palette[c].b;
+                                                               }
+                                                       }
+                                                       filepara->bits = 24;
+                                                       filepara->pic_buffer = pic_buffer2;
+                                                       delete [] pic_buffer;
+                                                       delete filepara->palette;
+                                                       filepara->palette = NULL;
+                                               }
+                                       }
                                }
                                break;
                        case EXTENSION_RECORD_TYPE:
@@ -691,47 +660,36 @@ void ePicLoad::decodeThumb()
        std::string cachefile = "";
        std::string cachedir = "/.Thumbnails";
 
-       if(m_filepara->id == F_JPEG)
+       getExif(m_filepara->file, 1);
+       if (m_exif && m_exif->m_exifinfo->IsExif)
        {
-               Cexif *exif = new Cexif;
-               if(exif->DecodeExif(m_filepara->file, 1))
+               if (m_exif->m_exifinfo->Thumnailstate == 2)
                {
-                       if(exif->m_exifinfo->IsExif)
-                       {
-                               if(exif->m_exifinfo->Thumnailstate == 2)
-                               {
-                                       free(m_filepara->file);
-                                       m_filepara->file = strdup(THUMBNAILTMPFILE);
-                                       exif_thumbnail = true;
-                                       eDebug("[ePicLoad] Exif Thumbnail found");
-                               }
-                               m_filepara->addExifInfo(exif->m_exifinfo->CameraMake);
-                               m_filepara->addExifInfo(exif->m_exifinfo->CameraModel);
-                               m_filepara->addExifInfo(exif->m_exifinfo->DateTime);
-                               char buf[20];
-                               snprintf(buf, 20, "%d x %d", exif->m_exifinfo->Width, exif->m_exifinfo->Height);
-                               m_filepara->addExifInfo(buf);
-                       }
-                       exif->ClearExif();
+                       free(m_filepara->file);
+                       m_filepara->file = strdup(THUMBNAILTMPFILE);
+                       exif_thumbnail = true;
+                       eDebug("[ePicLoad] Exif Thumbnail found");
                }
-               delete exif;
+               m_filepara->addExifInfo(m_exif->m_exifinfo->CameraMake);
+               m_filepara->addExifInfo(m_exif->m_exifinfo->CameraModel);
+               m_filepara->addExifInfo(m_exif->m_exifinfo->DateTime);
+               char buf[20];
+               snprintf(buf, 20, "%d x %d", m_exif->m_exifinfo->Width, m_exif->m_exifinfo->Height);
+               m_filepara->addExifInfo(buf);
        }
 
-       if((! exif_thumbnail) && m_conf.usecache)
+       if (!exif_thumbnail && m_conf.usecache)
        {
-               if(FILE *f = fopen(m_filepara->file, "rb"))
+               if (FILE *f = fopen(m_filepara->file, "rb"))
                {
                        int c;
-                       int count = 1024*100;
+                       int count = 1024*100; // get checksum data out of max 100kB
                        unsigned long crc32 = 0;
                        char crcstr[9];
                        *crcstr = 0;
 
-                       while ((c = getc(f)) != EOF)
-                       {
+                       while (count-- > 0 && (c = getc(f)) != EOF)
                                crc32 = crc32_table[((crc32) ^ (c)) & 0xFF] ^ ((crc32) >> 8);
-                               if (--count < 0) break;
-                       }
 
                        fclose(f);
                        crc32 = ~crc32;
@@ -743,7 +701,7 @@ void ePicLoad::decodeThumb()
                                cachedir = cachedir.substr(0, pos) + "/.Thumbnails";
 
                        cachefile = cachedir + std::string("/pc_") + crcstr;
-                       if(!access(cachefile.c_str(), R_OK))
+                       if (!access(cachefile.c_str(), R_OK))
                        {
                                cachefile_found = true;
                                free(m_filepara->file);
@@ -754,30 +712,30 @@ void ePicLoad::decodeThumb()
                }
        }
 
-       switch(m_filepara->id)
+       switch (m_filepara->id)
        {
-               case F_PNG:     png_load(m_filepara, m_conf.background);
+               case F_PNG:     png_load(m_filepara, m_conf.background, true);
                                break;
                case F_JPEG:    m_filepara->pic_buffer = jpeg_load(m_filepara->file, &m_filepara->ox, &m_filepara->oy, m_filepara->max_x, m_filepara->max_y);
                                break;
                case F_BMP:     m_filepara->pic_buffer = bmp_load(m_filepara->file, &m_filepara->ox, &m_filepara->oy);
                                break;
-               case F_GIF:     gif_load(m_filepara);
+               case F_GIF:     gif_load(m_filepara, true);
                                break;
        }
 
-       if(exif_thumbnail)
+       if (exif_thumbnail)
                ::unlink(THUMBNAILTMPFILE);
 
-       if(m_filepara->pic_buffer != NULL)
+       if (m_filepara->pic_buffer != NULL)
        {
-               //save cachefile
-               if(m_conf.usecache && (!exif_thumbnail) && (!cachefile_found))
+               // Save cachefile
+               if (m_conf.usecache && !exif_thumbnail && !cachefile_found)
                {
-                       if(access(cachedir.c_str(), R_OK))
+                       if (access(cachedir.c_str(), R_OK))
                                ::mkdir(cachedir.c_str(), 0755);
 
-                       //resize for Thumbnail
+                       // Resize for Thumbnail
                        int imx, imy;
                        if (m_filepara->ox <= m_filepara->oy)
                        {
@@ -790,50 +748,14 @@ void ePicLoad::decodeThumb()
                                imy = (int)( (m_conf.thumbnailsize * ((double)m_filepara->oy)) / ((double)m_filepara->ox) );
                        }
 
-                       if (m_filepara->bits == 8)
-                               m_filepara->pic_buffer = simple_resize_8(m_filepara->pic_buffer, m_filepara->ox, m_filepara->oy, imx, imy);
-                       else
-                               m_filepara->pic_buffer = color_resize(m_filepara->pic_buffer, m_filepara->ox, m_filepara->oy, imx, imy);
+                       m_filepara->pic_buffer = color_resize(m_filepara->pic_buffer, m_filepara->ox, m_filepara->oy, imx, imy);
                        m_filepara->ox = imx;
                        m_filepara->oy = imy;
 
-                       if(jpeg_save(cachefile.c_str(), m_filepara->ox, m_filepara->oy, m_filepara->pic_buffer))
+                       if (jpeg_save(cachefile.c_str(), m_filepara->ox, m_filepara->oy, m_filepara->pic_buffer))
                                eDebug("[ePicLoad] error saving cachefile");
                }
-
-               resizePic();
-       }
-}
-
-void ePicLoad::resizePic()
-{
-       int imx, imy;
-
-       if (m_conf.aspect_ratio == 0)  // do not keep aspect ratio but just fill the destination area
-       {
-               imx = m_filepara->max_x;
-               imy = m_filepara->max_y;
-       }
-       else if ((m_conf.aspect_ratio * m_filepara->oy * m_filepara->max_x / m_filepara->ox) <= m_filepara->max_y)
-       {
-               imx = m_filepara->max_x;
-               imy = (int)(m_conf.aspect_ratio * m_filepara->oy * m_filepara->max_x / m_filepara->ox);
        }
-       else
-       {
-               imx = (int)((1.0/m_conf.aspect_ratio) * m_filepara->ox * m_filepara->max_y / m_filepara->oy);
-               imy = m_filepara->max_y;
-       }
-
-       if (m_filepara->bits == 8)
-               m_filepara->pic_buffer = simple_resize_8(m_filepara->pic_buffer, m_filepara->ox, m_filepara->oy, imx, imy);
-       else if (m_conf.resizetype)
-               m_filepara->pic_buffer = color_resize(m_filepara->pic_buffer, m_filepara->ox, m_filepara->oy, imx, imy);
-       else
-               m_filepara->pic_buffer = simple_resize_24(m_filepara->pic_buffer, m_filepara->ox, m_filepara->oy, imx, imy);
-
-       m_filepara->ox = imx;
-       m_filepara->oy = imy;
 }
 
 void ePicLoad::gotMessage(const Message &msg)
@@ -895,19 +817,7 @@ int ePicLoad::startThread(int what, const char *file, int x, int y, bool async)
                m_exif = NULL;
        }
 
-       int file_id = -1;
-       unsigned char id[10];
-       int fd = ::open(file, O_RDONLY);
-       if (fd == -1) return 1;
-       ::read(fd, id, 10);
-       ::close(fd);
-
-       if      (id[1] == 'P'  && id[2] == 'N'  && id[3] == 'G')                        file_id = F_PNG;
-       else if (id[6] == 'J'  && id[7] == 'F'  && id[8] == 'I' && id[9] == 'F')        file_id = F_JPEG;
-       else if (id[0] == 0xff && id[1] == 0xd8 && id[2] == 0xff)                       file_id = F_JPEG;
-       else if (id[0] == 'B'  && id[1] == 'M' )                                        file_id = F_BMP;
-       else if (id[0] == 'G'  && id[1] == 'I'  && id[2] == 'F')                        file_id = F_GIF;
-
+       int file_id = getFileType(file);
        if(file_id < 0)
        {
                eDebug("[ePicLoad] <format not supported>");
@@ -1002,11 +912,11 @@ PyObject *ePicLoad::getInfo(const char *filename)
        return list ? (PyObject*)list : (PyObject*)PyList_New(0);
 }
 
-bool ePicLoad::getExif(const char *filename)
+bool ePicLoad::getExif(const char *filename, int Thumb)
 {
        if (!m_exif) {
                m_exif = new Cexif;
-               return m_exif->DecodeExif(filename);
+               return m_exif->DecodeExif(filename, Thumb);
        }
        return true;
 }
@@ -1040,7 +950,7 @@ int ePicLoad::getData(ePtr<gPixmap> &result)
        // after aspect calc : scrx, scry
        // center image      : xoff, yoff
        int scrx, scry; // Aspect ratio calculation
-       int orientation = m_conf.auto_orientation ? (m_exif->m_exifinfo->Orient ? m_exif->m_exifinfo->Orient : 1) : 1;
+       int orientation = m_conf.auto_orientation ? (m_exif && m_exif->m_exifinfo->Orient ? m_exif->m_exifinfo->Orient : 1) : 1;
        if (m_conf.aspect_ratio == 0)  // do not keep aspect ratio but just fill the destination area
        {
                scrx = m_filepara->max_x;
@@ -1078,63 +988,53 @@ int ePicLoad::getData(ePtr<gPixmap> &result)
 
        unsigned char *tmp_buffer = ((unsigned char *)(surface->data));
        unsigned char *origin = m_filepara->pic_buffer;
+       if (m_filepara->bits == 8) {
+               surface->clut.data = m_filepara->palette;
+               surface->clut.colors = m_filepara->palette_size;
+               m_filepara->palette = NULL; // transfer ownership
+       }
+
        // fill borders with background color
        if (xoff != 0 || yoff != 0) {
                unsigned int background;
                if (m_filepara->bits == 8) {
-                       surface->clut.data = m_filepara->palette;
-                       surface->clut.colors = m_filepara->palette_size;
-                       m_filepara->palette = NULL; // transfer ownership
-
                        gRGB bg(m_conf.background);
                        background = surface->clut.findColor(bg);
-
-                       if (yoff != 0) {
-                               memset(tmp_buffer, background, yoff * surface->stride);
-                               memset(tmp_buffer + (yoff + scry) * surface->stride, background,
-                                       (m_filepara->max_y - scry - yoff) * surface->stride);
-                       }
-
-                       if (xoff != 0) {
-                               #pragma omp parallel for
-                               for(int y = yoff; y < scry; ++y) {
-                                       memset(tmp_buffer + y * surface->stride, background, xoff);
-                                       memset(tmp_buffer + y * surface->stride + xoff + scrx, background,
-                                               (m_filepara->max_x - scrx - xoff));
-                               }
-                        }
-                }
+               }
                else {
                        background = m_conf.background;
-                       unsigned int* row_buffer;
-                       if (yoff != 0) {
-                               row_buffer = (unsigned int *) tmp_buffer;
-                               for (int x = 0; x < m_filepara->max_x; ++x) // fill first line
-                                       *row_buffer++ = background;
-                               int y;
-                               #pragma omp parallel for
-                               for (y = 1; y < yoff; ++y) // copy from first line
-                                       memcpy(tmp_buffer + y*surface->stride, tmp_buffer, m_filepara->max_x * surface->bypp);
-                               #pragma omp parallel for
-                               for (y = m_filepara->max_y - yoff -scry; y < m_filepara->max_y; ++y)
-                                       memcpy(tmp_buffer + y*surface->stride, tmp_buffer, m_filepara->max_x * surface->bypp);
-                       }
-                       if (xoff != 0) {
-                               row_buffer = (unsigned int *) (tmp_buffer + yoff * surface->stride);
-                               int x;
-                               for (x = 0; x < xoff; ++x) // fill left side of first line
-                                       *row_buffer++ = background;
-                               row_buffer += scrx;
-                               for (x = m_filepara->max_x - xoff - scrx; x < m_filepara->max_x; ++x) // fill right side of first line
-                                       *row_buffer++ = background;
-                               row_buffer = (unsigned int *) (tmp_buffer + yoff * surface->stride);
-                               #pragma omp parallel for
-                               for (int y = yoff; y < scry; ++y) { // copy from first line
-                                       memcpy(tmp_buffer + y*surface->stride, row_buffer, xoff * surface->bypp);
-                                       memcpy(tmp_buffer + y*surface->stride + (xoff + scrx) * surface->bypp,
-                                               row_buffer + (xoff + scrx) * surface->bypp,
-                                               (m_filepara->max_x - scrx - xoff) * surface->bypp);
-                               }
+               }
+               unsigned int* row_buffer;
+               if (yoff != 0) {
+                       row_buffer = (unsigned int *) tmp_buffer;
+                       for (int x = 0; x < m_filepara->max_x; ++x) // fill first line
+                               *row_buffer++ = background;
+                       int y;
+                       #pragma omp parallel for
+                       for (y = 1; y < yoff; ++y) // copy from first line
+                               memcpy(tmp_buffer + y*surface->stride, tmp_buffer,
+                                       m_filepara->max_x * surface->bypp);
+                       #pragma omp parallel for
+                       for (y = yoff + scry; y < m_filepara->max_y; ++y)
+                               memcpy(tmp_buffer + y * surface->stride, tmp_buffer,
+                                       m_filepara->max_x * surface->bypp);
+               }
+               if (xoff != 0) {
+                       row_buffer = (unsigned int *) (tmp_buffer + yoff * surface->stride);
+                       int x;
+                       for (x = 0; x < xoff; ++x) // fill left side of first line
+                               *row_buffer++ = background;
+                       row_buffer += scrx;
+                       for (x = xoff + scrx; x < m_filepara->max_x; ++x) // fill right side of first line
+                               *row_buffer++ = background;
+                       #pragma omp parallel for
+                       for (int y = yoff + 1; y < scry; ++y) { // copy from first line
+                               memcpy(tmp_buffer + y*surface->stride,
+                                       tmp_buffer + yoff * surface->stride,
+                                       xoff * surface->bypp);
+                               memcpy(tmp_buffer + y*surface->stride + (xoff + scrx) * surface->bypp,
+                                       tmp_buffer + yoff * surface->stride + (xoff + scrx) * surface->bypp,
+                                       (m_filepara->max_x - scrx - xoff) * surface->bypp);
                        }
                }
                tmp_buffer += yoff * surface->stride + xoff * surface->bypp;
@@ -1326,13 +1226,30 @@ RESULT ePicLoad::setPara(int width, int height, double aspectRatio, int as, bool
        m_conf.resizetype = resizeType;
 
        if(bg_str[0] == '#' && strlen(bg_str)==9)
-               m_conf.background = strtoul(bg_str+1, NULL, 16);
+               m_conf.background = strtoul(bg_str+1, NULL, 16) | 0xFF000000;
        eDebug("[ePicLoad] setPara max-X=%d max-Y=%d aspect_ratio=%lf cache=%d resize=%d bg=#%08X auto_orient=%d",
                        m_conf.max_x, m_conf.max_y, m_conf.aspect_ratio,
                        (int)m_conf.usecache, (int)m_conf.resizetype, m_conf.background, m_conf.auto_orientation);
        return 1;
 }
 
+int ePicLoad::getFileType(const char * file)
+{
+       unsigned char id[10];
+       int fd = ::open(file, O_RDONLY);
+       if (fd == -1)
+               return -1;
+       ::read(fd, id, 10);
+       ::close(fd);
+
+       if      (id[1] == 'P'  && id[2] == 'N'  && id[3] == 'G')                        return F_PNG;
+       else if (id[6] == 'J'  && id[7] == 'F'  && id[8] == 'I' && id[9] == 'F')        return F_JPEG;
+       else if (id[0] == 0xff && id[1] == 0xd8 && id[2] == 0xff)                       return F_JPEG;
+       else if (id[0] == 'B'  && id[1] == 'M' )                                        return F_BMP;
+       else if (id[0] == 'G'  && id[1] == 'I'  && id[2] == 'F')                        return F_GIF;
+       return -1;
+}
+
 //------------------------------------------------------------------------------------
 
 //for old plugins
index d0d82c9..938f10b 100644 (file)
@@ -56,7 +56,6 @@ class ePicLoad: public eMainloop, public eThread, public Object, public iObject
 
        void decodePic();
        void decodeThumb();
-       void resizePic();
 
        Cfilepara *m_filepara;
        Cexif *m_exif;
@@ -95,7 +94,8 @@ class ePicLoad: public eMainloop, public eThread, public Object, public iObject
        void thread();
        int startThread(int what, const char *file, int x, int y, bool async=true);
        void thread_finished();
-       bool getExif(const char *filename);
+       bool getExif(const char *filename, int Thumb=0);
+       int getFileType(const char * file);
 public:
        void waitFinished();
        PSignal1<void, const char*> PictureData;
index ed1652a..7e6c7c2 100644 (file)
@@ -27,11 +27,12 @@ def DVDOverlay(*args, **kwargs):
 def filescan_open(list, session, **kwargs):
        from Screens import DVD
        if len(list) == 1 and list[0].mimetype == "video/x-dvd":
-               splitted = list[0].path.split('/')
-               if len(splitted) > 2:
-                       if splitted[1] == 'media' and (splitted[2].startswith('sr') or splitted[2] == 'dvd'):
-                               session.open(DVD.DVDPlayer, dvd_device="/dev/%s" %(splitted[2]))
-                               return
+               cd = harddiskmanager.getCD()
+               if cd and (os.path.exists(os.path.join(harddiskmanager.getAutofsMountpoint(cd), "VIDEO_TS"))
+                               or os.path.exists(os.path.join(harddiskmanager.getAutofsMountpoint(cd), "video_ts"))):
+                       print "[DVDplayer] found device /dev/%s", " mount path ", harddiskmanager.getAutofsMountpoint(cd)
+                       session.open(DVD.DVDPlayer, dvd_device="/dev/%s" %(harddiskmanager.getAutofsMountpoint(cd)))
+                       return
        else:
                dvd_filelist = []
                for x in list:
@@ -67,18 +68,20 @@ def onPartitionChange(action, partition):
        if partition != harddiskmanager.getCD():
                global detected_DVD
                if action == 'remove':
-                       print "[@] DVD removed"
+                       print "[DVDplayer] DVD removed"
                        detected_DVD = False
                elif action == 'add':
-                       print "[@] DVD Inserted"
+                       print "[DVDplayer] DVD Inserted"
                        detected_DVD = None
 
 def menu(menuid, **kwargs):
        if menuid == "mainmenu":
                global detected_DVD
-               if detected_DVD is None:
+               if detected_DVD is None or detected_DVD:
                        cd = harddiskmanager.getCD()
-                       if cd and os.path.exists(os.path.join(harddiskmanager.getAutofsMountpoint(harddiskmanager.getCD()), "VIDEO_TS")):
+                       if cd and (os.path.exists(os.path.join(harddiskmanager.getAutofsMountpoint(cd), "VIDEO_TS"))
+                                       or os.path.exists(os.path.join(harddiskmanager.getAutofsMountpoint(cd), "video_ts"))):
+                               print "[DVDplayer] Mountpoint is present and is", harddiskmanager.getAutofsMountpoint(cd)
                                detected_DVD = True
                        else:
                                detected_DVD = False
index 12cc96b..7cabaf3 100644 (file)
@@ -9,12 +9,14 @@ from Tools.Notifications import AddPopup
 from time import time
 
 class InputBox(Screen):
-       def __init__(self, session, title = "", windowTitle = "Input", useableChars = None, **kwargs):
+       def __init__(self, session, title = "", windowTitle = None, useableChars = None, **kwargs):
                Screen.__init__(self, session)
 
                self["text"] = Label(title)
                self["input"] = Input(**kwargs)
-               self.onShown.append(boundFunction(self.setTitle, _(windowTitle)))
+               if windowTitle is None:
+                       windowTitle = _("Input")
+               self.onShown.append(boundFunction(self.setTitle, windowTitle))
                if useableChars is not None:
                        self["input"].setUseableChars(useableChars)
 
index 61ae482..a9a722e 100644 (file)
@@ -50,7 +50,7 @@ class LocationBox(Screen, NumericalTextInput, HelpableScreen):
                        <widget name="key_blue" position="405,415" zPosition="2" size="135,40" halign="center" valign="center" font="Regular;22" transparent="1" shadowColor="black" shadowOffset="-1,-1" />
                </screen>"""
 
-       def __init__(self, session, text = "", filename = "", currDir = None, bookmarks = None, userMode = False, windowTitle = "Select location", minFree = None, autoAdd = False, editDir = False, inhibitDirs = [], inhibitMounts = []):
+       def __init__(self, session, text = "", filename = "", currDir = None, bookmarks = None, userMode = False, windowTitle = None, minFree = None, autoAdd = False, editDir = False, inhibitDirs = [], inhibitMounts = []):
                # Init parents
                Screen.__init__(self, session)
                NumericalTextInput.__init__(self, handleTimeout = False)
@@ -165,8 +165,10 @@ class LocationBox(Screen, NumericalTextInput, HelpableScreen):
                })
 
                # Run some functions when shown
+               if windowTitle is None:
+                       windowTitle = _("Select location")
                self.onShown.extend((
-                       boundFunction(self.setTitle, _(windowTitle)),
+                       boundFunction(self.setTitle, windowTitle),
                        self.updateTarget,
                        self.showHideRename,
                ))
index 51db000..d756e85 100644 (file)
@@ -237,9 +237,6 @@ def buildMovieLocationList(bookmarks):
                else:
                        bookmarks.append((p.tabbedDescription(), d))
                inlist.append(d)
-       for d in last_selected_dest:
-               if d not in inlist:
-                       bookmarks.append((d,d))
 
 class MovieBrowserConfiguration(ConfigListScreen,Screen):
        skin = """
index 0305717..56ac23c 100644 (file)
@@ -87,7 +87,7 @@ class UpdatePlugin(Screen, ProtectedScreen):
                try:
                        # TODO: Use Twisted's URL fetcher, urlopen is evil. And it can
                        # run in parallel to the package update.
-                       status = urlopen("http://openpli.org/status").read().split('!', 1)
+                       status = urlopen("http://openpli.org/status/").read().split('!', 1)
                        if getBoxType() in status[0].split(','):
                                message = len(status) > 1 and status[1] or _("The current beta image might not be stable.\nFor more information see %s.") % ("www.openpli.org")
                                picon = MessageBox.TYPE_ERROR
index e076080..5c61a1b 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -2,8 +2,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: enigma2\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-08-23 19:59+0200\n"
-"PO-Revision-Date: 2015-08-23 20:02+0200\n"
+"POT-Creation-Date: 2015-09-08 23:22+0200\n"
+"PO-Revision-Date: 2015-09-08 23:30+0200\n"
 "Last-Translator: Pr2 <dummy@dummy.com>\n"
 "Language-Team: french\n"
 "Language: fr\n"
@@ -903,6 +903,9 @@ msgstr "Mode création"
 msgid "Auto"
 msgstr "Auto"
 
+msgid "Auto EXIF Orientation rotation/flipping"
+msgstr "Orientation EXIF automatique rotation/retournement (seulement jpg)"
+
 msgid "Auto chapter split every ? minutes (0=never)"
 msgstr "Auto diviser chaque chapitre? minutes (0 = jamais)"
 
@@ -1644,6 +1647,9 @@ msgstr "Satellites connectés"
 msgid "Connected to"
 msgstr "Connecté à"
 
+msgid "Console"
+msgstr "Console"
+
 msgid "Constellation"
 msgstr "Constellation"
 
@@ -6087,7 +6093,7 @@ msgstr ""
 "Traduction Française\n"
 "Enigma2 - OpenPLi\n"
 "Support: www.openpli.org\n"
-"Dernière MAJ: 18 août 2015"
+"Dernière MAJ: 8 septembre 2015"
 
 msgid "TS file is too large for ISO9660 level 1!"
 msgstr "Fichier TS trop grand pour le niveau 1 ISO9660!"
index f7e3f14..3ec8015 100644 (file)
--- a/po/lv.po
+++ b/po/lv.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: enigma2\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-08-21 18:42+0300\n"
+"POT-Creation-Date: 2015-09-06 21:02+0300\n"
 "PO-Revision-Date: 2014-11-12 00:49+0200\n"
 "Last-Translator: Tapat <taapat@gmail.com>\n"
 "Language-Team: Taapat <taapat@gmail.com>\n"
@@ -916,6 +916,9 @@ msgstr "Autorizēšanas režīms"
 msgid "Auto"
 msgstr "Automātiski"
 
+msgid "Auto EXIF Orientation rotation/flipping"
+msgstr "Automātiska attēla attēlošana izmantojot EXIF datus"
+
 msgid "Auto chapter split every ? minutes (0=never)"
 msgstr "Automātiska nodaļu veidošana katras ? minūtes (0=neveidot)"
 
@@ -1657,6 +1660,9 @@ msgstr "Pieslēdz pavadoņus"
 msgid "Connected to"
 msgstr "Pieslēgts"
 
+msgid "Console"
+msgstr "Konsole"
+
 msgid "Constellation"
 msgstr "Modulācijas veids"