From: Rocky B. <ro...@us...> - 2003-01-19 14:10:38
|
Update of /cvsroot/xine/xine-vcdnav/vcdimager-0.7.12-rocky/libvcd In directory sc8-pr-cvs1:/tmp/cvs-serv8165/vcdimager-0.7.12-rocky/libvcd Modified Files: vcd_assert.h vcd_image_bincue.c vcd_mpeg.c vcd_types.h vcdinfo.c vcdinfo.h Log Message: Synching with Herbert's VCDImager changes. Index: vcd_assert.h =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/vcdimager-0.7.12-rocky/libvcd/vcd_assert.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- vcd_assert.h 25 Jun 2002 12:30:43 -0000 1.1.1.1 +++ vcd_assert.h 19 Jan 2003 14:10:35 -0000 1.2 @@ -23,11 +23,12 @@ #if defined(__GNUC__) +#include <libvcd/vcd_types.h> #include <libvcd/vcd_logging.h> #define vcd_assert(expr) \ (void) ({ \ - if (!(expr)) vcd_log (LOG_ASSERT, \ + if (GNUC_UNLIKELY (!(expr))) vcd_log (LOG_ASSERT, \ "file %s: line %d (%s): assertion failed: (%s)", \ __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \ }) Index: vcd_image_bincue.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/vcdimager-0.7.12-rocky/libvcd/vcd_image_bincue.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- vcd_image_bincue.c 13 Jan 2003 01:45:30 -0000 1.8 +++ vcd_image_bincue.c 19 Jan 2003 14:10:35 -0000 1.9 @@ -2,7 +2,7 @@ $Id$ Copyright (C) 2001 Herbert Valerio Riedel <hv...@gn...> - Copyright (C) 2002 Rocky Bernstein <ro...@pa...> + Copyright (C) 2002,2003 Rocky Bernstein <ro...@pa...> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by Index: vcd_mpeg.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/vcdimager-0.7.12-rocky/libvcd/vcd_mpeg.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- vcd_mpeg.c 10 Jan 2003 15:47:24 -0000 1.2 +++ vcd_mpeg.c 19 Jan 2003 14:10:35 -0000 1.3 @@ -85,7 +85,7 @@ vcd_assert (vcd_bitvec_read_bit (buf, offset) == 1) #else # define MARKER(buf, offset) \ - { if (vcd_bitvec_read_bit (buf, offset) != 1) vcd_debug ("mpeg: some marker is not set..."); } + { if (GNUC_UNLIKELY (vcd_bitvec_read_bit (buf, offset) != 1)) vcd_debug ("mpeg: some marker is not set..."); } #endif static inline bool @@ -352,7 +352,7 @@ struct vcd_mpeg_scan_data_t *usdi = (void *) udg; vcd_assert (sizeof (struct vcd_mpeg_scan_data_t) == 14); - if (usdi->len != 14) + if (GNUC_UNLIKELY (usdi->len != 14)) { vcd_warn ("invalid user scan data length (%d != 14)", usdi->len); break; @@ -572,7 +572,7 @@ bitpos += 12; - if (!vcd_bitvec_read_bits (buf, &bitpos, 1)) + if (GNUC_UNLIKELY (!vcd_bitvec_read_bits (buf, &bitpos, 1))) { vcd_debug ("non-MPEG1 audio stream header seen"); break; Index: vcd_types.h =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/vcdimager-0.7.12-rocky/libvcd/vcd_types.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- vcd_types.h 10 Jan 2003 15:47:24 -0000 1.4 +++ vcd_types.h 19 Jan 2003 14:10:35 -0000 1.5 @@ -2,7 +2,7 @@ $Id$ Copyright (C) 2000 Herbert Valerio Riedel <hv...@gn...> - Copyright (C) 2002 Rocky Bernstein <ro...@pa...> + Copyright (C) 2002,2003 Rocky Bernstein <ro...@pa...> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -133,6 +133,16 @@ #define GNUC_PACKED #endif /* !__GNUC__ */ +/* user directed static branch prediction + */ +#if __GNUC__ == 2 && __GNUC_MINOR__ < 96 +# define GNUC_LIKELY(x) (x) +# define GNUC_UNLIKELY(x) (x) +#else /* supported with gcc 2.96+ */ +# define GNUC_LIKELY(x) __builtin_expect((x),true) +# define GNUC_UNLIKELY(x) __builtin_expect((x),false) +#endif + #ifndef NULL # define NULL ((void*) 0) #endif @@ -140,10 +150,8 @@ /* In many structures on the disk a sector address is stored as a BCD-encoded mmssff in three bytes. */ typedef struct { - uint8_t m GNUC_PACKED; - uint8_t s GNUC_PACKED; - uint8_t f GNUC_PACKED; -} msf_t; + uint8_t m, s, f; +} GNUC_PACKED msf_t; #define msf_t_SIZEOF 3 Index: vcdinfo.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/vcdimager-0.7.12-rocky/libvcd/vcdinfo.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- vcdinfo.c 18 Jan 2003 22:04:40 -0000 1.40 +++ vcdinfo.c 19 Jan 2003 14:10:35 -0000 1.41 @@ -56,6 +56,7 @@ #include <libvcd/vcd_image_cd.h> #include <libvcd/vcd_image_fs.h> #include <libvcd/vcd_xa.h> +#include <libvcd/vcd_cd_sector.h> /* Eventually move above libvcd includes but having vcdinfo including. */ #include "vcdinfo.h" @@ -217,7 +218,7 @@ "1 multi-channel stream (surround sound)", "error"}, }; - unsigned int first_index; + unsigned int first_index = 0; /* Get first index entry into above audio_type array from vcd_type */ switch (obj->vcd_type) { @@ -623,7 +624,7 @@ Get the VCD format (VCD 1.0 VCD 1.1, SVCD, ... for this object. The type is also set inside obj. */ -const vcd_type_t +vcd_type_t vcdinfo_get_format_version (vcdinfo_obj_t *obj) { obj->vcd_type = vcd_files_info_detect_type (&obj->info); Index: vcdinfo.h =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/vcdimager-0.7.12-rocky/libvcd/vcdinfo.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- vcdinfo.h 18 Jan 2003 22:04:40 -0000 1.37 +++ vcdinfo.h 19 Jan 2003 14:10:35 -0000 1.38 @@ -117,7 +117,7 @@ typedef enum { VCDINFO_SOURCE_UNDEF, /* none of the below, e.g. uninitialized */ - VCDINFO_SOURCE_AUTO, /* figure out withther a device or a flie */ + VCDINFO_SOURCE_AUTO, /* figure out whether a device or a flie */ VCDINFO_SOURCE_BIN, /* bin file; default is 2352 bytes */ VCDINFO_SOURCE_CUE, /* cue file */ VCDINFO_SOURCE_DEVICE, /* a device like /dev/cdrom */ @@ -128,11 +128,12 @@ { psd_descriptor_types descriptor_type; - union - { + /* Only one of pld or psd is used below. Not all + C compiler accept the anonymous unions commented out below. */ + /* union { */ PsdPlayListDescriptor *pld; PsdSelectionListDescriptor *psd; - }; + /* }; */ } PsdListDescriptor; @@ -277,6 +278,10 @@ /*! Return a string containing the default VCD device if none is specified. + This might be something like "/dev/cdrom" on Linux or + "/vol/dev/aliases/cdrom0" on Solaris, or maybe "VIDEOCD.CUE" for + if bin/cue I/O routines are in effect. + Return "" if we can't get this information. */ char * @@ -309,7 +314,7 @@ The type is also set inside obj. The first entry number is 0. */ -const vcd_type_t +vcd_type_t vcdinfo_get_format_version (vcdinfo_obj_t *obj); /*! |