1. 09 Sep, 2015 1 commit
  2. 01 Sep, 2015 1 commit
  3. 20 May, 2015 4 commits
  4. 29 Apr, 2015 1 commit
  5. 25 Mar, 2015 1 commit
  6. 14 Mar, 2015 1 commit
  7. 29 Jan, 2015 1 commit
  8. 28 Jan, 2015 5 commits
  9. 27 Jan, 2015 1 commit
  10. 21 Jan, 2015 9 commits
  11. 03 Dec, 2014 2 commits
  12. 06 Nov, 2014 1 commit
    • Andrew Clayton's avatar
      src/md5: Replace the MD5 implementation with the FSF LGPL one · 3dbbdfb5
      Andrew Clayton authored
      With GCC 4.8.3 on x86_64 Fedora 20 we get the following warnings from
      src/md5.c
      
          src/md5.c: In function 'md5_finish_ctx':
          src/md5.c:102:3: warning: dereferencing type-punned pointer will
           break strict-aliasing rules [-Wstrict-aliasing]
          *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] <<
           3);
          ^
          src/md5.c:103:3: warning: dereferencing type-punned pointer will
           break strict-aliasing rules [-Wstrict-aliasing]
          *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP
           ((ctx->total[1] << 3) |
          ^
      
      Rather than trying to fix this, Jean-Baptiste Kempf suggested it would
      be better to replace this old implementation with something newer such
      as the one used in VLC. So, this is what this does.
      
      We take src/misc/md5.c as src/md5.c and include/vlc_md5.h as src/md5.h
      
      md5.c had little changed in it, just some #include changes, I also had
      to remove the restrict keyword from the AddMD5() function definition as
      this is a C99 thing. This shouldn't really make much difference in this
      usage.
      
      md5.h had the VLC_API macro usage removed and I removed the psz_md5_hash
      function as it's not used.
      
      Finally DVDDiscID() in src/dvd_reader.c was changed to make use of this
      new implementation. I tested this with the following program
      
          /*
           * gcc -O2 -Wall -o dvddiscid dvddiscid.c -ldvdread
           */
      
          #include <stdio.h>
      
          #include <dvdread/dvd_reader.h>
      
          int main(void)
          {
              int i;
              dvd_reader_t *dvd;
              unsigned char id[16];
      
              dvd = DVDOpen("/dev/sr0");
              DVDDiscID(dvd, id);
              DVDClose(dvd);
      
              for (i = 0; i < 16; i++)
                   printf("%.2x", id[i]);
              printf("\n");
      
              return 0;
          }
      
      and get the same MD5 before and after this change.
      
          $ ./dvddiscid
          a02f30eb3e76e624b766ec0248757901
      
          $ LD_LIBRARY_PATH=/opt/libdvdread/lib ./dvddiscid
          a02f30eb3e76e624b766ec0248757901
      Signed-off-by: 's avatarAndrew Clayton <andrew@digital-domain.net>
      Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
      Tested-by: 's avatarSteve Dibb <beandog@gentoo.org>
      3dbbdfb5
  13. 05 Nov, 2014 1 commit
    • Andrew Clayton's avatar
      src/dvd_input.c: Annotate unused function parameters · d2314b8c
      Andrew Clayton authored
      In libdvdread some functions take parameters that are unused. These
      functions are for working without the libdvdcss library but have to have
      the same prototype as the ones for working with it as these are
      presented as single API.
      
      As such we get the following warnings from GCC (4.8.3)
      
          src/dvd_input.c: In function 'file_error':
          src/dvd_input.c:186:37: warning: unused parameter 'dev'
            [-Wunused-parameter]
           static char *file_error(dvd_input_t dev)
                                               ^
          src/dvd_input.c: In function 'file_title':
          src/dvd_input.c:210:35: warning: unused parameter 'dev'
            [-Wunused-parameter]
           static int file_title(dvd_input_t dev, int block)
                                             ^
          src/dvd_input.c:210:44: warning: unused parameter 'block'
            [-Wunused-parameter]
           static int file_title(dvd_input_t dev, int block)
                                                      ^
          src/dvd_input.c: In function 'file_read':
          src/dvd_input.c:218:69: warning: unused parameter 'flags'
            [-Wunused-parameter]
           static int file_read(dvd_input_t dev, void *buffer, int blocks,
                                int flags)
                                    ^
      The previous commit added a #define set to __attribute__((unused)) when
      GCC is being used (empty otherwise). This can be used to inform the
      compiler about such unused parameters and gets rid of those warnings.
      Signed-off-by: 's avatarAndrew Clayton <andrew@digital-domain.net>
      Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
      d2314b8c
  14. 24 Oct, 2014 7 commits
  15. 02 Oct, 2014 1 commit
  16. 01 Oct, 2014 2 commits
  17. 30 Aug, 2014 1 commit