Changeset 35a3ceeb38571b5799fed8b56683640febb4b78d

Show
Ignore:
Timestamp:
17/05/03 22:30:31 (6 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1053203431 +0000
git-parent:

[4a7b163500b0ddda7eba633bf216402987b09037]

git-author:
Gildas Bazin <gbazin@videolan.org> 1053203431 +0000
Message:

* modules/access/cdda.c, modules/access/vcd/*: New CD digital audio module (by me and fenrir).

You can now listen to your favorite CDDAs with vlc, or even stream them :)
(Their is not yet any support for jitter correction).

* modules/codec/araw.c: small clean-up.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.ac.in

    r4525fff r35a3cee  
    8686    LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvd" 
    8787    LDFLAGS_vcd="${LDFLAGS_vcd} -ldvd" 
     88    LDFLAGS_cdda="${LDFLAGS_cdda} -ldvd" 
    8889    ;; 
    8990  x*bsd*) 
     
    13581359  AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[ 
    13591360    AC_MSG_RESULT(yes) 
    1360     PLUGINS="${PLUGINS} vcd
     1361    PLUGINS="${PLUGINS} vcd cdda
    13611362  ],[ 
    13621363    AC_MSG_RESULT(no) 
     
    13661367  AC_EGREP_HEADER(scsireq,sys/scsiio.h,[ 
    13671368    AC_MSG_RESULT(yes) 
    1368     PLUGINS="${PLUGINS} vcd
     1369    PLUGINS="${PLUGINS} vcd cdda
    13691370    AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support) 
    13701371  ],[ 
     
    13751376  AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[ 
    13761377    AC_MSG_RESULT(yes) 
    1377     PLUGINS="${PLUGINS} vcd
     1378    PLUGINS="${PLUGINS} vcd cdda
    13781379    AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support) 
    13791380  ],[ 
     
    13831384  if test "x${SYS}" = "xbsdi" -o "x${SYS}" = "xmingw32" 
    13841385  then 
    1385     PLUGINS="${PLUGINS} vcd
     1386    PLUGINS="${PLUGINS} vcd cdda
    13861387  fi 
    13871388 
    13881389  if test "x${SYS}" = "xdarwin" 
    13891390  then 
    1390     PLUGINS="${PLUGINS} vcd
     1391    PLUGINS="${PLUGINS} vcd cdda
    13911392    LDFLAGS_vcd="${LDFLAGS_vcd} -framework IOKit -framework CoreFoundation" 
     1393    LDFLAGS_cdda="${LDFLAGS_cdda} -framework IOKit -framework CoreFoundation" 
    13921394  fi 
    13931395fi 
  • modules/access/Modules.am

    reb0eac0 r35a3cee  
    55SOURCES_access_ftp = modules/access/ftp.c 
    66SOURCES_slp = modules/access/slp.c 
     7SOURCES_cdda = \ 
     8        modules/access/cdda.c \ 
     9        modules/access/vcd/cdrom.c \ 
     10        modules/access/vcd/cdrom.h \ 
     11        modules/access/vcd/cdrom_internals.h \ 
     12        $(NULL) 
  • modules/access/vcd/Modules.am

    rc3a40bc r35a3cee  
    11SOURCES_vcd = \ 
    22    modules/access/vcd/vcd.c \ 
    3     modules/access/vcd/vcd.h \ 
    43    modules/access/vcd/cdrom.c \ 
    54    modules/access/vcd/cdrom.h \ 
     5    modules/access/vcd/cdrom_internals.h \ 
    66    $(NULL) 
  • modules/access/vcd/cdrom.c

    ra2d1d9f r35a3cee  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998-2001 VideoLAN 
    5  * $Id: cdrom.c,v 1.8 2003/03/10 00:12:53 gbazin Exp $ 
     5 * $Id: cdrom.c,v 1.9 2003/05/17 20:30:31 gbazin Exp $ 
    66 * 
    77 * Authors: Johan Bilien <jobi@via.ecp.fr> 
     
    6868#endif 
    6969 
     70#include "cdrom_internals.h" 
    7071#include "cdrom.h" 
    71 #include "vcd.h" 
    7272 
    7373/***************************************************************************** 
     
    543543 
    544544/**************************************************************************** 
    545  * ioctl_ReadSector: Read a sector (2324 bytes
     545 * ioctl_ReadSector: Read a sector (2352 bytes - i_start
    546546 ****************************************************************************/ 
    547547int ioctl_ReadSector( vlc_object_t *p_this, const vcddev_t *p_vcddev, 
    548                       int i_sector, byte_t * p_buffer ) 
     548                      int i_sector, byte_t * p_buffer, size_t i_start, 
     549                      size_t i_len ) 
    549550{ 
    550551    byte_t p_block[ VCD_SECTOR_SIZE ]; 
     
    570571 
    571572        /* We don't want to keep the header of the read sector */ 
    572         memcpy( p_buffer, p_block + VCD_DATA_START, VCD_DATA_SIZE ); 
     573        memcpy( p_buffer, p_block + i_start, i_len ); 
    573574 
    574575        return 0; 
     
    628629            ssc.CDBByte[ 0 ] = READ_CD; 
    629630 
     631            /* Sector type */ 
     632            ssc.CDBByte[ 1 ] = SECTOR_TYPE_MODE2_FORM2; 
     633 
    630634            /* Start of LBA */ 
    631635            ssc.CDBByte[ 2 ] = ( i_sector >> 24 ) & 0xff; 
     
    640644 
    641645            /* Data selection */ 
    642             ssc.CDBByte[ 9 ] = READ_CD_USERDATA_MODE2; 
     646            ssc.CDBByte[ 9 ] = READ_CD_RAW_MODE2; 
    643647 
    644648            /* Result buffer */ 
     
    663667                return -1; 
    664668            } 
    665  
    666             /* We don't want to keep the footer of the read sector */ 
    667             memcpy( p_buffer, p_block, VCD_DATA_SIZE ); 
    668             return 0; 
    669669        } 
    670670        else 
     
    686686                return -1; 
    687687            } 
    688  
    689             /* We don't want to keep the header of the read sector */ 
    690             memcpy( p_buffer, p_block + VCD_DATA_START, VCD_DATA_SIZE ); 
    691  
    692             return 0; 
    693688        } 
    694689 
     
    699694        int i_ret; 
    700695 
    701         int sector_type = 5; /* mode2/form2 */ 
    702         int sync = 0, 
    703             header_code = 0, 
    704             user_data = 1, 
    705             edc_ecc = 0, 
    706             error_field = 0; 
    707         int sub_channel = 0; 
    708  
    709696        memset( &sc, 0, sizeof(sc) ); 
    710697        sc.cmd[0] = 0xBE; 
    711         sc.cmd[1] = (sector_type) << 2; 
     698        sc.cmd[1] = SECTOR_TYPE_MODE2_FORM2; 
    712699        sc.cmd[2] = (i_sector >> 24) & 0xff; 
    713700        sc.cmd[3] = (i_sector >> 16) & 0xff; 
     
    717704        sc.cmd[7] = (i_blocks >>  8) & 0xff; 
    718705        sc.cmd[8] = (i_blocks >>  0) & 0xff; 
    719         sc.cmd[9] = (sync << 7) | (header_code << 5) | (user_data << 4) | 
    720                     (edc_ecc << 3) | (error_field << 1); 
    721         sc.cmd[10] = sub_channel; 
     706        sc.cmd[9] = READ_CD_RAW_MODE2; 
     707        sc.cmd[10] = 0; /* sub channel */ 
    722708        sc.cmdlen = 12; 
    723709        sc.databuf = (caddr_t)p_block; 
    724         sc.datalen = VCD_SECTOR_SIZE;      // was 2328 == VCD_DATA_SIZE + 4; 
     710        sc.datalen = VCD_SECTOR_SIZE; 
    725711        sc.senselen = sizeof( sc.sense ); 
    726712        sc.flags = SCCMD_READ; 
     
    780766#endif 
    781767 
    782 #if defined( HAVE_SCSIREQ_IN_SYS_SCSIIO_H ) 
    783         /* FIXME: is this ok? */ 
    784         memcpy( p_buffer, p_block, VCD_DATA_SIZE ); 
    785 #else 
    786768        /* We don't want to keep the header of the read sector */ 
    787         memcpy( p_buffer, p_block + VCD_DATA_START, VCD_DATA_SIZE ); 
    788 #endif 
     769        memcpy( p_buffer, p_block + i_start, i_len ); 
    789770 
    790771        return( 0 ); 
     
    833814 
    834815    /* Open the cue file and try to parse it */ 
    835     msg_Dbg( p_this,"using .cue file: %s", psz_cuefile ); 
     816    msg_Dbg( p_this,"trying .cue file: %s", psz_cuefile ); 
    836817    cuefile = fopen( psz_cuefile, "rt" ); 
    837818    if( cuefile && fscanf( cuefile, "FILE %c", line ) && 
  • modules/access/vcd/cdrom.h

    r63f553e r35a3cee  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998-2001 VideoLAN 
    5  * $Id: cdrom.h,v 1.4 2002/10/16 23:12:46 massiot Exp $ 
     5 * $Id: cdrom.h,v 1.5 2003/05/17 20:30:31 gbazin Exp $ 
    66 * 
    77 * Authors: Johan Bilien <jobi@via.ecp.fr> 
     
    2323 *****************************************************************************/ 
    2424 
    25 /***************************************************************************** 
    26  * The vcddev structure 
    27  *****************************************************************************/ 
    28 typedef struct vcddev_s 
    29 
    30     char   *psz_dev;                                      /* vcd device name */ 
     25/* where the data start on a VCD sector */ 
     26#define VCD_DATA_START 24 
     27/* size of the availablr data on a VCD sector */ 
     28#define VCD_DATA_SIZE 2324 
     29/* size of a VCD sector, header and tail included */ 
     30#define VCD_SECTOR_SIZE 2352 
     31/* size of a CD sector */ 
     32#define CD_SECTOR_SIZE 2048 
     33/* sector containing the entry points */ 
     34#define VCD_ENTRIES_SECTOR 151 
    3135 
    32     /* Section used in vcd image mode */ 
    33     int    i_vcdimage_handle;                   /* vcd image file descriptor */ 
    34     int    i_tracks;                          /* number of tracks of the vcd */ 
    35     int    *p_sectors;                           /* tracks layout on the vcd */ 
    36  
    37     /* Section used in vcd device mode */ 
    38  
    39 #ifdef WIN32 
    40     HANDLE h_device_handle;                         /* vcd device descriptor */ 
    41     long  hASPI; 
    42     short i_sid; 
    43     long  (*lpSendCommand)( void* ); 
    44  
    45 #else 
    46     int    i_device_handle;                         /* vcd device descriptor */ 
    47 #endif 
    48  
    49 } vcddev_t; 
    50  
     36/* where the data start on a CDDA sector */ 
     37#define CDDA_DATA_START 0 
     38/* size of the availablr data on a CDDA sector */ 
     39#define CDDA_DATA_SIZE 2352 
     40/* size of a CDDA sector, header and tail included */ 
     41#define CDDA_SECTOR_SIZE 2352 
    5142 
    5243/***************************************************************************** 
     
    5748/* LBA = msf.frame + 75 * ( msf.second - 2 + 60 * msf.minute ) */ 
    5849#define MSF_TO_LBA2(min, sec, frame) ((int)frame + 75 * (sec -2 + 60 * min)) 
     50/* Converts BCD to Binary data */ 
     51#define BCD_TO_BIN(i) \ 
     52    (uint8_t)((uint8_t)(0xf & (uint8_t)i)+((uint8_t)10*((uint8_t)i >> 4))) 
    5953 
    60 #ifndef O_BINARY 
    61 #   define O_BINARY 0 
    62 #endif 
    63  
    64 #define VCDDEV_T 1 
     54typedef struct vcddev_s vcddev_t; 
    6555 
    6656/***************************************************************************** 
    67  * Platform specific
     57 * structure to store minute/second/frame location
    6858 *****************************************************************************/ 
    69 #if defined( SYS_DARWIN ) 
    70 #define darwin_freeTOC( p ) free( (void*)p ) 
    71 #define CD_MIN_TRACK_NO 01 
    72 #define CD_MAX_TRACK_NO 99 
    73 #endif 
    74  
    75 #if defined( WIN32 ) 
    76  
    77 /* Win32 DeviceIoControl specifics */ 
    78 #ifndef MAXIMUM_NUMBER_TRACKS 
    79 #    define MAXIMUM_NUMBER_TRACKS 100 
    80 #endif 
    81 typedef struct _TRACK_DATA { 
    82     UCHAR Reserved; 
    83     UCHAR Control : 4; 
    84     UCHAR Adr : 4; 
    85     UCHAR TrackNumber; 
    86     UCHAR Reserved1; 
    87     UCHAR Address[4]; 
    88 } TRACK_DATA, *PTRACK_DATA; 
    89 typedef struct _CDROM_TOC { 
    90     UCHAR Length[2]; 
    91     UCHAR FirstTrack; 
    92     UCHAR LastTrack; 
    93     TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS]; 
    94 } CDROM_TOC, *PCDROM_TOC; 
    95 typedef enum _TRACK_MODE_TYPE { 
    96     YellowMode2, 
    97     XAForm2, 
    98     CDDA 
    99 } TRACK_MODE_TYPE, *PTRACK_MODE_TYPE; 
    100 typedef struct __RAW_READ_INFO { 
    101     LARGE_INTEGER DiskOffset; 
    102     ULONG SectorCount; 
    103     TRACK_MODE_TYPE TrackMode; 
    104 } RAW_READ_INFO, *PRAW_READ_INFO; 
    105  
    106 #ifndef IOCTL_CDROM_BASE 
    107 #    define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM 
    108 #endif 
    109 #ifndef IOCTL_CDROM_READ_TOC 
    110 #    define IOCTL_CDROM_READ_TOC CTL_CODE(IOCTL_CDROM_BASE, 0x0000, \ 
    111                                           METHOD_BUFFERED, FILE_READ_ACCESS) 
    112 #endif 
    113 #ifndef IOCTL_CDROM_RAW_READ 
    114 #define IOCTL_CDROM_RAW_READ CTL_CODE(IOCTL_CDROM_BASE, 0x000F, \ 
    115                                       METHOD_OUT_DIRECT, FILE_READ_ACCESS) 
    116 #endif 
    117  
    118 /* Win32 aspi specific */ 
    119 #define WIN_NT               ( GetVersion() < 0x80000000 ) 
    120 #define ASPI_HAID           0 
    121 #define ASPI_TARGET         0 
    122 #define DTYPE_CDROM         0x05 
    123  
    124 #define SENSE_LEN           0x0E 
    125 #define SC_GET_DEV_TYPE     0x01 
    126 #define SC_EXEC_SCSI_CMD    0x02 
    127 #define SC_GET_DISK_INFO    0x06 
    128 #define SS_COMP             0x01 
    129 #define SS_PENDING          0x00 
    130 #define SS_NO_ADAPTERS      0xE8 
    131 #define SRB_DIR_IN          0x08 
    132 #define SRB_DIR_OUT         0x10 
    133 #define SRB_EVENT_NOTIFY    0x40 
    134  
    135 #define READ_CD 0xbe 
    136 #define SECTOR_TYPE_MODE2 0x14 
    137 #define READ_CD_USERDATA_MODE2 0x10 
    138  
    139 #define READ_TOC 0x43 
    140 #define READ_TOC_FORMAT_TOC 0x0 
    141  
    142 #pragma pack(1) 
    143  
    144 struct SRB_GetDiskInfo 
     59typedef struct msf_s 
    14560{ 
    146     unsigned char   SRB_Cmd; 
    147     unsigned char   SRB_Status; 
    148     unsigned char   SRB_HaId; 
    149     unsigned char   SRB_Flags; 
    150     unsigned long   SRB_Hdr_Rsvd; 
    151     unsigned char   SRB_Target; 
    152     unsigned char   SRB_Lun; 
    153     unsigned char   SRB_DriveFlags; 
    154     unsigned char   SRB_Int13HDriveInfo; 
    155     unsigned char   SRB_Heads; 
    156     unsigned char   SRB_Sectors; 
    157     unsigned char   SRB_Rsvd1[22]; 
    158 }; 
    159  
    160 struct SRB_GDEVBlock 
    161 
    162     unsigned char SRB_Cmd; 
    163     unsigned char SRB_Status; 
    164     unsigned char SRB_HaId; 
    165     unsigned char SRB_Flags; 
    166     unsigned long SRB_Hdr_Rsvd; 
    167     unsigned char SRB_Target; 
    168     unsigned char SRB_Lun; 
    169     unsigned char SRB_DeviceType; 
    170     unsigned char SRB_Rsvd1; 
    171 }; 
    172  
    173 struct SRB_ExecSCSICmd 
    174 
    175     unsigned char   SRB_Cmd; 
    176     unsigned char   SRB_Status; 
    177     unsigned char   SRB_HaId; 
    178     unsigned char   SRB_Flags; 
    179     unsigned long   SRB_Hdr_Rsvd; 
    180     unsigned char   SRB_Target; 
    181     unsigned char   SRB_Lun; 
    182     unsigned short  SRB_Rsvd1; 
    183     unsigned long   SRB_BufLen; 
    184     unsigned char   *SRB_BufPointer; 
    185     unsigned char   SRB_SenseLen; 
    186     unsigned char   SRB_CDBLen; 
    187     unsigned char   SRB_HaStat; 
    188     unsigned char   SRB_TargStat; 
    189     unsigned long   *SRB_PostProc; 
    190     unsigned char   SRB_Rsvd2[20]; 
    191     unsigned char   CDBByte[16]; 
    192     unsigned char   SenseArea[SENSE_LEN+2]; 
    193 }; 
    194  
    195 #pragma pack() 
    196 #endif /* WIN32 */ 
    197  
     61    uint8_t minute; 
     62    uint8_t second; 
     63    uint8_t frame; 
     64} msf_t; 
    19865 
    19966/***************************************************************************** 
    200  * Local Prototype
     67 * entries_sect structure: the sector containing entry point
    20168 *****************************************************************************/ 
    202 static int    OpenVCDImage( vlc_object_t *, const char *, vcddev_t * ); 
    203 static void   CloseVCDImage( vlc_object_t *, vcddev_t * ); 
     69typedef struct entries_sect_s 
     70
     71    uint8_t psz_id[8];                              /* "ENTRYVCD" */ 
     72    uint8_t i_version;                              /* 0x02 VCD2.0 
     73                                                       0x01 SVCD  */ 
     74    uint8_t i_sys_prof_tag;                         /* 0x01 if VCD1.1 
     75                                                       0x00 else */ 
     76    uint16_t i_entries_nb;                          /* entries number <= 500 */ 
    20477 
    205 #if defined( SYS_DARWIN ) 
    206 static CDTOC *darwin_getTOC( vlc_object_t *, const vcddev_t * ); 
    207 static int    darwin_getNumberOfDescriptors( CDTOC * ); 
    208 static int    darwin_getNumberOfTracks( CDTOC *, int ); 
     78    struct 
     79    { 
     80        uint8_t i_track;                            /* track number */ 
     81        msf_t   msf;                                /* msf location 
     82                                                       (in BCD format) */ 
     83    } entry[500]; 
     84    uint8_t zeros[36];                              /* should be 0x00 */ 
     85} entries_sect_t; 
    20986 
    210 #elif defined( WIN32 ) 
    211 static int    win32_vcd_open( vlc_object_t *, const char *, vcddev_t * ); 
    212 #endif 
     87/***************************************************************************** 
     88 * Prototypes 
     89 *****************************************************************************/ 
     90vcddev_t *ioctl_Open         ( vlc_object_t *, const char * ); 
     91void      ioctl_Close        ( vlc_object_t *, vcddev_t * ); 
     92int       ioctl_GetTracksMap ( vlc_object_t *, const vcddev_t *, int ** ); 
     93int       ioctl_ReadSector   ( vlc_object_t *, const vcddev_t *, 
     94                               int, byte_t *, size_t, size_t ); 
  • modules/access/vcd/vcd.c

    r30336bb r35a3cee  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000 VideoLAN 
    5  * $Id: vcd.c,v 1.19 2003/05/04 22:42:15 gbazin Exp $ 
     5 * $Id: vcd.c,v 1.20 2003/05/17 20:30:31 gbazin Exp $ 
    66 * 
    77 * Author: Johan Bilien <jobi@via.ecp.fr> 
     
    3939#include <string.h> 
    4040 
    41 #include "vcd.h" 
     41#include "cdrom.h" 
    4242 
    4343/* how many blocks VCDRead will read in each loop */ 
     
    102102    int                     i_title = 1; 
    103103    int                     i_chapter = 1; 
    104  
    105     p_input->pf_read = VCDRead; 
    106     p_input->pf_seek = VCDSeek; 
    107     p_input->pf_set_area = VCDSetArea; 
    108     p_input->pf_set_program = VCDSetProgram; 
     104    vcddev_t                *vcddev; 
    109105 
    110106#ifdef WIN32 
     
    155151    } 
    156152 
     153    /* Open VCD */ 
     154    if( !(vcddev = ioctl_Open( p_this, psz_source )) ) 
     155    { 
     156        msg_Warn( p_input, "could not open %s", psz_source ); 
     157        free( psz_source ); 
     158        return -1; 
     159    } 
     160 
    157161    p_vcd = malloc( sizeof(thread_vcd_data_t) ); 
    158  
    159162    if( p_vcd == NULL ) 
    160163    { 
     
    163166        return -1; 
    164167    } 
    165  
     168    free( psz_source ); 
     169 
     170    p_vcd->vcddev = vcddev; 
    166171    p_input->p_access_data = (void *)p_vcd; 
    167172 
     
    169174 
    170175    vlc_mutex_lock( &p_input->stream.stream_lock ); 
    171  
    172176    p_input->stream.b_pace_control = 1; 
    173177    p_input->stream.b_seekable = 1; 
    174178    p_input->stream.p_selected_area->i_size = 0; 
    175179    p_input->stream.p_selected_area->i_tell = 0; 
    176  
    177180    vlc_mutex_unlock( &p_input->stream.stream_lock ); 
    178  
    179     if( !(p_vcd->vcddev = ioctl_Open( p_this, psz_source )) ) 
    180     { 
    181         msg_Warn( p_input, "could not open %s", psz_source ); 
    182         free( psz_source ); 
    183         free( p_vcd ); 
    184         return -1; 
    185     } 
    186181 
    187182    /* We read the Table Of Content information */ 
    188183    p_vcd->i_nb_tracks = ioctl_GetTracksMap( VLC_OBJECT(p_input), 
    189184                                           p_vcd->vcddev, &p_vcd->p_sectors ); 
    190     free( psz_source ); 
    191185    if( p_vcd->i_nb_tracks < 0 ) 
    192186        msg_Err( p_input, "unable to count tracks" ); 
     
    259253    } 
    260254 
     255    p_input->pf_read = VCDRead; 
     256    p_input->pf_seek = VCDSeek; 
     257    p_input->pf_set_area = VCDSetArea; 
     258    p_input->pf_set_program = VCDSetProgram; 
     259 
    261260    return 0; 
    262261} 
     
    300299    { 
    301300        if ( ioctl_ReadSector( VLC_OBJECT(p_input), p_vcd->vcddev, 
    302                     p_vcd->i_sector, p_buffer + i_index * VCD_DATA_SIZE ) < 0 ) 
     301             p_vcd->i_sector, p_buffer + i_index * VCD_DATA_SIZE, 
     302             VCD_DATA_START, VCD_DATA_SIZE ) < 0 ) 
    303303        { 
    304304            msg_Err( p_input, "could not read sector %d", p_vcd->i_sector ); 
     
    353353    { 
    354354        if ( ioctl_ReadSector( VLC_OBJECT(p_input), p_vcd->vcddev, 
    355                                p_vcd->i_sector, p_last_sector ) < 0 ) 
     355             p_vcd->i_sector, p_last_sector, VCD_DATA_START, 
     356             VCD_DATA_SIZE ) < 0 ) 
    356357        { 
    357358            msg_Err( p_input, "could not read sector %d", p_vcd->i_sector ); 
     
    367368} 
    368369 
    369  
    370370/***************************************************************************** 
    371371 * VCDSetProgram: Does nothing since a VCD is mono_program 
     
    376376    return 0; 
    377377} 
    378  
    379378 
    380379/***************************************************************************** 
     
    443442    return 0; 
    444443} 
    445  
    446444 
    447445/**************************************************************************** 
     
    503501 
    504502    if( ioctl_ReadSector( VLC_OBJECT(p_input), p_vcd->vcddev, 
    505                                 VCD_ENTRIES_SECTOR, p_sector ) < 0 ) 
     503        VCD_ENTRIES_SECTOR, p_sector, VCD_DATA_START, VCD_DATA_SIZE ) < 0 ) 
    506504    { 
    507505        msg_Err( p_input, "could not read entry points sector" ); 
  • modules/codec/araw.c

    r9546699 r35a3cee  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: araw.c,v 1.14 2003/03/11 17:40:40 fenrir Exp $ 
     5 * $Id: araw.c,v 1.15 2003/05/17 20:30:31 gbazin Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    4040{ 
    4141    WAVEFORMATEX    *p_wf; 
    42  
    43     /* The bit stream structure handles the PES stream at the bit level */ 
    44 //    bit_stream_t        bit_stream; 
    4542 
    4643    /* Input properties */ 
     
    245242static int InitThread( adec_thread_t * p_adec ) 
    246243{ 
    247     if( ( p_adec->p_wf = (WAVEFORMATEX*)p_adec->p_fifo->p_waveformatex ) == NULL ) 
     244    if( ( p_adec->p_wf = (WAVEFORMATEX*)p_adec->p_fifo->p_waveformatex ) 
     245        == NULL ) 
    248246    { 
    249247        msg_Err( p_adec->p_fifo, "unknown raw format" ); 
     
    262260 
    263261    msg_Dbg( p_adec->p_fifo, 
    264              "raw format: samplerate:%dHz channels:%d bits/sample:%d blockalign:%d", 
     262             "raw format: samplerate:%dHz channels:%d bits/sample:%d " 
     263             "blockalign:%d", 
    265264             p_adec->p_wf->nSamplesPerSec, 
    266265             p_adec->p_wf->nChannels, 
     
    363362    p_adec->output_format.i_rate = p_adec->p_wf->nSamplesPerSec; 
    364363 
    365     if( p_adec->p_wf->nChannels <= 0 || 
    366             p_adec->p_wf->nChannels > 5 ) 
     364    if( p_adec->p_wf->nChannels <= 0 || p_adec->p_wf->nChannels > 5 ) 
    367365    { 
    368366        msg_Err( p_adec->p_fifo, "bad channels count(1-5)" ); 
     
    387385    } 
    388386 
    389     /* Init the BitStream */ 
    390 //    InitBitstream( &p_adec->bit_stream, p_adec->p_fifo, 
    391 //                   NULL, NULL ); 
    392  
    393387    return( 0 ); 
    394388} 
     
    406400    { 
    407401 
    408         i_copy = __MIN( p_data->p_payload_end - p_data->p_payload_start, i_max - i_count ); 
     402        i_copy = __MIN( p_data->p_payload_end - p_data->p_payload_start, 
     403                        i_max - i_count ); 
    409404 
    410405        if( i_copy > 0 ) 
     
    456451    } 
    457452 
    458     i_samples = i_size / 
    459                 ( ( p_adec->p_wf->wBitsPerSample + 7 ) / 8 ) / 
     453    i_samples = i_size / ( ( p_adec->p_wf->wBitsPerSample + 7 ) / 8 ) / 
    460454                p_adec->p_wf->nChannels; 
    461455 
    462 //    msg_Warn( p_adec->p_fifo, "got %d samples (%d bytes)", i_samples, i_size ); 
    463456    p_adec->pts = p_pes->i_pts; 
    464457 
     
    512505        else 
    513506        { 
    514             memcpy( p_aout_buffer->p_buffer, 
    515                     p, 
     507            memcpy( p_aout_buffer->p_buffer, p, 
    516508                    p_aout_buffer->i_nb_bytes ); 
    517509 
     
    528520} 
    529521 
    530  
    531522/***************************************************************************** 
    532523 * EndThread : faad decoder thread destruction 
     
    543534    free( p_adec ); 
    544535} 
    545  
    546