summaryrefslogtreecommitdiff
path: root/multimedia
diff options
context:
space:
mode:
authorjmcneill <jmcneill>2011-07-15 22:59:20 +0000
committerjmcneill <jmcneill>2011-07-15 22:59:20 +0000
commit8b281b56693eb21a69d3cc0871f6e5788b06349a (patch)
tree8c91ccf3b41c4ee433e690cea500ceb54f49996d /multimedia
parent93079acff703e5a3cfe7b6e9315af11da52cb47a (diff)
downloadpkgsrc-8b281b56693eb21a69d3cc0871f6e5788b06349a.tar.gz
add the following to the dvb-apps build:
- libdvbapi - libucsi - atsc_epg - azap / czap / szap / tzap - dvbdate
Diffstat (limited to 'multimedia')
-rw-r--r--multimedia/dvb-apps/Makefile20
-rw-r--r--multimedia/dvb-apps/PLIST179
-rw-r--r--multimedia/dvb-apps/distinfo90
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbaudio.c26
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbca.c88
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbdemux.c16
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbfe.c16
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbnet.c56
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbvideo.c18
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_caption__service__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_cvct__section.c34
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_dccsct__section.c31
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_dcct__section.c48
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_eit__section.c26
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_ett__section.c13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_mgt__section.c37
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_service__location__descriptor.h21
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_stt__section.c16
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_time__shifted__service__descriptor.h15
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_tvct__section.c34
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__application__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__application__icons__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__external__application__authorisation__descriptor.h15
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_announcement__support__descriptor.h26
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_application__signalling__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_bat__section.c35
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ca__identifier__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cable__delivery__descriptor.h17
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cell__frequency__link__descriptor.h24
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cell__list__descriptor.h32
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_content__identifier__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_data__broadcast__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_data__broadcast__id__descriptor.h31
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_eit__section.c27
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_frequency__list__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_int__section.c33
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ip__mac__stream__location__descriptor.h19
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_linkage__descriptor.h52
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_mhp__data__broadcast__id__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_mosaic__descriptor.h60
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_nit__section.c35
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_nvod__reference__descriptor.h17
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_partial__transport__stream__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_pdc__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_private__data__specifier__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rnt__rar__over__dvb__stream__descriptor.h17
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rnt__rnt__scan__descriptor.h15
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rst__section.c19
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_satellite__delivery__descriptor.h17
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_sdt__section.c24
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__availability__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__list__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__move__descriptor.h17
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_sit__section.c26
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_subtitling__descriptor.h15
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_terrestrial__delivery__descriptor.h15
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_time__shifted__event__descriptor.h15
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_time__shifted__service__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_tot__section.c13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_tva__id__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_endianops.h94
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_ca__descriptor.h15
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_content__labelling__descriptor.h32
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_copyright__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_external__es__id__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_fmc__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_ibp__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_maximum__bitrate__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__descriptor.h30
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__pointer__descriptor.h49
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__std__descriptor.h17
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_multiplex__buffer__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_multiplex__buffer__utilization__descriptor.h15
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_odsmt__section.c22
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_pat__section.c15
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_pmt__section.c27
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_private__data__indicator__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_registration__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_sl__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_smoothing__buffer__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_target__background__grid__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_video__window__descriptor.h13
-rw-r--r--multimedia/dvb-apps/patches/patch-lib_libucsi_section.h60
-rw-r--r--multimedia/dvb-apps/patches/patch-util_atsc__epg_Makefile17
-rw-r--r--multimedia/dvb-apps/patches/patch-util_dvbdate_Makefile13
-rw-r--r--multimedia/dvb-apps/patches/patch-util_dvbdate_dvbdate.c17
-rw-r--r--multimedia/dvb-apps/patches/patch-util_szap_azap.c17
-rw-r--r--multimedia/dvb-apps/patches/patch-util_szap_czap.c17
-rw-r--r--multimedia/dvb-apps/patches/patch-util_szap_szap.c29
-rw-r--r--multimedia/dvb-apps/patches/patch-util_szap_tzap.c21
-rw-r--r--multimedia/dvb-apps/patches/patch-util_szap_util.c17
91 files changed, 2284 insertions, 4 deletions
diff --git a/multimedia/dvb-apps/Makefile b/multimedia/dvb-apps/Makefile
index 08321622442..91b88719505 100644
--- a/multimedia/dvb-apps/Makefile
+++ b/multimedia/dvb-apps/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.1.1.1 2011/07/13 23:42:16 jmcneill Exp $
+# $NetBSD: Makefile,v 1.2 2011/07/15 22:59:20 jmcneill Exp $
#
PKGNAME= dvb-apps-20110713
+PKGREVISION= 1
DISTNAME= 148ede2a6809
DIST_SUBDIR= dvb-apps
CATEGORIES= multimedia
@@ -18,10 +19,25 @@ USE_TOOLS+= gmake perl
WRKSRC= ${WRKDIR}/dvb-apps-148ede2a6809
do-build:
- cd ${WRKSRC}/util/scan && gmake
+ cd ${WRKSRC}/lib/libdvbapi && gmake prefix=${PREFIX}
+ cd ${WRKSRC}/lib/libucsi && gmake prefix=${PREFIX}
+ cd ${WRKSRC}/util/atsc_epg&& gmake prefix=${PREFIX}
+ cd ${WRKSRC}/util/dvbdate && gmake prefix=${PREFIX}
+ cd ${WRKSRC}/util/scan && gmake prefix=${PREFIX}
+ cd ${WRKSRC}/util/szap && gmake prefix=${PREFIX}
do-install:
+ cd ${WRKSRC}/lib/libdvbapi && \
+ gmake DESTDIR=${DESTDIR} prefix=${PREFIX} install
+ cd ${WRKSRC}/lib/libucsi && \
+ gmake DESTDIR=${DESTDIR} prefix=${PREFIX} install
+ cd ${WRKSRC}/util/atsc_epg && \
+ gmake DESTDIR=${DESTDIR} prefix=${PREFIX} install
+ cd ${WRKSRC}/util/dvbdate && \
+ gmake DESTDIR=${DESTDIR} prefix=${PREFIX} install
cd ${WRKSRC}/util/scan && \
gmake DESTDIR=${DESTDIR} prefix=${PREFIX} install
+ cd ${WRKSRC}/util/szap && \
+ gmake DESTDIR=${DESTDIR} prefix=${PREFIX} install
.include "../../mk/bsd.pkg.mk"
diff --git a/multimedia/dvb-apps/PLIST b/multimedia/dvb-apps/PLIST
index db4f346fbf7..d637ba81291 100644
--- a/multimedia/dvb-apps/PLIST
+++ b/multimedia/dvb-apps/PLIST
@@ -1,5 +1,182 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2011/07/13 23:42:16 jmcneill Exp $
+@comment $NetBSD: PLIST,v 1.2 2011/07/15 22:59:20 jmcneill Exp $
+bin/atsc_epg
+bin/azap
+bin/czap
+bin/dvbdate
bin/scan
+bin/szap
+bin/tzap
+include/libdvbapi/dvbaudio.h
+include/libdvbapi/dvbca.h
+include/libdvbapi/dvbdemux.h
+include/libdvbapi/dvbfe.h
+include/libdvbapi/dvbnet.h
+include/libdvbapi/dvbvideo.h
+include/libucsi/atsc/ac3_descriptor.h
+include/libucsi/atsc/caption_service_descriptor.h
+include/libucsi/atsc/component_name_descriptor.h
+include/libucsi/atsc/content_advisory_descriptor.h
+include/libucsi/atsc/cvct_section.h
+include/libucsi/atsc/dcc_arriving_request_descriptor.h
+include/libucsi/atsc/dcc_departing_request_descriptor.h
+include/libucsi/atsc/dccsct_section.h
+include/libucsi/atsc/dcct_section.h
+include/libucsi/atsc/descriptor.h
+include/libucsi/atsc/eit_section.h
+include/libucsi/atsc/ett_section.h
+include/libucsi/atsc/extended_channel_name_descriptor.h
+include/libucsi/atsc/genre_descriptor.h
+include/libucsi/atsc/mgt_section.h
+include/libucsi/atsc/rc_descriptor.h
+include/libucsi/atsc/rrt_section.h
+include/libucsi/atsc/section.h
+include/libucsi/atsc/service_location_descriptor.h
+include/libucsi/atsc/stt_section.h
+include/libucsi/atsc/stuffing_descriptor.h
+include/libucsi/atsc/time_shifted_service_descriptor.h
+include/libucsi/atsc/tvct_section.h
+include/libucsi/atsc/types.h
+include/libucsi/crc32.h
+include/libucsi/descriptor.h
+include/libucsi/dvb/ac3_descriptor.h
+include/libucsi/dvb/adaptation_field_data_descriptor.h
+include/libucsi/dvb/ait_application_descriptor.h
+include/libucsi/dvb/ait_application_icons_descriptor.h
+include/libucsi/dvb/ait_application_name_descriptor.h
+include/libucsi/dvb/ait_external_application_authorisation_descriptor.h
+include/libucsi/dvb/ancillary_data_descriptor.h
+include/libucsi/dvb/announcement_support_descriptor.h
+include/libucsi/dvb/application_signalling_descriptor.h
+include/libucsi/dvb/bat_section.h
+include/libucsi/dvb/bouquet_name_descriptor.h
+include/libucsi/dvb/ca_identifier_descriptor.h
+include/libucsi/dvb/cable_delivery_descriptor.h
+include/libucsi/dvb/cell_frequency_link_descriptor.h
+include/libucsi/dvb/cell_list_descriptor.h
+include/libucsi/dvb/component_descriptor.h
+include/libucsi/dvb/content_descriptor.h
+include/libucsi/dvb/content_identifier_descriptor.h
+include/libucsi/dvb/country_availability_descriptor.h
+include/libucsi/dvb/data_broadcast_descriptor.h
+include/libucsi/dvb/data_broadcast_id_descriptor.h
+include/libucsi/dvb/default_authority_descriptor.h
+include/libucsi/dvb/descriptor.h
+include/libucsi/dvb/dit_section.h
+include/libucsi/dvb/dsng_descriptor.h
+include/libucsi/dvb/eit_section.h
+include/libucsi/dvb/extended_event_descriptor.h
+include/libucsi/dvb/frequency_list_descriptor.h
+include/libucsi/dvb/int_section.h
+include/libucsi/dvb/ip_mac_platform_name_descriptor.h
+include/libucsi/dvb/ip_mac_platform_provider_name_descriptor.h
+include/libucsi/dvb/ip_mac_stream_location_descriptor.h
+include/libucsi/dvb/linkage_descriptor.h
+include/libucsi/dvb/local_time_offset_descriptor.h
+include/libucsi/dvb/mhp_data_broadcast_id_descriptor.h
+include/libucsi/dvb/mosaic_descriptor.h
+include/libucsi/dvb/mpe_fec_section.h
+include/libucsi/dvb/multilingual_bouquet_name_descriptor.h
+include/libucsi/dvb/multilingual_component_descriptor.h
+include/libucsi/dvb/multilingual_network_name_descriptor.h
+include/libucsi/dvb/multilingual_service_name_descriptor.h
+include/libucsi/dvb/network_name_descriptor.h
+include/libucsi/dvb/nit_section.h
+include/libucsi/dvb/nvod_reference_descriptor.h
+include/libucsi/dvb/parental_rating_descriptor.h
+include/libucsi/dvb/partial_transport_stream_descriptor.h
+include/libucsi/dvb/pdc_descriptor.h
+include/libucsi/dvb/private_data_specifier_descriptor.h
+include/libucsi/dvb/related_content_descriptor.h
+include/libucsi/dvb/rnt_rar_over_dvb_stream_descriptor.h
+include/libucsi/dvb/rnt_rar_over_ip_descriptor.h
+include/libucsi/dvb/rnt_rnt_scan_descriptor.h
+include/libucsi/dvb/rst_section.h
+include/libucsi/dvb/s2_satellite_delivery_descriptor.h
+include/libucsi/dvb/satellite_delivery_descriptor.h
+include/libucsi/dvb/scrambling_descriptor.h
+include/libucsi/dvb/sdt_section.h
+include/libucsi/dvb/section.h
+include/libucsi/dvb/service_availability_descriptor.h
+include/libucsi/dvb/service_descriptor.h
+include/libucsi/dvb/service_identifier_descriptor.h
+include/libucsi/dvb/service_list_descriptor.h
+include/libucsi/dvb/service_move_descriptor.h
+include/libucsi/dvb/short_event_descriptor.h
+include/libucsi/dvb/short_smoothing_buffer_descriptor.h
+include/libucsi/dvb/sit_section.h
+include/libucsi/dvb/st_section.h
+include/libucsi/dvb/stream_identifier_descriptor.h
+include/libucsi/dvb/stuffing_descriptor.h
+include/libucsi/dvb/subtitling_descriptor.h
+include/libucsi/dvb/target_ip_address_descriptor.h
+include/libucsi/dvb/target_ip_slash_descriptor.h
+include/libucsi/dvb/target_ip_source_slash_descriptor.h
+include/libucsi/dvb/target_ipv6_address_descriptor.h
+include/libucsi/dvb/target_ipv6_slash_descriptor.h
+include/libucsi/dvb/target_ipv6_source_slash_descriptor.h
+include/libucsi/dvb/tdt_section.h
+include/libucsi/dvb/telephone_descriptor.h
+include/libucsi/dvb/teletext_descriptor.h
+include/libucsi/dvb/terrestrial_delivery_descriptor.h
+include/libucsi/dvb/time_shifted_event_descriptor.h
+include/libucsi/dvb/time_shifted_service_descriptor.h
+include/libucsi/dvb/time_slice_fec_identifier_descriptor.h
+include/libucsi/dvb/tot_section.h
+include/libucsi/dvb/transport_stream_descriptor.h
+include/libucsi/dvb/tva_container_section.h
+include/libucsi/dvb/tva_id_descriptor.h
+include/libucsi/dvb/types.h
+include/libucsi/dvb/vbi_data_descriptor.h
+include/libucsi/dvb/vbi_teletext_descriptor.h
+include/libucsi/endianops.h
+include/libucsi/mpeg/audio_stream_descriptor.h
+include/libucsi/mpeg/ca_descriptor.h
+include/libucsi/mpeg/cat_section.h
+include/libucsi/mpeg/content_labelling_descriptor.h
+include/libucsi/mpeg/copyright_descriptor.h
+include/libucsi/mpeg/data_stream_alignment_descriptor.h
+include/libucsi/mpeg/datagram_section.h
+include/libucsi/mpeg/descriptor.h
+include/libucsi/mpeg/external_es_id_descriptor.h
+include/libucsi/mpeg/fmc_descriptor.h
+include/libucsi/mpeg/fmxbuffer_size_descriptor.h
+include/libucsi/mpeg/hierarchy_descriptor.h
+include/libucsi/mpeg/ibp_descriptor.h
+include/libucsi/mpeg/iod_descriptor.h
+include/libucsi/mpeg/iso_639_language_descriptor.h
+include/libucsi/mpeg/maximum_bitrate_descriptor.h
+include/libucsi/mpeg/metadata_descriptor.h
+include/libucsi/mpeg/metadata_pointer_descriptor.h
+include/libucsi/mpeg/metadata_section.h
+include/libucsi/mpeg/metadata_std_descriptor.h
+include/libucsi/mpeg/mpeg4_audio_descriptor.h
+include/libucsi/mpeg/mpeg4_video_descriptor.h
+include/libucsi/mpeg/multiplex_buffer_descriptor.h
+include/libucsi/mpeg/multiplex_buffer_utilization_descriptor.h
+include/libucsi/mpeg/muxcode_descriptor.h
+include/libucsi/mpeg/odsmt_section.h
+include/libucsi/mpeg/pat_section.h
+include/libucsi/mpeg/pmt_section.h
+include/libucsi/mpeg/private_data_indicator_descriptor.h
+include/libucsi/mpeg/registration_descriptor.h
+include/libucsi/mpeg/section.h
+include/libucsi/mpeg/sl_descriptor.h
+include/libucsi/mpeg/smoothing_buffer_descriptor.h
+include/libucsi/mpeg/std_descriptor.h
+include/libucsi/mpeg/system_clock_descriptor.h
+include/libucsi/mpeg/target_background_grid_descriptor.h
+include/libucsi/mpeg/tsdt_section.h
+include/libucsi/mpeg/types.h
+include/libucsi/mpeg/video_stream_descriptor.h
+include/libucsi/mpeg/video_window_descriptor.h
+include/libucsi/section.h
+include/libucsi/section_buf.h
+include/libucsi/transport_packet.h
+include/libucsi/types.h
+lib/libdvbapi.a
+lib/libdvbapi.so
+lib/libucsi.a
+lib/libucsi.so
share/dvb/atsc/ca-AB-Calgary
share/dvb/atsc/us-ATSC-center-frequencies-8VSB
share/dvb/atsc/us-CA-SF-Bay-Area
diff --git a/multimedia/dvb-apps/distinfo b/multimedia/dvb-apps/distinfo
index 2e5b3fc49ff..0cdea79a673 100644
--- a/multimedia/dvb-apps/distinfo
+++ b/multimedia/dvb-apps/distinfo
@@ -1,8 +1,91 @@
-$NetBSD: distinfo,v 1.1.1.1 2011/07/13 23:42:16 jmcneill Exp $
+$NetBSD: distinfo,v 1.2 2011/07/15 22:59:20 jmcneill Exp $
SHA1 (dvb-apps/148ede2a6809.tar.gz) = 1d7b7713cce5a2a1db4a5639789140b5c3ba272f
RMD160 (dvb-apps/148ede2a6809.tar.gz) = b024e3fa143d4b89ce842aeb799217f48c0df58a
Size (dvb-apps/148ede2a6809.tar.gz) = 516680 bytes
+SHA1 (patch-lib_libdvbapi_dvbaudio.c) = 9f6ce96ac66a505ae535e59af04ea3aff6749147
+SHA1 (patch-lib_libdvbapi_dvbca.c) = fb634395e1f9d0e3dc42f60bdf6d581fc11312ca
+SHA1 (patch-lib_libdvbapi_dvbdemux.c) = 60f7c927878f0923a355a329b93afe30a2f335d0
+SHA1 (patch-lib_libdvbapi_dvbfe.c) = 44ee918a5c09aa1947c0f5d9c6148607e67b75bb
+SHA1 (patch-lib_libdvbapi_dvbnet.c) = cee386a3535c676de3a3062c2f9098816b828120
+SHA1 (patch-lib_libdvbapi_dvbvideo.c) = fdbb9a3a899ef0f5cc78a897c69e1678f64e1a0d
+SHA1 (patch-lib_libucsi_atsc_caption__service__descriptor.h) = 65abe88270e298dc728e7d4409860744a2ea593d
+SHA1 (patch-lib_libucsi_atsc_cvct__section.c) = 796d37b4b1e55b19ef40579d9492365dd23e54ff
+SHA1 (patch-lib_libucsi_atsc_dccsct__section.c) = da8327a47cdf9d27c03ac5fe98dff6848646bef7
+SHA1 (patch-lib_libucsi_atsc_dcct__section.c) = 46331e68633e430466c46b086dc12d6c0e585385
+SHA1 (patch-lib_libucsi_atsc_eit__section.c) = b6bb014d27cbf5e0ffa22c6036fe3db0b9338022
+SHA1 (patch-lib_libucsi_atsc_ett__section.c) = e47693a38fcbb4a623922d5ac2595ffcd4cb74ed
+SHA1 (patch-lib_libucsi_atsc_mgt__section.c) = edf2a13657fb004db415d4e69aa05cb92768f38a
+SHA1 (patch-lib_libucsi_atsc_service__location__descriptor.h) = 8a7c2d16ba35cb1249906f5afd7548269c44269e
+SHA1 (patch-lib_libucsi_atsc_stt__section.c) = 001f88e6e6d0265760c8c418e6c45311947ca2c2
+SHA1 (patch-lib_libucsi_atsc_time__shifted__service__descriptor.h) = 8ff522f574251abebc67bdc5c0f1db246a33b3d3
+SHA1 (patch-lib_libucsi_atsc_tvct__section.c) = ac4a9b9aed7f403d931e6ffddc815cdecf601497
+SHA1 (patch-lib_libucsi_dvb_ait__application__descriptor.h) = b9242fef5bc2ee004d9a80cc5380c95c6eed3d30
+SHA1 (patch-lib_libucsi_dvb_ait__application__icons__descriptor.h) = 7046c6dd7f24f93207237db4c1b52e8001075d35
+SHA1 (patch-lib_libucsi_dvb_ait__external__application__authorisation__descriptor.h) = 899734acb024caa7c28e9f53a2db261e792d95ed
+SHA1 (patch-lib_libucsi_dvb_announcement__support__descriptor.h) = 64da8c3bc71a45659266eb60d3f3078b8da589af
+SHA1 (patch-lib_libucsi_dvb_application__signalling__descriptor.h) = f427795d3239eafcc28d5c3625383a01d3af436b
+SHA1 (patch-lib_libucsi_dvb_bat__section.c) = 93a13b4faa18384897f67f6cdc91459a3e702496
+SHA1 (patch-lib_libucsi_dvb_ca__identifier__descriptor.h) = 3ba7641686b206986ab63b1a5d22a2f3ea66b2e0
+SHA1 (patch-lib_libucsi_dvb_cable__delivery__descriptor.h) = 5e4373fdb998f709739c8b1896f0083c712c9201
+SHA1 (patch-lib_libucsi_dvb_cell__frequency__link__descriptor.h) = 12381b0cd52c37fd2c4404d2cdf26a13dbe668bd
+SHA1 (patch-lib_libucsi_dvb_cell__list__descriptor.h) = ae5b23d76fc9b95a40274bae36bbf642f4e91463
+SHA1 (patch-lib_libucsi_dvb_content__identifier__descriptor.h) = 4ad261afacd33bd5276335fc4c1c9878db659331
+SHA1 (patch-lib_libucsi_dvb_data__broadcast__descriptor.h) = 34e84c8604df56bcfb3e2e3923b18252ea96425c
+SHA1 (patch-lib_libucsi_dvb_data__broadcast__id__descriptor.h) = 60ed410244e1bc396344ea852809b24e0bdf4b2b
+SHA1 (patch-lib_libucsi_dvb_eit__section.c) = fd7f415fc00631578fd3d6bb91a321e5d463d6e9
+SHA1 (patch-lib_libucsi_dvb_frequency__list__descriptor.h) = 60eedf2fac2bc03e12724160b88af2180d5b6243
+SHA1 (patch-lib_libucsi_dvb_int__section.c) = a52ce4328b742854ed408e2bd18b37ff50e56c37
+SHA1 (patch-lib_libucsi_dvb_ip__mac__stream__location__descriptor.h) = e85989b902c0ce40d2065fc12a0b8da8b1b7c104
+SHA1 (patch-lib_libucsi_dvb_linkage__descriptor.h) = d9912c3593ee5dddc3a84d495113d730aff17698
+SHA1 (patch-lib_libucsi_dvb_mhp__data__broadcast__id__descriptor.h) = 06d615f06942c64228c6e2d58b6d935cfbbd7d40
+SHA1 (patch-lib_libucsi_dvb_mosaic__descriptor.h) = 6ff55e9970b990a6059b447e161abcb875b9ffb2
+SHA1 (patch-lib_libucsi_dvb_nit__section.c) = 8af79ce6c3d032e52f7376a619d6e1d55810b8b2
+SHA1 (patch-lib_libucsi_dvb_nvod__reference__descriptor.h) = 6374a1fb4c481b74dcb83b5c35f4fee7db654fd6
+SHA1 (patch-lib_libucsi_dvb_partial__transport__stream__descriptor.h) = 5ff7b0a9324f336a23743c2a09b6de94d4ebb674
+SHA1 (patch-lib_libucsi_dvb_pdc__descriptor.h) = 0a128836502682b65a2e266e6c348854cdcfea31
+SHA1 (patch-lib_libucsi_dvb_private__data__specifier__descriptor.h) = ed27342e9ddc5cc44d9273f28af1290c31600ea7
+SHA1 (patch-lib_libucsi_dvb_rnt__rar__over__dvb__stream__descriptor.h) = 6263626a0bdaabc28740f39fb50149aa20f83fe0
+SHA1 (patch-lib_libucsi_dvb_rnt__rnt__scan__descriptor.h) = c77e8c2f2f2c715a364e7fa4f53f3fef3c5a406a
+SHA1 (patch-lib_libucsi_dvb_rst__section.c) = 80fb77dc592020553b8faf864dcae89ddf76ea11
+SHA1 (patch-lib_libucsi_dvb_satellite__delivery__descriptor.h) = 3a60a553329f18d593d68aec160d59e512329277
+SHA1 (patch-lib_libucsi_dvb_sdt__section.c) = 46902f7859fe3b84cf186f2f82fe455ba942603c
+SHA1 (patch-lib_libucsi_dvb_service__availability__descriptor.h) = f764b919b51c197a3a59484620314701750d1777
+SHA1 (patch-lib_libucsi_dvb_service__list__descriptor.h) = d4ddff67374a8fe0e2a85bcd1c10613a04ec18e1
+SHA1 (patch-lib_libucsi_dvb_service__move__descriptor.h) = 9b373fc990db796ba9aae2a5cca32ff0d5d721d2
+SHA1 (patch-lib_libucsi_dvb_sit__section.c) = ca31ea1fb03d5d72109b3bfd0abdfa936f93bf64
+SHA1 (patch-lib_libucsi_dvb_subtitling__descriptor.h) = ed992e46477e0825dc5fabec531729367f8c3a8f
+SHA1 (patch-lib_libucsi_dvb_terrestrial__delivery__descriptor.h) = 655ba1ad362d92eeb1e239eb3d3c2fe0abab5025
+SHA1 (patch-lib_libucsi_dvb_time__shifted__event__descriptor.h) = 444b5fa3ef5ad4190122a31d054363f6b1e1407e
+SHA1 (patch-lib_libucsi_dvb_time__shifted__service__descriptor.h) = 53a053696d158a349bea9e269df47158b9ed7738
+SHA1 (patch-lib_libucsi_dvb_tot__section.c) = b250647e6c1934d9cc93ce9156535cb7acad09f2
+SHA1 (patch-lib_libucsi_dvb_tva__id__descriptor.h) = 89d5855a5fee19474e55ca74e4a7fc1ee115f6fe
+SHA1 (patch-lib_libucsi_endianops.h) = 91b0dd87b99e9c87df681b6ab94ab153fe7b14e4
+SHA1 (patch-lib_libucsi_mpeg_ca__descriptor.h) = fb557f6495ed0a5108c29214a6f274691f28ebf0
+SHA1 (patch-lib_libucsi_mpeg_content__labelling__descriptor.h) = 25ef9d51a6e484f6b9f08350f12d0ade896d52a5
+SHA1 (patch-lib_libucsi_mpeg_copyright__descriptor.h) = b23341d75f6f44db0e7b3fc94c3596968636f2fe
+SHA1 (patch-lib_libucsi_mpeg_external__es__id__descriptor.h) = 58603359208835bba24cd69d7b92b648e0d596ce
+SHA1 (patch-lib_libucsi_mpeg_fmc__descriptor.h) = cf2f55001d608619d9008330e2c1ce37fb10a6cb
+SHA1 (patch-lib_libucsi_mpeg_ibp__descriptor.h) = aacecadd8ab0d73dda76fcaa1ecca9c7d5c59cdc
+SHA1 (patch-lib_libucsi_mpeg_maximum__bitrate__descriptor.h) = 57c2993e1f926ec2d4a89c5b6843dfa08c41677d
+SHA1 (patch-lib_libucsi_mpeg_metadata__descriptor.h) = 6776a00e94dbd34b1552fb4a62eed5fe2eb099ab
+SHA1 (patch-lib_libucsi_mpeg_metadata__pointer__descriptor.h) = 9bb0d0b79f3740ece2e494fd9a1f8acd7be92989
+SHA1 (patch-lib_libucsi_mpeg_metadata__std__descriptor.h) = 00308be4c49d0c238c32d9cc181f38a51cd5c752
+SHA1 (patch-lib_libucsi_mpeg_multiplex__buffer__descriptor.h) = a6ea0b20351c336965c504830e17eb02ed7c57d7
+SHA1 (patch-lib_libucsi_mpeg_multiplex__buffer__utilization__descriptor.h) = 96182d68a27bdfaeb3d94343a01adbabd0abf6ad
+SHA1 (patch-lib_libucsi_mpeg_odsmt__section.c) = 06d12a9e10f6c9277a6a2397c7a92a78c5d5088a
+SHA1 (patch-lib_libucsi_mpeg_pat__section.c) = 5c8757147d6df965ec6bed1b99a395ebe1b10d5b
+SHA1 (patch-lib_libucsi_mpeg_pmt__section.c) = 59d5487fba62b5e1e580581e2034a528b81432e7
+SHA1 (patch-lib_libucsi_mpeg_private__data__indicator__descriptor.h) = b88931ac8f6bd4df0b49a1a340ae97f6eaccf0bd
+SHA1 (patch-lib_libucsi_mpeg_registration__descriptor.h) = 6d5fa1ec8e89f4b90e1638aee6aab75eebec74fa
+SHA1 (patch-lib_libucsi_mpeg_sl__descriptor.h) = 1a57c635d3e86f7647b95548f12b48287d3868b9
+SHA1 (patch-lib_libucsi_mpeg_smoothing__buffer__descriptor.h) = 1e410488c5ff384d3bb60c78acbb627b83aa07cd
+SHA1 (patch-lib_libucsi_mpeg_target__background__grid__descriptor.h) = 4a952a91af8e668ae68e196cf98549393fc56081
+SHA1 (patch-lib_libucsi_mpeg_video__window__descriptor.h) = ef556b48541a88096349f6a8da5dc2e18ee03604
+SHA1 (patch-lib_libucsi_section.h) = 07478dd172f576a31185fc6dda871a55885d796f
+SHA1 (patch-util_atsc__epg_Makefile) = f07b266b5fae463662fc1edda0893cf932657b84
+SHA1 (patch-util_dvbdate_Makefile) = 9c6bbc5554418d5f414d2bb30c077e556f143c4a
+SHA1 (patch-util_dvbdate_dvbdate.c) = e8a855866c52de845ac7daf3c7c22280bb710a22
SHA1 (patch-util_scan_diseqc.c) = 048e7e3dac5e8f096e926bdb971257f263f8cd01
SHA1 (patch-util_scan_diseqc.h) = 2dc00e508282fd7fc73e0b94556eff7bbd54332b
SHA1 (patch-util_scan_dump-vdr.c) = 82f89c3a687744632d59df53d788df92c4d678f3
@@ -11,3 +94,8 @@ SHA1 (patch-util_scan_dump-zap.c) = fea36c5447734fba91ec0f1b4aa9f6e32e59e158
SHA1 (patch-util_scan_dump-zap.h) = 238f11ca1b8b75910391f62397a9ae824fa2ad28
SHA1 (patch-util_scan_lnb.c) = 34592aef076e6b508a0a22d70af69029388a1946
SHA1 (patch-util_scan_scan.c) = b327a1740b80d7a7c659c1a8566543e532909044
+SHA1 (patch-util_szap_azap.c) = 10ded4959a24a11c2196dc12a1ecb58a8b6b81b5
+SHA1 (patch-util_szap_czap.c) = 06a2f9a3fd6019ee6a843e5072cd08521f7803a7
+SHA1 (patch-util_szap_szap.c) = ce8c992c227f0051bf7a72da031ed824d4caaee2
+SHA1 (patch-util_szap_tzap.c) = 6706ea1161617022b7f769ff2555b595fd456e84
+SHA1 (patch-util_szap_util.c) = 2d4026edd77096aa02d898b4449a22841962bbf1
diff --git a/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbaudio.c b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbaudio.c
new file mode 100644
index 00000000000..7a89ab2e7ec
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbaudio.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-lib_libdvbapi_dvbaudio.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libdvbapi/dvbaudio.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libdvbapi/dvbaudio.c
+@@ -25,7 +25,11 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <sys/ioctl.h>
++#ifdef __NetBSD__
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/dvb/audio.h>
++#endif
+ #include <errno.h>
+ #include "dvbaudio.h"
+
+@@ -46,5 +50,9 @@ int dvbaudio_open(int adapter, int audio
+
+ int dvbaudio_set_bypass(int fd, int bypass)
+ {
++#ifdef AUDIO_SET_BYPASS_MODE
+ return ioctl(fd, AUDIO_SET_BYPASS_MODE, bypass);
++#else
++ return -1;
++#endif
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbca.c b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbca.c
new file mode 100644
index 00000000000..f98e2a9a56c
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbca.c
@@ -0,0 +1,88 @@
+$NetBSD: patch-lib_libdvbapi_dvbca.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libdvbapi/dvbca.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libdvbapi/dvbca.c
+@@ -27,7 +27,11 @@
+ #include <unistd.h>
+ #include <ctype.h>
+ #include <errno.h>
++#ifdef __NetBSD__
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/dvb/ca.h>
++#endif
+ #include "dvbca.h"
+
+
+@@ -48,11 +52,16 @@ int dvbca_open(int adapter, int cadevice
+
+ int dvbca_reset(int fd, uint8_t slot)
+ {
++#ifdef CA_RESET
+ return ioctl(fd, CA_RESET, (1 << slot));
++#else
++ return -1;
++#endif
+ }
+
+ int dvbca_get_interface_type(int fd, uint8_t slot)
+ {
++#ifdef CA_GET_SLOT_INFO
+ ca_slot_info_t info;
+
+ info.num = slot;
+@@ -63,12 +72,14 @@ int dvbca_get_interface_type(int fd, uin
+ return DVBCA_INTERFACE_LINK;
+ if (info.type & CA_CI)
+ return DVBCA_INTERFACE_HLCI;
++#endif
+
+ return -1;
+ }
+
+ int dvbca_get_cam_state(int fd, uint8_t slot)
+ {
++#ifdef CA_GET_SLOT_INFO
+ ca_slot_info_t info;
+
+ info.num = slot;
+@@ -81,6 +92,7 @@ int dvbca_get_cam_state(int fd, uint8_t
+ return DVBCA_CAMSTATE_READY;
+ if (info.flags & CA_CI_MODULE_PRESENT)
+ return DVBCA_CAMSTATE_INITIALISING;
++#endif
+
+ return -1;
+ }
+@@ -123,6 +135,7 @@ int dvbca_link_read(int fd, uint8_t *slo
+
+ int dvbca_hlci_write(int fd, uint8_t *data, uint16_t data_length)
+ {
++#ifdef CA_SEND_MSG
+ struct ca_msg msg;
+
+ if (data_length > 256) {
+@@ -134,11 +147,15 @@ int dvbca_hlci_write(int fd, uint8_t *da
+ memcpy(msg.msg, data, data_length);
+
+ return ioctl(fd, CA_SEND_MSG, &msg);
++#else
++ return -1;
++#endif
+ }
+
+ int dvbca_hlci_read(int fd, uint32_t app_tag, uint8_t *data,
+ uint16_t data_length)
+ {
++#ifdef CA_GET_MSG
+ struct ca_msg msg;
+
+ if (data_length > 256) {
+@@ -156,4 +173,7 @@ int dvbca_hlci_read(int fd, uint32_t app
+ if (msg.length > data_length) msg.length = data_length;
+ memcpy(data, msg.msg, msg.length);
+ return msg.length;
++#else
++ return -1;
++#endif
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbdemux.c b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbdemux.c
new file mode 100644
index 00000000000..97bf988e4f3
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbdemux.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-lib_libdvbapi_dvbdemux.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libdvbapi/dvbdemux.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libdvbapi/dvbdemux.c
+@@ -27,7 +27,11 @@
+ #include <unistd.h>
+ #include <ctype.h>
+ #include <errno.h>
++#ifdef __NetBSD__
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/dvb/dmx.h>
++#endif
+ #include "dvbdemux.h"
+
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbfe.c b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbfe.c
new file mode 100644
index 00000000000..209370826bf
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbfe.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-lib_libdvbapi_dvbfe.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libdvbapi/dvbfe.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libdvbapi/dvbfe.c
+@@ -32,7 +32,11 @@
+ #include <unistd.h>
+ #include <ctype.h>
+ #include <errno.h>
++#ifdef __NetBSD__
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/dvb/frontend.h>
++#endif
+ #include <libdvbmisc/dvbmisc.h>
+ #include "dvbfe.h"
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbnet.c b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbnet.c
new file mode 100644
index 00000000000..2a25df22f55
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbnet.c
@@ -0,0 +1,56 @@
+$NetBSD: patch-lib_libdvbapi_dvbnet.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libdvbapi/dvbnet.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libdvbapi/dvbnet.c
+@@ -25,7 +25,11 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <sys/ioctl.h>
++#ifdef __NetBSD__
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/dvb/net.h>
++#endif
+ #include <errno.h>
+ #include "dvbnet.h"
+
+@@ -46,6 +50,7 @@ int dvbnet_open(int adapter, int netdevi
+
+ int dvbnet_add_interface(int fd, uint16_t pid, enum dvbnet_encap encapsulation)
+ {
++#ifdef NET_ADD_IF
+ struct dvb_net_if params;
+ int status;
+
+@@ -69,10 +74,14 @@ int dvbnet_add_interface(int fd, uint16_
+ if (status < 0)
+ return status;
+ return params.if_num;
++#else
++ return -1;
++#endif
+ }
+
+ int dvbnet_get_interface(int fd, int ifnum, uint16_t *pid, enum dvbnet_encap *encapsulation)
+ {
++#ifdef NET_GET_IF
+ struct dvb_net_if info;
+ int res;
+
+@@ -96,9 +105,16 @@ int dvbnet_get_interface(int fd, int ifn
+ return -EINVAL;
+ }
+ return 0;
++#else
++ return -1;
++#endif
+ }
+
+ int dvbnet_remove_interface(int fd, int ifnum)
+ {
++#ifdef NET_REMOVE_IF
+ return ioctl(fd, NET_REMOVE_IF, ifnum);
++#else
++ return -1;
++#endif
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbvideo.c b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbvideo.c
new file mode 100644
index 00000000000..f3a8efd839c
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libdvbapi_dvbvideo.c
@@ -0,0 +1,18 @@
+$NetBSD: patch-lib_libdvbapi_dvbvideo.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libdvbapi/dvbvideo.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libdvbapi/dvbvideo.c
+@@ -25,8 +25,13 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <sys/ioctl.h>
++#ifdef __NetBSD__
++#include <sys/types.h>
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/types.h>
+ #include <linux/dvb/video.h>
++#endif
+ #include <errno.h>
+ #include "dvbvideo.h"
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_caption__service__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_caption__service__descriptor.h
new file mode 100644
index 00000000000..c4db88f6ded
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_caption__service__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_atsc_caption__service__descriptor.h,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/caption_service_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/caption_service_descriptor.h
+@@ -78,7 +78,7 @@ static inline struct atsc_caption_servic
+ if (d->len < (pos + sizeof(struct atsc_caption_service_entry)))
+ return NULL;
+
+- bswap16(buf+pos+4);
++ ubswap16(buf+pos+4);
+
+ pos += sizeof(struct atsc_caption_service_entry);
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_cvct__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_cvct__section.c
new file mode 100644
index 00000000000..6cccdda6057
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_cvct__section.c
@@ -0,0 +1,34 @@
+$NetBSD: patch-lib_libucsi_atsc_cvct__section.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/cvct_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/cvct_section.c
+@@ -40,13 +40,13 @@ struct atsc_cvct_section *atsc_cvct_sect
+
+ pos += 7*2;
+
+- bswap32(buf+pos);
+- bswap32(buf+pos+4);
+- bswap16(buf+pos+8);
+- bswap16(buf+pos+10);
+- bswap16(buf+pos+12);
+- bswap16(buf+pos+14);
+- bswap16(buf+pos+16);
++ ubswap32(buf+pos);
++ ubswap32(buf+pos+4);
++ ubswap16(buf+pos+8);
++ ubswap16(buf+pos+10);
++ ubswap16(buf+pos+12);
++ ubswap16(buf+pos+14);
++ ubswap16(buf+pos+16);
+ pos+=18;
+
+ if ((pos + channel->descriptors_length) > len)
+@@ -61,7 +61,7 @@ struct atsc_cvct_section *atsc_cvct_sect
+ return NULL;
+ struct atsc_cvct_section_part2 *part2 = (struct atsc_cvct_section_part2 *) (buf+pos);
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos+=2;
+
+ if ((pos + part2->descriptors_length) > len)
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_dccsct__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_dccsct__section.c
new file mode 100644
index 00000000000..e44cf91be46
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_dccsct__section.c
@@ -0,0 +1,31 @@
+$NetBSD: patch-lib_libucsi_atsc_dccsct__section.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/dccsct_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/dccsct_section.c
+@@ -65,7 +65,7 @@ struct atsc_dccsct_section *atsc_dccsct_
+ int sublen = sizeof(struct atsc_dccsct_update_new_county);
+ if (update->update_data_length < sublen)
+ return NULL;
+- bswap16(buf+pos+1);
++ ubswap16(buf+pos+1);
+
+ if (atsc_text_validate(buf+pos+sublen, update->update_data_length - sublen))
+ return NULL;
+@@ -78,7 +78,7 @@ struct atsc_dccsct_section *atsc_dccsct_
+ return NULL;
+ struct atsc_dccsct_update_part2 *part2 = (struct atsc_dccsct_update_part2 *) buf + pos;
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+
+ pos += sizeof(struct atsc_dccsct_update_part2);
+ if (len < (pos + part2->descriptors_length))
+@@ -93,7 +93,7 @@ struct atsc_dccsct_section *atsc_dccsct_
+ return NULL;
+ struct atsc_dccsct_section_part2 *part2 = (struct atsc_dccsct_section_part2 *) (buf+pos);
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+
+ pos += sizeof(struct atsc_dccsct_section_part2);
+ if (len < (pos + part2->descriptors_length))
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_dcct__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_dcct__section.c
new file mode 100644
index 00000000000..8c2bcebf685
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_dcct__section.c
@@ -0,0 +1,48 @@
+$NetBSD: patch-lib_libucsi_atsc_dcct__section.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/dcct_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/dcct_section.c
+@@ -39,10 +39,10 @@ struct atsc_dcct_section *atsc_dcct_sect
+ return NULL;
+ struct atsc_dcct_test *test = (struct atsc_dcct_test *) (buf+pos);
+
+- bswap24(buf+pos);
+- bswap24(buf+pos+3);
+- bswap32(buf+pos+6);
+- bswap32(buf+pos+10);
++ ubswap24(buf+pos);
++ ubswap24(buf+pos+3);
++ ubswap32(buf+pos+6);
++ ubswap32(buf+pos+10);
+
+ pos += sizeof(struct atsc_dcct_test);
+ for(termidx =0; termidx < test->dcc_term_count; termidx++) {
+@@ -50,8 +50,8 @@ struct atsc_dcct_section *atsc_dcct_sect
+ return NULL;
+ struct atsc_dcct_term *term = (struct atsc_dcct_term *) (buf+pos);
+
+- bswap64(buf+pos+1);
+- bswap16(buf+pos+9);
++ ubswap64(buf+pos+1);
++ ubswap16(buf+pos+9);
+
+ pos += sizeof(struct atsc_dcct_term);
+ if (len < (pos + term->descriptors_length))
+@@ -66,7 +66,7 @@ struct atsc_dcct_section *atsc_dcct_sect
+ return NULL;
+ struct atsc_dcct_test_part2 *part2 = (struct atsc_dcct_test_part2 *) (buf+pos);
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+
+ pos += sizeof(struct atsc_dcct_test_part2);
+ if (len < (pos + part2->descriptors_length))
+@@ -80,7 +80,7 @@ struct atsc_dcct_section *atsc_dcct_sect
+ return NULL;
+ struct atsc_dcct_section_part2 *part2 = (struct atsc_dcct_section_part2 *) (buf+pos);
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+
+ pos += sizeof(struct atsc_dcct_section_part2);
+ if (len < (pos + part2->descriptors_length))
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_eit__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_eit__section.c
new file mode 100644
index 00000000000..2fc1c10dcd8
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_eit__section.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-lib_libucsi_atsc_eit__section.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/eit_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/eit_section.c
+@@ -38,9 +38,9 @@ struct atsc_eit_section *atsc_eit_sectio
+ return NULL;
+ struct atsc_eit_event *event = (struct atsc_eit_event *) (buf+pos);
+
+- bswap16(buf+pos);
+- bswap32(buf+pos+2);
+- bswap32(buf+pos+6);
++ ubswap16(buf+pos);
++ ubswap32(buf+pos+2);
++ ubswap32(buf+pos+6);
+
+ pos += sizeof(struct atsc_eit_event);
+ if (len < (pos + event->title_length))
+@@ -53,7 +53,7 @@ struct atsc_eit_section *atsc_eit_sectio
+ return NULL;
+ struct atsc_eit_event_part2 *part2 = (struct atsc_eit_event_part2 *) (buf+pos);
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+
+ pos += sizeof(struct atsc_eit_event_part2);
+ if (len < (pos + part2->descriptors_length))
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_ett__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_ett__section.c
new file mode 100644
index 00000000000..e221fff93fe
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_ett__section.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_atsc_ett__section.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/ett_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/ett_section.c
+@@ -31,7 +31,7 @@ struct atsc_ett_section *atsc_ett_sectio
+ if (len < sizeof(struct atsc_ett_section))
+ return NULL;
+
+- bswap32(buf + pos);
++ ubswap32(buf + pos);
+ pos += 4;
+
+ if (atsc_text_validate(buf + pos,
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_mgt__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_mgt__section.c
new file mode 100644
index 00000000000..ae7e98df785
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_mgt__section.c
@@ -0,0 +1,37 @@
+$NetBSD: patch-lib_libucsi_atsc_mgt__section.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/mgt_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/mgt_section.c
+@@ -32,7 +32,7 @@ struct atsc_mgt_section *atsc_mgt_sectio
+ if (len < sizeof(struct atsc_mgt_section))
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 2;
+
+ // we cannot use the tables_defined value here because of the braindead ATSC spec!
+@@ -42,10 +42,10 @@ struct atsc_mgt_section *atsc_mgt_sectio
+ return NULL;
+ struct atsc_mgt_table *table = (struct atsc_mgt_table *) (buf+pos);
+
+- bswap16(buf+pos);
+- bswap16(buf+pos+2);
+- bswap32(buf+pos+5);
+- bswap16(buf+pos+9);
++ ubswap16(buf+pos);
++ ubswap16(buf+pos+2);
++ ubswap32(buf+pos+5);
++ ubswap16(buf+pos+9);
+
+ pos += sizeof(struct atsc_mgt_table);
+ if ((pos + table->table_type_descriptors_length) > len)
+@@ -60,7 +60,7 @@ struct atsc_mgt_section *atsc_mgt_sectio
+ return NULL;
+ struct atsc_mgt_section_part2 *part2 = (struct atsc_mgt_section_part2 *) (buf+pos);
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+
+ pos += sizeof(struct atsc_mgt_section_part2);
+ if ((pos + part2->descriptors_length) > len)
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_service__location__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_service__location__descriptor.h
new file mode 100644
index 00000000000..1ec30ae0e6e
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_service__location__descriptor.h
@@ -0,0 +1,21 @@
+$NetBSD: patch-lib_libucsi_atsc_service__location__descriptor.h,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/service_location_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/service_location_descriptor.h
+@@ -75,14 +75,14 @@ static inline struct atsc_service_locati
+
+ if (d->len < 3)
+ return NULL;
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos+=3;
+
+ for(idx = 0; idx < ret->number_elements; idx++) {
+ if (d->len < (pos + sizeof(struct atsc_caption_service_entry)))
+ return NULL;
+
+- bswap16(buf+pos+1);
++ ubswap16(buf+pos+1);
+
+ pos += sizeof(struct atsc_caption_service_entry);
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_stt__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_stt__section.c
new file mode 100644
index 00000000000..411ef1ba119
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_stt__section.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-lib_libucsi_atsc_stt__section.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/stt_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/stt_section.c
+@@ -30,9 +30,9 @@ struct atsc_stt_section *atsc_stt_sectio
+ if (len < sizeof(struct atsc_stt_section))
+ return NULL;
+
+- bswap32(buf + pos);
++ ubswap32(buf + pos);
+ pos += 5;
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 2;
+
+ if (verify_descriptors(buf + pos, len - sizeof(struct atsc_stt_section)))
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_time__shifted__service__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_time__shifted__service__descriptor.h
new file mode 100644
index 00000000000..9b0371e0308
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_time__shifted__service__descriptor.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_libucsi_atsc_time__shifted__service__descriptor.h,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/time_shifted_service_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/time_shifted_service_descriptor.h
+@@ -76,8 +76,8 @@ static inline struct atsc_time_shifted_s
+ if (d->len < (pos + sizeof(struct atsc_time_shifted_service)))
+ return NULL;
+
+- bswap16(buf+pos);
+- bswap24(buf+pos+2);
++ ubswap16(buf+pos);
++ ubswap24(buf+pos+2);
+
+ pos += sizeof(struct atsc_time_shifted_service);
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_tvct__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_tvct__section.c
new file mode 100644
index 00000000000..1a5fd8ce0db
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_atsc_tvct__section.c
@@ -0,0 +1,34 @@
+$NetBSD: patch-lib_libucsi_atsc_tvct__section.c,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/atsc/tvct_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/atsc/tvct_section.c
+@@ -42,13 +42,13 @@ struct atsc_tvct_section *atsc_tvct_sect
+
+ pos += 7*2;
+
+- bswap32(buf+pos);
+- bswap32(buf+pos+4);
+- bswap16(buf+pos+8);
+- bswap16(buf+pos+10);
+- bswap16(buf+pos+12);
+- bswap16(buf+pos+14);
+- bswap16(buf+pos+16);
++ ubswap32(buf+pos);
++ ubswap32(buf+pos+4);
++ ubswap16(buf+pos+8);
++ ubswap16(buf+pos+10);
++ ubswap16(buf+pos+12);
++ ubswap16(buf+pos+14);
++ ubswap16(buf+pos+16);
+ pos+=18;
+
+ if ((pos + channel->descriptors_length) > len)
+@@ -63,7 +63,7 @@ struct atsc_tvct_section *atsc_tvct_sect
+ return NULL;
+ struct atsc_tvct_section_part2 *part2 = (struct atsc_tvct_section_part2 *) (buf+pos);
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos+=2;
+
+ if ((pos + part2->descriptors_length) > len)
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__application__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__application__descriptor.h
new file mode 100644
index 00000000000..350603ab6cf
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__application__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_ait__application__descriptor.h,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/dvb/ait_application_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/ait_application_descriptor.h
+@@ -99,7 +99,7 @@ static inline struct dvb_ait_application
+ pos += sizeof(struct dvb_ait_application_descriptor);
+ pos2 = 0;
+ while(pos2 < ret->application_profiles_length) {
+- bswap16(buf + pos + pos2);
++ ubswap16(buf + pos + pos2);
+ pos2 += sizeof(struct dvb_ait_application_descriptor);
+ }
+ pos += pos2;
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__application__icons__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__application__icons__descriptor.h
new file mode 100644
index 00000000000..a9be571114f
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__application__icons__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_ait__application__icons__descriptor.h,v 1.1 2011/07/15 22:59:20 jmcneill Exp $
+
+--- lib/libucsi/dvb/ait_application_icons_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/ait_application_icons_descriptor.h
+@@ -91,7 +91,7 @@ static inline struct dvb_ait_application
+
+ if ((len - pos) < sizeof(struct dvb_ait_application_icons_descriptor_part2))
+ return NULL;
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+
+ return ret;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__external__application__authorisation__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__external__application__authorisation__descriptor.h
new file mode 100644
index 00000000000..69641b46127
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ait__external__application__authorisation__descriptor.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_libucsi_dvb_ait__external__application__authorisation__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/ait_external_application_authorisation_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/ait_external_application_authorisation_descriptor.h
+@@ -66,8 +66,8 @@ static inline struct dvb_ait_external_ap
+ return NULL;
+
+ while(pos < len) {
+- bswap32(buf + pos);
+- bswap32(buf + pos + 4);
++ ubswap32(buf + pos);
++ ubswap32(buf + pos + 4);
+ pos += sizeof(struct dvb_ait_external_application_authorisation);
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_announcement__support__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_announcement__support__descriptor.h
new file mode 100644
index 00000000000..399c1694224
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_announcement__support__descriptor.h
@@ -0,0 +1,26 @@
+$NetBSD: patch-lib_libucsi_dvb_announcement__support__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/announcement_support_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/announcement_support_descriptor.h
+@@ -115,7 +115,7 @@ static inline struct dvb_announcement_su
+ if (len < (sizeof(struct dvb_announcement_support_descriptor) - 2))
+ return NULL;
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+
+ pos += 2;
+
+@@ -134,9 +134,9 @@ static inline struct dvb_announcement_su
+ if ((pos + sizeof(struct dvb_announcement_support_reference)) > len)
+ return NULL;
+
+- bswap16(buf+pos);
+- bswap16(buf+pos+2);
+- bswap16(buf+pos+4);
++ ubswap16(buf+pos);
++ ubswap16(buf+pos+2);
++ ubswap16(buf+pos+4);
+
+ pos += sizeof(struct dvb_announcement_support_reference);
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_application__signalling__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_application__signalling__descriptor.h
new file mode 100644
index 00000000000..ac0d66848ae
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_application__signalling__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_application__signalling__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/application_signalling_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/application_signalling_descriptor.h
+@@ -66,7 +66,7 @@ static inline struct dvb_application_sig
+ return NULL;
+
+ while(pos < len) {
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos+=3;
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_bat__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_bat__section.c
new file mode 100644
index 00000000000..bec245ba902
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_bat__section.c
@@ -0,0 +1,35 @@
+$NetBSD: patch-lib_libucsi_dvb_bat__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/bat_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/bat_section.c
+@@ -31,7 +31,7 @@ struct dvb_bat_section * dvb_bat_section
+ if (len < sizeof(struct dvb_bat_section))
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 2;
+
+ if ((pos + ret->bouquet_descriptors_length) > len)
+@@ -44,7 +44,7 @@ struct dvb_bat_section * dvb_bat_section
+ if ((pos + sizeof(struct dvb_bat_section_part2)) > len)
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += sizeof(struct dvb_bat_section_part2);
+
+ while (pos < len) {
+@@ -54,9 +54,9 @@ struct dvb_bat_section * dvb_bat_section
+ if ((pos + sizeof(struct dvb_bat_transport)) > len)
+ return NULL;
+
+- bswap16(buf + pos);
+- bswap16(buf + pos + 2);
+- bswap16(buf + pos + 4);
++ ubswap16(buf + pos);
++ ubswap16(buf + pos + 2);
++ ubswap16(buf + pos + 4);
+
+ pos += sizeof(struct dvb_bat_transport);
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ca__identifier__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ca__identifier__descriptor.h
new file mode 100644
index 00000000000..e79b6f269cd
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ca__identifier__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_ca__identifier__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/ca_identifier_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/ca_identifier_descriptor.h
+@@ -56,7 +56,7 @@ static inline struct dvb_ca_identifier_d
+ return NULL;
+
+ while(pos < len) {
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos+=2;
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cable__delivery__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cable__delivery__descriptor.h
new file mode 100644
index 00000000000..14073f78715
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cable__delivery__descriptor.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-lib_libucsi_dvb_cable__delivery__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/cable_delivery_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/cable_delivery_descriptor.h
+@@ -56,9 +56,9 @@ static inline struct dvb_cable_delivery_
+ if (d->len != (sizeof(struct dvb_cable_delivery_descriptor) - 2))
+ return NULL;
+
+- bswap32((uint8_t*) d + 2);
+- bswap16((uint8_t*) d + 6);
+- bswap32((uint8_t*) d + 9);
++ ubswap32((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 6);
++ ubswap32((uint8_t*) d + 9);
+
+ return (struct dvb_cable_delivery_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cell__frequency__link__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cell__frequency__link__descriptor.h
new file mode 100644
index 00000000000..bc484229272
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cell__frequency__link__descriptor.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-lib_libucsi_dvb_cell__frequency__link__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/cell_frequency_link_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/cell_frequency_link_descriptor.h
+@@ -78,8 +78,8 @@ static inline struct dvb_cell_frequency_
+ if ((pos + sizeof(struct dvb_cell_frequency_link_cell)) > len)
+ return NULL;
+
+- bswap16(buf+pos);
+- bswap32(buf+pos+2);
++ ubswap16(buf+pos);
++ ubswap32(buf+pos+2);
+
+ pos += sizeof(struct dvb_cell_frequency_link_cell);
+
+@@ -91,7 +91,7 @@ static inline struct dvb_cell_frequency_
+
+ pos2 = 0;
+ while(pos2 < e->subcell_loop_info_length) {
+- bswap32(buf+pos+pos2+1);
++ ubswap32(buf+pos+pos2+1);
+
+ pos2 += sizeof(struct dvb_cell_frequency_link_cell_subcell);
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cell__list__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cell__list__descriptor.h
new file mode 100644
index 00000000000..0b506073bb1
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_cell__list__descriptor.h
@@ -0,0 +1,32 @@
+$NetBSD: patch-lib_libucsi_dvb_cell__list__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/cell_list_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/cell_list_descriptor.h
+@@ -84,10 +84,10 @@ static inline struct dvb_cell_list_descr
+ if ((pos + sizeof(struct dvb_cell_list_entry)) > len)
+ return NULL;
+
+- bswap16(buf+pos);
+- bswap16(buf+pos+2);
+- bswap16(buf+pos+4);
+- bswap32(buf+pos+6);
++ ubswap16(buf+pos);
++ ubswap16(buf+pos+2);
++ ubswap16(buf+pos+4);
++ ubswap32(buf+pos+6);
+
+ pos += sizeof(struct dvb_cell_list_entry);
+
+@@ -99,9 +99,9 @@ static inline struct dvb_cell_list_descr
+
+ pos2 = 0;
+ while(pos2 < e->subcell_info_loop_length) {
+- bswap16(buf+pos+pos2+1);
+- bswap16(buf+pos+pos2+3);
+- bswap24(buf+pos+pos2+5);
++ ubswap16(buf+pos+pos2+1);
++ ubswap16(buf+pos+pos2+3);
++ ubswap24(buf+pos+pos2+5);
+
+ pos2 += sizeof(struct dvb_subcell_list_entry);
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_content__identifier__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_content__identifier__descriptor.h
new file mode 100644
index 00000000000..af855cfcb89
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_content__identifier__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_content__identifier__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/content_identifier_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/content_identifier_descriptor.h
+@@ -118,7 +118,7 @@ static inline struct dvb_content_identif
+ case 1:
+ if (len < (pos+2))
+ return NULL;
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ break;
+ }
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_data__broadcast__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_data__broadcast__descriptor.h
new file mode 100644
index 00000000000..be16fc3c64d
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_data__broadcast__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_data__broadcast__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/data_broadcast_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/data_broadcast_descriptor.h
+@@ -72,7 +72,7 @@ static inline struct dvb_data_broadcast_
+ if (pos > len)
+ return NULL;
+
+- bswap16(buf + 2);
++ ubswap16(buf + 2);
+
+ pos += p->selector_length;
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_data__broadcast__id__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_data__broadcast__id__descriptor.h
new file mode 100644
index 00000000000..59b34a8358f
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_data__broadcast__id__descriptor.h
@@ -0,0 +1,31 @@
+$NetBSD: patch-lib_libucsi_dvb_data__broadcast__id__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/data_broadcast_id_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/data_broadcast_id_descriptor.h
+@@ -89,7 +89,7 @@ static inline struct dvb_data_broadcast_
+ if (d->len < (sizeof(struct dvb_data_broadcast_id_descriptor) - 2))
+ return NULL;
+
+- bswap16((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 2);
+
+ return (struct dvb_data_broadcast_id_descriptor*) d;
+ }
+@@ -190,7 +190,7 @@ static inline struct dvb_ip_mac_notifica
+ if (d->platform_id_data_length == 0)
+ return NULL;
+
+- bswap32((uint8_t *) d + sizeof(struct dvb_id_selector_byte_000b));
++ ubswap32((uint8_t *) d + sizeof(struct dvb_id_selector_byte_000b));
+
+ return (struct dvb_ip_mac_notification_info *) ((uint8_t *) d + sizeof(struct dvb_id_selector_byte_000b));
+ }
+@@ -207,7 +207,7 @@ static inline struct dvb_ip_mac_notifica
+ if (next >= end)
+ return NULL;
+
+- bswap32(next);
++ ubswap32(next);
+
+ return (struct dvb_ip_mac_notification_info *) next;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_eit__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_eit__section.c
new file mode 100644
index 00000000000..ed7d07045bd
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_eit__section.c
@@ -0,0 +1,27 @@
+$NetBSD: patch-lib_libucsi_dvb_eit__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/eit_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/eit_section.c
+@@ -30,9 +30,9 @@ struct dvb_eit_section *dvb_eit_section_
+ if (len < sizeof(struct dvb_eit_section))
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 2;
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 4;
+
+ while (pos < len) {
+@@ -42,8 +42,8 @@ struct dvb_eit_section *dvb_eit_section_
+ if ((pos + sizeof(struct dvb_eit_event)) > len)
+ return NULL;
+
+- bswap16(buf + pos);
+- bswap16(buf + pos + 10);
++ ubswap16(buf + pos);
++ ubswap16(buf + pos + 10);
+
+ pos += sizeof(struct dvb_eit_event);
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_frequency__list__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_frequency__list__descriptor.h
new file mode 100644
index 00000000000..3890ce235fa
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_frequency__list__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_frequency__list__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/frequency_list_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/frequency_list_descriptor.h
+@@ -69,7 +69,7 @@ static inline struct dvb_frequency_list_
+ return NULL;
+
+ while(pos < len) {
+- bswap32(buf+pos);
++ ubswap32(buf+pos);
+ pos += 4;
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_int__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_int__section.c
new file mode 100644
index 00000000000..7a4c022adc8
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_int__section.c
@@ -0,0 +1,33 @@
+$NetBSD: patch-lib_libucsi_dvb_int__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/int_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/int_section.c
+@@ -32,8 +32,8 @@ struct dvb_int_section * dvb_int_section
+ if (len < sizeof(struct dvb_int_section))
+ return NULL;
+
+- bswap32(buf+8);
+- bswap16(buf+12);
++ ubswap32(buf+8);
++ ubswap16(buf+12);
+ pos += 6;
+
+ if (len - pos < in->platform_descriptors_length)
+@@ -48,7 +48,7 @@ struct dvb_int_section * dvb_int_section
+ struct dvb_int_target *s2 = (struct dvb_int_target *) (buf + pos);
+ struct dvb_int_operational_loop *s3;
+
+- bswap16(buf + pos); /* target_descriptor_loop_length swap */
++ ubswap16(buf + pos); /* target_descriptor_loop_length swap */
+
+ if (len - pos < s2->target_descriptors_length)
+ return NULL;
+@@ -62,7 +62,7 @@ struct dvb_int_section * dvb_int_section
+
+ s3 = (struct dvb_int_operational_loop *) (buf + pos);
+
+- bswap16(buf + pos); /* operational_descriptor_loop_length swap */
++ ubswap16(buf + pos); /* operational_descriptor_loop_length swap */
+
+ if (len - pos < s3->operational_descriptors_length)
+ return NULL;
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ip__mac__stream__location__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ip__mac__stream__location__descriptor.h
new file mode 100644
index 00000000000..719ff2f11ad
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_ip__mac__stream__location__descriptor.h
@@ -0,0 +1,19 @@
+$NetBSD: patch-lib_libucsi_dvb_ip__mac__stream__location__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/ip_mac_stream_location_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/ip_mac_stream_location_descriptor.h
+@@ -58,10 +58,10 @@ static inline struct dvb_ip_mac_stream_l
+ if (d->len != (sizeof(struct dvb_ip_mac_stream_location_descriptor) - 2))
+ return NULL;
+
+- bswap16(buf);
+- bswap16(buf+2);
+- bswap16(buf+4);
+- bswap16(buf+6);
++ ubswap16(buf);
++ ubswap16(buf+2);
++ ubswap16(buf+4);
++ ubswap16(buf+6);
+
+ return (struct dvb_ip_mac_stream_location_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_linkage__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_linkage__descriptor.h
new file mode 100644
index 00000000000..2cfbdbfcbba
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_linkage__descriptor.h
@@ -0,0 +1,52 @@
+$NetBSD: patch-lib_libucsi_dvb_linkage__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/linkage_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/linkage_descriptor.h
+@@ -144,9 +144,9 @@ static inline struct dvb_linkage_descrip
+ if (len < (sizeof(struct dvb_linkage_descriptor) - 2))
+ return NULL;
+
+- bswap16(buf);
+- bswap16(buf+2);
+- bswap16(buf+4);
++ ubswap16(buf);
++ ubswap16(buf+2);
++ ubswap16(buf+4);
+
+ pos += sizeof(struct dvb_linkage_descriptor) - 2;
+
+@@ -164,14 +164,14 @@ static inline struct dvb_linkage_descrip
+ case 3:
+ if ((len - pos) < 2)
+ return NULL;
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos += 2;
+ break;
+ }
+ if (d08->origin_type == 0) {
+ if ((len - pos) < 2)
+ return NULL;
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos+=2;
+ }
+
+@@ -187,7 +187,7 @@ static inline struct dvb_linkage_descrip
+ return NULL;
+
+ while (pos2 < l_0b->platform_id_data_length) {
+- bswap32(buf + pos + pos2);
++ ubswap32(buf + pos + pos2);
+
+ struct dvb_platform_id *p_id = (struct dvb_platform_id *) (buf + pos + pos2);
+ if ((len - pos - pos2) < p_id->platform_name_loop_length)
+@@ -207,7 +207,7 @@ static inline struct dvb_linkage_descrip
+ if (l_0c->table_type == 0x02) {
+ if ((len - pos) < 2)
+ return NULL;
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ }
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_mhp__data__broadcast__id__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_mhp__data__broadcast__id__descriptor.h
new file mode 100644
index 00000000000..2219453bbeb
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_mhp__data__broadcast__id__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_mhp__data__broadcast__id__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/mhp_data_broadcast_id_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/mhp_data_broadcast_id_descriptor.h
+@@ -72,7 +72,7 @@ static inline struct dvb_mhp_data_broadc
+ return NULL;
+
+ while(pos < len) {
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos+=2;
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_mosaic__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_mosaic__descriptor.h
new file mode 100644
index 00000000000..039786960e8
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_mosaic__descriptor.h
@@ -0,0 +1,60 @@
+$NetBSD: patch-lib_libucsi_dvb_mosaic__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/mosaic_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/mosaic_descriptor.h
+@@ -134,7 +134,7 @@ static inline struct dvb_mosaic_descript
+ if ((pos + sizeof(struct dvb_mosaic_info)) > len)
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+
+ pos += sizeof(struct dvb_mosaic_info) +
+ e->elementary_cell_field_length;
+@@ -155,35 +155,35 @@ static inline struct dvb_mosaic_descript
+ case 0x01:
+ if ((pos + sizeof(struct dvb_mosaic_linkage_01)) > len)
+ return NULL;
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos += sizeof(struct dvb_mosaic_linkage_01);
+ break;
+
+ case 0x02:
+ if ((pos + sizeof(struct dvb_mosaic_linkage_02)) > len)
+ return NULL;
+- bswap16(buf+pos);
+- bswap16(buf+pos+2);
+- bswap16(buf+pos+4);
++ ubswap16(buf+pos);
++ ubswap16(buf+pos+2);
++ ubswap16(buf+pos+4);
+ pos += sizeof(struct dvb_mosaic_linkage_02);
+ break;
+
+ case 0x03:
+ if ((pos + sizeof(struct dvb_mosaic_linkage_03)) > len)
+ return NULL;
+- bswap16(buf+pos);
+- bswap16(buf+pos+2);
+- bswap16(buf+pos+4);
++ ubswap16(buf+pos);
++ ubswap16(buf+pos+2);
++ ubswap16(buf+pos+4);
+ pos += sizeof(struct dvb_mosaic_linkage_03);
+ break;
+
+ case 0x04:
+ if ((pos + sizeof(struct dvb_mosaic_linkage_04)) > len)
+ return NULL;
+- bswap16(buf+pos);
+- bswap16(buf+pos+2);
+- bswap16(buf+pos+4);
+- bswap16(buf+pos+6);
++ ubswap16(buf+pos);
++ ubswap16(buf+pos+2);
++ ubswap16(buf+pos+4);
++ ubswap16(buf+pos+6);
+ pos += sizeof(struct dvb_mosaic_linkage_04);
+ break;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_nit__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_nit__section.c
new file mode 100644
index 00000000000..39d83fe2ef7
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_nit__section.c
@@ -0,0 +1,35 @@
+$NetBSD: patch-lib_libucsi_dvb_nit__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/nit_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/nit_section.c
+@@ -31,7 +31,7 @@ struct dvb_nit_section *dvb_nit_section_
+ if (len < sizeof(struct dvb_nit_section))
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 2;
+
+ if ((pos + ret->network_descriptors_length) > len)
+@@ -45,7 +45,7 @@ struct dvb_nit_section *dvb_nit_section_
+ if ((pos + sizeof(struct dvb_nit_section_part2)) > len)
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 2;
+
+ while (pos < len) {
+@@ -55,9 +55,9 @@ struct dvb_nit_section *dvb_nit_section_
+ if ((pos + sizeof(struct dvb_nit_transport)) > len)
+ return NULL;
+
+- bswap16(buf + pos);
+- bswap16(buf + pos + 2);
+- bswap16(buf + pos + 4);
++ ubswap16(buf + pos);
++ ubswap16(buf + pos + 2);
++ ubswap16(buf + pos + 4);
+
+ pos += sizeof(struct dvb_nit_transport);
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_nvod__reference__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_nvod__reference__descriptor.h
new file mode 100644
index 00000000000..50cc6213dcf
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_nvod__reference__descriptor.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-lib_libucsi_dvb_nvod__reference__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/nvod_reference_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/nvod_reference_descriptor.h
+@@ -65,9 +65,9 @@ static inline struct dvb_nvod_reference_
+ return NULL;
+
+ while(pos < len) {
+- bswap16(buf+pos);
+- bswap16(buf+pos+2);
+- bswap16(buf+pos+4);
++ ubswap16(buf+pos);
++ ubswap16(buf+pos+2);
++ ubswap16(buf+pos+4);
+ pos += sizeof(struct dvb_nvod_reference);
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_partial__transport__stream__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_partial__transport__stream__descriptor.h
new file mode 100644
index 00000000000..c6cee35e4e6
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_partial__transport__stream__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_partial__transport__stream__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/partial_transport_stream_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/partial_transport_stream_descriptor.h
+@@ -56,7 +56,7 @@ static inline struct dvb_partial_transpo
+ if (d->len != (sizeof(struct dvb_partial_transport_stream_descriptor) - 2))
+ return NULL;
+
+- bswap64((uint8_t*) d + 2);
++ ubswap64((uint8_t*) d + 2);
+
+ return (struct dvb_partial_transport_stream_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_pdc__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_pdc__descriptor.h
new file mode 100644
index 00000000000..8537344ef3e
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_pdc__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_pdc__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/pdc_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/pdc_descriptor.h
+@@ -52,7 +52,7 @@ static inline struct dvb_pdc_descriptor*
+ if (d->len != (sizeof(struct dvb_pdc_descriptor) - 2))
+ return NULL;
+
+- bswap24((uint8_t*) d + 2);
++ ubswap24((uint8_t*) d + 2);
+
+ return (struct dvb_pdc_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_private__data__specifier__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_private__data__specifier__descriptor.h
new file mode 100644
index 00000000000..5b8ad8918ba
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_private__data__specifier__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_private__data__specifier__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/private_data_specifier_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/private_data_specifier_descriptor.h
+@@ -51,7 +51,7 @@ static inline struct dvb_private_data_sp
+ if (d->len != (sizeof(struct dvb_private_data_specifier_descriptor) - 2))
+ return NULL;
+
+- bswap32((uint8_t*) d + 2);
++ ubswap32((uint8_t*) d + 2);
+
+ return (struct dvb_private_data_specifier_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rnt__rar__over__dvb__stream__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rnt__rar__over__dvb__stream__descriptor.h
new file mode 100644
index 00000000000..60d2480d9d4
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rnt__rar__over__dvb__stream__descriptor.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-lib_libucsi_dvb_rnt__rar__over__dvb__stream__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/rnt_rar_over_dvb_stream_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/rnt_rar_over_dvb_stream_descriptor.h
+@@ -75,9 +75,9 @@ static inline struct dvb_rnt_rar_over_dv
+ if (len < sizeof(struct dvb_rnt_rar_over_dvb_stream_descriptor))
+ return NULL;
+
+- bswap16(buf + 13);
+- bswap16(buf + 15);
+- bswap16(buf + 17);
++ ubswap16(buf + 13);
++ ubswap16(buf + 15);
++ ubswap16(buf + 17);
+
+ if (ret->scheduled_flag == 1) {
+ if (len < (sizeof(struct dvb_rnt_rar_over_dvb_stream_descriptor)+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rnt__rnt__scan__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rnt__rnt__scan__descriptor.h
new file mode 100644
index 00000000000..71f5e823f99
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rnt__rnt__scan__descriptor.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_libucsi_dvb_rnt__rnt__scan__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/rnt_rnt_scan_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/rnt_rnt_scan_descriptor.h
+@@ -66,8 +66,8 @@ static inline struct dvb_rnt_rnt_scan_de
+ return NULL;
+
+ while(pos < len) {
+- bswap16(buf+pos);
+- bswap16(buf+pos+2);
++ ubswap16(buf+pos);
++ ubswap16(buf+pos+2);
+ pos += sizeof(struct dvb_rnt_rnt_scan_entry);
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rst__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rst__section.c
new file mode 100644
index 00000000000..d0b9ce9ba62
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_rst__section.c
@@ -0,0 +1,19 @@
+$NetBSD: patch-lib_libucsi_dvb_rst__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/rst_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/rst_section.c
+@@ -32,10 +32,10 @@ struct dvb_rst_section * dvb_rst_section
+ if ((pos + sizeof(struct dvb_rst_status)) > len)
+ return NULL;
+
+- bswap16(buf + pos);
+- bswap16(buf + pos + 2);
+- bswap16(buf + pos + 4);
+- bswap16(buf + pos + 6);
++ ubswap16(buf + pos);
++ ubswap16(buf + pos + 2);
++ ubswap16(buf + pos + 4);
++ ubswap16(buf + pos + 6);
+
+ pos += sizeof(struct dvb_rst_status);
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_satellite__delivery__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_satellite__delivery__descriptor.h
new file mode 100644
index 00000000000..de53b31075b
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_satellite__delivery__descriptor.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-lib_libucsi_dvb_satellite__delivery__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/satellite_delivery_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/satellite_delivery_descriptor.h
+@@ -59,9 +59,9 @@ static inline struct dvb_satellite_deliv
+ if (d->len < (sizeof(struct dvb_satellite_delivery_descriptor) - 2))
+ return NULL;
+
+- bswap32((uint8_t*) d + 2);
+- bswap16((uint8_t*) d + 6);
+- bswap32((uint8_t*) d + 9);
++ ubswap32((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 6);
++ ubswap32((uint8_t*) d + 9);
+
+ return (struct dvb_satellite_delivery_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_sdt__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_sdt__section.c
new file mode 100644
index 00000000000..01862263f6e
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_sdt__section.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-lib_libucsi_dvb_sdt__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/sdt_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/sdt_section.c
+@@ -30,7 +30,7 @@ struct dvb_sdt_section * dvb_sdt_section
+ if (len < sizeof(struct dvb_sdt_section))
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 3;
+
+ while (pos < len) {
+@@ -40,8 +40,8 @@ struct dvb_sdt_section * dvb_sdt_section
+ if ((pos + sizeof(struct dvb_sdt_service)) > len)
+ return NULL;
+
+- bswap16(buf + pos);
+- bswap16(buf + pos + 3);
++ ubswap16(buf + pos);
++ ubswap16(buf + pos + 3);
+ pos += sizeof(struct dvb_sdt_service);
+
+ if ((pos + service->descriptors_loop_length) > len)
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__availability__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__availability__descriptor.h
new file mode 100644
index 00000000000..e0f77934e40
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__availability__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_service__availability__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/service_availability_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/service_availability_descriptor.h
+@@ -60,7 +60,7 @@ static inline struct dvb_service_availab
+ return NULL;
+
+ while(pos < len) {
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos += 2;
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__list__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__list__descriptor.h
new file mode 100644
index 00000000000..ac7d542bb00
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__list__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_service__list__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/service_list_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/service_list_descriptor.h
+@@ -64,7 +64,7 @@ static inline struct dvb_service_list_de
+ return NULL;
+
+ while(pos < len) {
+- bswap16(p+pos);
++ ubswap16(p+pos);
+ pos += sizeof(struct dvb_service_list_service);
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__move__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__move__descriptor.h
new file mode 100644
index 00000000000..4696b2349e9
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_service__move__descriptor.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-lib_libucsi_dvb_service__move__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/service_move_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/service_move_descriptor.h
+@@ -53,9 +53,9 @@ static inline struct dvb_service_move_de
+ if (d->len != (sizeof(struct dvb_service_move_descriptor) - 2))
+ return NULL;
+
+- bswap16((uint8_t*) d + 2);
+- bswap16((uint8_t*) d + 4);
+- bswap16((uint8_t*) d + 6);
++ ubswap16((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 4);
++ ubswap16((uint8_t*) d + 6);
+
+ return (struct dvb_service_move_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_sit__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_sit__section.c
new file mode 100644
index 00000000000..1446eaa04d3
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_sit__section.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-lib_libucsi_dvb_sit__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/sit_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/sit_section.c
+@@ -31,7 +31,7 @@ struct dvb_sit_section * dvb_sit_section
+ if (len < sizeof(struct dvb_sit_section))
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 2;
+
+ if ((pos + ret->transmission_info_loop_length) > len)
+@@ -48,9 +48,9 @@ struct dvb_sit_section * dvb_sit_section
+ if ((pos + sizeof(struct dvb_sit_service)) > len)
+ return NULL;
+
+- bswap16(buf + pos);
+- bswap16(buf + pos + 2);
+- bswap16(buf + pos + 4);
++ ubswap16(buf + pos);
++ ubswap16(buf + pos + 2);
++ ubswap16(buf + pos + 4);
+ pos += sizeof(struct dvb_sit_service);
+
+ if ((pos + service->service_loop_length) > len)
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_subtitling__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_subtitling__descriptor.h
new file mode 100644
index 00000000000..bd76d3b192c
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_subtitling__descriptor.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_libucsi_dvb_subtitling__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/subtitling_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/subtitling_descriptor.h
+@@ -67,8 +67,8 @@ static inline struct dvb_subtitling_desc
+ return NULL;
+
+ while(pos < len) {
+- bswap16(ptr+pos+4);
+- bswap16(ptr+pos+6);
++ ubswap16(ptr+pos+4);
++ ubswap16(ptr+pos+6);
+ pos += sizeof(struct dvb_subtitling_entry);
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_terrestrial__delivery__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_terrestrial__delivery__descriptor.h
new file mode 100644
index 00000000000..df81c52bb08
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_terrestrial__delivery__descriptor.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_libucsi_dvb_terrestrial__delivery__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/terrestrial_delivery_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/terrestrial_delivery_descriptor.h
+@@ -64,8 +64,8 @@ static inline struct dvb_terrestrial_del
+ if (d->len != (sizeof(struct dvb_terrestrial_delivery_descriptor) - 2))
+ return NULL;
+
+- bswap32((uint8_t*) d + 2);
+- bswap32((uint8_t*) d + 9);
++ ubswap32((uint8_t*) d + 2);
++ ubswap32((uint8_t*) d + 9);
+
+ return (struct dvb_terrestrial_delivery_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_time__shifted__event__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_time__shifted__event__descriptor.h
new file mode 100644
index 00000000000..44773f3f520
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_time__shifted__event__descriptor.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_libucsi_dvb_time__shifted__event__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/time_shifted_event_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/time_shifted_event_descriptor.h
+@@ -52,8 +52,8 @@ static inline struct dvb_time_shifted_ev
+ if (d->len != (sizeof(struct dvb_time_shifted_event_descriptor) - 2))
+ return NULL;
+
+- bswap16((uint8_t*) d + 2);
+- bswap16((uint8_t*) d + 4);
++ ubswap16((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 4);
+
+ return (struct dvb_time_shifted_event_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_time__shifted__service__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_time__shifted__service__descriptor.h
new file mode 100644
index 00000000000..1803805c3a2
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_time__shifted__service__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_time__shifted__service__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/time_shifted_service_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/time_shifted_service_descriptor.h
+@@ -51,7 +51,7 @@ static inline struct dvb_time_shifted_se
+ if (d->len != (sizeof(struct dvb_time_shifted_service_descriptor) - 2))
+ return NULL;
+
+- bswap16((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 2);
+
+ return (struct dvb_time_shifted_service_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_tot__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_tot__section.c
new file mode 100644
index 00000000000..55cac74f122
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_tot__section.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_tot__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/tot_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/tot_section.c
+@@ -32,7 +32,7 @@ struct dvb_tot_section *dvb_tot_section_
+ return NULL;
+
+ pos += 5;
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 2;
+
+ if ((pos + ret->descriptors_loop_length) > len)
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_tva__id__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_tva__id__descriptor.h
new file mode 100644
index 00000000000..47feeed66fb
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_dvb_tva__id__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_dvb_tva__id__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/dvb/tva_id_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/dvb/tva_id_descriptor.h
+@@ -66,7 +66,7 @@ static inline struct dvb_tva_id_descript
+ return NULL;
+
+ while(pos < len) {
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos+=3;
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_endianops.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_endianops.h
new file mode 100644
index 00000000000..e9418346d42
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_endianops.h
@@ -0,0 +1,94 @@
+$NetBSD: patch-lib_libucsi_endianops.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/endianops.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/endianops.h
+@@ -27,8 +27,14 @@ extern "C"
+ #endif
+
+ #include <stdint.h>
++#ifdef __NetBSD__
++#define bswap_16 bswap16
++#define bswap_32 bswap32
++#define bswap_64 bswap64
++#else
+ #include <byteswap.h>
+ #include <endian.h>
++#endif
+
+ #define __ucsi_packed __attribute__((packed))
+
+@@ -44,27 +50,27 @@ extern "C"
+ #define EBIT7(x1,x2,x3,x4,x5,x6,x7) x1 x2 x3 x4 x5 x6 x7
+ #define EBIT8(x1,x2,x3,x4,x5,x6,x7,x8) x1 x2 x3 x4 x5 x6 x7 x8
+
+-static inline void bswap16(uint8_t *buf) {
++static inline void ubswap16(uint8_t *buf) {
+ (void) buf;
+ }
+
+-static inline void bswap32(uint8_t *buf) {
++static inline void ubswap32(uint8_t *buf) {
+ (void) buf;
+ }
+
+-static inline void bswap64(uint8_t *buf) {
++static inline void ubswap64(uint8_t *buf) {
+ (void) buf;
+ }
+
+-static inline void bswap24(uint8_t *buf) {
++static inline void ubswap24(uint8_t *buf) {
+ (void) buf;
+ }
+
+-static inline void bswap40(uint8_t *buf) {
++static inline void ubswap40(uint8_t *buf) {
+ (void) buf;
+ }
+
+-static inline void bswap48(uint8_t *buf) {
++static inline void ubswap48(uint8_t *buf) {
+ (void) buf;
+ }
+
+@@ -77,26 +83,26 @@ static inline void bswap48(uint8_t *buf)
+ #define EBIT7(x1,x2,x3,x4,x5,x6,x7) x7 x6 x5 x4 x3 x2 x1
+ #define EBIT8(x1,x2,x3,x4,x5,x6,x7,x8) x8 x7 x6 x5 x4 x3 x2 x1
+
+-static inline void bswap16(uint8_t * buf) {
++static inline void ubswap16(uint8_t * buf) {
+ *((uint16_t*)buf) = bswap_16((*(uint16_t*)buf));
+ }
+
+-static inline void bswap32(uint8_t * buf) {
++static inline void ubswap32(uint8_t * buf) {
+ *((uint32_t*)buf) = bswap_32((*(uint32_t*)buf));
+ }
+
+-static inline void bswap64(uint8_t * buf) {
++static inline void ubswap64(uint8_t * buf) {
+ *((uint64_t*)buf) = bswap_64((*(uint64_t*)buf));
+ }
+
+-static inline void bswap24(uint8_t * buf) {
++static inline void ubswap24(uint8_t * buf) {
+ uint8_t tmp0 = buf[0];
+
+ buf[0] = buf[2];
+ buf[2] = tmp0;
+ }
+
+-static inline void bswap40(uint8_t * buf) {
++static inline void ubswap40(uint8_t * buf) {
+ uint8_t tmp0 = buf[0];
+ uint8_t tmp1 = buf[1];
+
+@@ -106,7 +112,7 @@ static inline void bswap40(uint8_t * buf
+ buf[4] = tmp0;
+ }
+
+-static inline void bswap48(uint8_t * buf) {
++static inline void ubswap48(uint8_t * buf) {
+ uint8_t tmp0 = buf[0];
+ uint8_t tmp1 = buf[1];
+ uint8_t tmp2 = buf[2];
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_ca__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_ca__descriptor.h
new file mode 100644
index 00000000000..080693b2bc9
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_ca__descriptor.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_libucsi_mpeg_ca__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/ca_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/ca_descriptor.h
+@@ -54,8 +54,8 @@ static inline struct mpeg_ca_descriptor*
+ if (d->len < (sizeof(struct mpeg_ca_descriptor) - 2))
+ return NULL;
+
+- bswap16((uint8_t*) d + 2);
+- bswap16((uint8_t*) d + 4);
++ ubswap16((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 4);
+
+ return (struct mpeg_ca_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_content__labelling__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_content__labelling__descriptor.h
new file mode 100644
index 00000000000..d350896a6ed
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_content__labelling__descriptor.h
@@ -0,0 +1,32 @@
+$NetBSD: patch-lib_libucsi_mpeg_content__labelling__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/content_labelling_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/content_labelling_descriptor.h
+@@ -124,14 +124,14 @@ static inline struct mpeg_content_labell
+ if (len < sizeof(struct mpeg_content_labelling_descriptor))
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ id = *((uint16_t*) (buf+pos));
+ pos += 2;
+
+ if (id == 0xffff) {
+ if (len < (pos+4))
+ return NULL;
+- bswap32(buf+pos);
++ ubswap32(buf+pos);
+ pos += 4;
+ }
+
+@@ -152,8 +152,8 @@ static inline struct mpeg_content_labell
+ (flags->content_time_base_indicator == 2)) {
+ if (len < (pos + sizeof(struct mpeg_content_labelling_descriptor_time_base)))
+ return NULL;
+- bswap40(buf+pos);
+- bswap40(buf+pos+5);
++ ubswap40(buf+pos);
++ ubswap40(buf+pos+5);
+ pos += sizeof(struct mpeg_content_labelling_descriptor_time_base);
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_copyright__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_copyright__descriptor.h
new file mode 100644
index 00000000000..b5063a1cd2b
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_copyright__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_copyright__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/copyright_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/copyright_descriptor.h
+@@ -52,7 +52,7 @@ static inline struct mpeg_copyright_desc
+ if (d->len < (sizeof(struct mpeg_copyright_descriptor) - 2))
+ return NULL;
+
+- bswap32((uint8_t*) d + 2);
++ ubswap32((uint8_t*) d + 2);
+
+ return (struct mpeg_copyright_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_external__es__id__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_external__es__id__descriptor.h
new file mode 100644
index 00000000000..9b79b955ff5
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_external__es__id__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_external__es__id__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/external_es_id_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/external_es_id_descriptor.h
+@@ -51,7 +51,7 @@ static inline struct mpeg_external_es_id
+ if (d->len != (sizeof(struct mpeg_external_es_id_descriptor) - 2))
+ return NULL;
+
+- bswap16((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 2);
+
+ return (struct mpeg_external_es_id_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_fmc__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_fmc__descriptor.h
new file mode 100644
index 00000000000..b11a2d96fb9
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_fmc__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_fmc__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/fmc_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/fmc_descriptor.h
+@@ -64,7 +64,7 @@ static inline struct mpeg_fmc_descriptor
+ return NULL;
+
+ while(pos < len) {
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos += sizeof(struct mpeg_flex_mux);
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_ibp__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_ibp__descriptor.h
new file mode 100644
index 00000000000..e5eca8c5d03
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_ibp__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_ibp__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/ibp_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/ibp_descriptor.h
+@@ -53,7 +53,7 @@ static inline struct mpeg_ibp_descriptor
+ if (d->len != (sizeof(struct mpeg_ibp_descriptor) - 2))
+ return NULL;
+
+- bswap16((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 2);
+
+ return (struct mpeg_ibp_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_maximum__bitrate__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_maximum__bitrate__descriptor.h
new file mode 100644
index 00000000000..b29496a5f14
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_maximum__bitrate__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_maximum__bitrate__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/maximum_bitrate_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/maximum_bitrate_descriptor.h
+@@ -52,7 +52,7 @@ static inline struct mpeg_maximum_bitrat
+ if (d->len != (sizeof(struct mpeg_maximum_bitrate_descriptor) - 2))
+ return NULL;
+
+- bswap24((uint8_t*) d + 2);
++ ubswap24((uint8_t*) d + 2);
+
+ return (struct mpeg_maximum_bitrate_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__descriptor.h
new file mode 100644
index 00000000000..fe4dce4b8a3
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__descriptor.h
@@ -0,0 +1,30 @@
+$NetBSD: patch-lib_libucsi_mpeg_metadata__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/metadata_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/metadata_descriptor.h
+@@ -144,14 +144,14 @@ static inline struct mpeg_metadata_descr
+ if (len < sizeof(struct mpeg_metadata_descriptor))
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ id = *((uint16_t*) (buf+pos));
+ pos += 2;
+
+ if (id == 0xffff) {
+ if (len < (pos+4))
+ return NULL;
+- bswap32(buf+pos);
++ ubswap32(buf+pos);
+ pos += 4;
+ }
+
+@@ -163,7 +163,7 @@ static inline struct mpeg_metadata_descr
+ if (id == 0xff) {
+ if (len < (pos+4))
+ return NULL;
+- bswap32(buf+pos);
++ ubswap32(buf+pos);
+ pos += 4;
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__pointer__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__pointer__descriptor.h
new file mode 100644
index 00000000000..516133391b9
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__pointer__descriptor.h
@@ -0,0 +1,49 @@
+$NetBSD: patch-lib_libucsi_mpeg_metadata__pointer__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/metadata_pointer_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/metadata_pointer_descriptor.h
+@@ -125,14 +125,14 @@ static inline struct mpeg_metadata_point
+ if (len < sizeof(struct mpeg_metadata_pointer_descriptor))
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ id = *((uint16_t*) (buf+pos));
+ pos += 2;
+
+ if (id == 0xffff) {
+ if (len < (pos+4))
+ return NULL;
+- bswap32(buf+pos);
++ ubswap32(buf+pos);
+ pos += 4;
+ }
+
+@@ -144,7 +144,7 @@ static inline struct mpeg_metadata_point
+ if (id == 0xff) {
+ if (len < (pos+4))
+ return NULL;
+- bswap32(buf+pos);
++ ubswap32(buf+pos);
+ pos += 4;
+ }
+
+@@ -164,15 +164,15 @@ static inline struct mpeg_metadata_point
+ if (flags->mpeg_carriage_flags < 3) {
+ if (len < (pos + 2))
+ return NULL;
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos += 2;
+ }
+
+ if (flags->mpeg_carriage_flags == 1) {
+ if (len < (pos + 4))
+ return NULL;
+- bswap16(buf+pos);
+- bswap16(buf+pos+2);
++ ubswap16(buf+pos);
++ ubswap16(buf+pos+2);
+ pos += 4;
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__std__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__std__descriptor.h
new file mode 100644
index 00000000000..b0a3ab23f47
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_metadata__std__descriptor.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-lib_libucsi_mpeg_metadata__std__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/metadata_std_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/metadata_std_descriptor.h
+@@ -58,9 +58,9 @@ static inline struct mpeg_metadata_std_d
+ if (d->len != (sizeof(struct mpeg_metadata_std_descriptor) - 2))
+ return NULL;
+
+- bswap24(buf + 2);
+- bswap24(buf + 5);
+- bswap24(buf + 8);
++ ubswap24(buf + 2);
++ ubswap24(buf + 5);
++ ubswap24(buf + 8);
+
+ return (struct mpeg_metadata_std_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_multiplex__buffer__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_multiplex__buffer__descriptor.h
new file mode 100644
index 00000000000..39e396d330c
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_multiplex__buffer__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_multiplex__buffer__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/multiplex_buffer_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/multiplex_buffer_descriptor.h
+@@ -53,7 +53,7 @@ static inline struct mpeg_multiplex_buff
+ if (d->len != (sizeof(struct mpeg_multiplex_buffer_descriptor) - 2))
+ return NULL;
+
+- bswap48((uint8_t*) d + 2);
++ ubswap48((uint8_t*) d + 2);
+
+ return (struct mpeg_multiplex_buffer_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_multiplex__buffer__utilization__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_multiplex__buffer__utilization__descriptor.h
new file mode 100644
index 00000000000..4d256110cf2
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_multiplex__buffer__utilization__descriptor.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_libucsi_mpeg_multiplex__buffer__utilization__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/multiplex_buffer_utilization_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/multiplex_buffer_utilization_descriptor.h
+@@ -54,8 +54,8 @@ static inline struct mpeg_multiplex_buff
+ if (d->len != (sizeof(struct mpeg_multiplex_buffer_utilization_descriptor) - 2))
+ return NULL;
+
+- bswap16((uint8_t*) d + 2);
+- bswap16((uint8_t*) d + 4);
++ ubswap16((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 4);
+
+ return (struct mpeg_multiplex_buffer_utilization_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_odsmt__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_odsmt__section.c
new file mode 100644
index 00000000000..bcc5a2f4456
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_odsmt__section.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-lib_libucsi_mpeg_odsmt__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/odsmt_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/odsmt_section.c
+@@ -41,7 +41,7 @@ struct mpeg_odsmt_section *mpeg_odsmt_se
+ if ((pos + sizeof(struct mpeg_odsmt_stream_single)) > len)
+ return NULL;
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos+=3;
+
+ if ((pos + stream->u.single.es_info_length) >= len)
+@@ -59,7 +59,7 @@ struct mpeg_odsmt_section *mpeg_odsmt_se
+ if ((pos + sizeof(struct mpeg_odsmt_stream_multi)) > len)
+ return NULL;
+
+- bswap16(buf+pos);
++ ubswap16(buf+pos);
+ pos += sizeof(struct mpeg_odsmt_stream_multi);
+
+ if ((pos + stream->u.multi.es_info_length) > len)
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_pat__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_pat__section.c
new file mode 100644
index 00000000000..baaf4a4715d
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_pat__section.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_libucsi_mpeg_pat__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/pat_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/pat_section.c
+@@ -34,8 +34,8 @@ struct mpeg_pat_section *mpeg_pat_sectio
+ if ((pos + 4) > len)
+ return NULL;
+
+- bswap16(buf + pos);
+- bswap16(buf + pos + 2);
++ ubswap16(buf + pos);
++ ubswap16(buf + pos + 2);
+ pos += 4;
+ }
+
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_pmt__section.c b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_pmt__section.c
new file mode 100644
index 00000000000..fa94039add6
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_pmt__section.c
@@ -0,0 +1,27 @@
+$NetBSD: patch-lib_libucsi_mpeg_pmt__section.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/pmt_section.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/pmt_section.c
+@@ -31,9 +31,9 @@ struct mpeg_pmt_section * mpeg_pmt_secti
+ if (len < sizeof(struct mpeg_pmt_section))
+ return NULL;
+
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 2;
+- bswap16(buf + pos);
++ ubswap16(buf + pos);
+ pos += 2;
+
+ if ((pos + pmt->program_info_length) > len)
+@@ -51,8 +51,8 @@ struct mpeg_pmt_section * mpeg_pmt_secti
+ if ((pos + sizeof(struct mpeg_pmt_stream)) > len)
+ return NULL;
+
+- bswap16(buf + pos + 1);
+- bswap16(buf + pos + 3);
++ ubswap16(buf + pos + 1);
++ ubswap16(buf + pos + 3);
+ pos += sizeof(struct mpeg_pmt_stream);
+
+ if ((pos + stream->es_info_length) > len)
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_private__data__indicator__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_private__data__indicator__descriptor.h
new file mode 100644
index 00000000000..6669168a9ea
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_private__data__indicator__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_private__data__indicator__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/private_data_indicator_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/private_data_indicator_descriptor.h
+@@ -51,7 +51,7 @@ static inline struct mpeg_private_data_i
+ if (d->len != (sizeof(struct mpeg_private_data_indicator_descriptor) - 2))
+ return NULL;
+
+- bswap32((uint8_t*) d + 2);
++ ubswap32((uint8_t*) d + 2);
+
+ return (struct mpeg_private_data_indicator_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_registration__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_registration__descriptor.h
new file mode 100644
index 00000000000..385c9ef49fb
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_registration__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_registration__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/registration_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/registration_descriptor.h
+@@ -52,7 +52,7 @@ static inline struct mpeg_registration_d
+ if (d->len < (sizeof(struct mpeg_registration_descriptor) - 2))
+ return NULL;
+
+- bswap32((uint8_t*) d + 2);
++ ubswap32((uint8_t*) d + 2);
+
+ return (struct mpeg_registration_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_sl__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_sl__descriptor.h
new file mode 100644
index 00000000000..18cd9e06a0e
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_sl__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_sl__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/sl_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/sl_descriptor.h
+@@ -51,7 +51,7 @@ static inline struct mpeg_sl_descriptor*
+ if (d->len != (sizeof(struct mpeg_sl_descriptor) - 2))
+ return NULL;
+
+- bswap16((uint8_t*) d + 2);
++ ubswap16((uint8_t*) d + 2);
+
+ return (struct mpeg_sl_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_smoothing__buffer__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_smoothing__buffer__descriptor.h
new file mode 100644
index 00000000000..c5f3cc98caf
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_smoothing__buffer__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_smoothing__buffer__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/smoothing_buffer_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/smoothing_buffer_descriptor.h
+@@ -54,7 +54,7 @@ static inline struct mpeg_smoothing_buff
+ if (d->len != (sizeof(struct mpeg_smoothing_buffer_descriptor) - 2))
+ return NULL;
+
+- bswap48((uint8_t*) d + 2);
++ ubswap48((uint8_t*) d + 2);
+
+ return (struct mpeg_smoothing_buffer_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_target__background__grid__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_target__background__grid__descriptor.h
new file mode 100644
index 00000000000..263df6507dc
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_target__background__grid__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_target__background__grid__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/target_background_grid_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/target_background_grid_descriptor.h
+@@ -54,7 +54,7 @@ static inline struct mpeg_target_backgro
+ if (d->len != (sizeof(struct mpeg_target_background_grid_descriptor) - 2))
+ return NULL;
+
+- bswap32((uint8_t*) d + 2);
++ ubswap32((uint8_t*) d + 2);
+
+ return (struct mpeg_target_background_grid_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_video__window__descriptor.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_video__window__descriptor.h
new file mode 100644
index 00000000000..aed1aa0f9ac
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_mpeg_video__window__descriptor.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_libucsi_mpeg_video__window__descriptor.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/mpeg/video_window_descriptor.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/mpeg/video_window_descriptor.h
+@@ -52,7 +52,7 @@ static inline struct mpeg_video_window_d
+ if (d->len != (sizeof(struct mpeg_video_window_descriptor) - 2))
+ return NULL;
+
+- bswap32((uint8_t*) d + 2);
++ ubswap32((uint8_t*) d + 2);
+
+ return (struct mpeg_video_window_descriptor*) d;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-lib_libucsi_section.h b/multimedia/dvb-apps/patches/patch-lib_libucsi_section.h
new file mode 100644
index 00000000000..a3c49191c7d
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-lib_libucsi_section.h
@@ -0,0 +1,60 @@
+$NetBSD: patch-lib_libucsi_section.h,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- lib/libucsi/section.h.orig 2011-06-28 05:50:24.000000000 +0000
++++ lib/libucsi/section.h
+@@ -112,7 +112,7 @@ static inline struct section * section_c
+ if (len < 3)
+ return NULL;
+
+- bswap16(buf+1);
++ ubswap16(buf+1);
+
+ if (len != ret->length + 3U)
+ return NULL;
+@@ -134,9 +134,9 @@ static inline int section_check_crc(stru
+ uint32_t crc;
+
+ /* the crc check has to be performed on the unswapped data */
+- bswap16(buf+1);
++ ubswap16(buf+1);
+ crc = crc32(CRC32_INIT, buf, len);
+- bswap16(buf+1);
++ ubswap16(buf+1);
+
+ /* the crc check includes the crc value,
+ * the result should therefore be zero.
+@@ -165,7 +165,7 @@ static inline struct section_ext * secti
+ return NULL;
+ }
+
+- bswap16((uint8_t *)section + sizeof(struct section));
++ ubswap16((uint8_t *)section + sizeof(struct section));
+
+ return (struct section_ext *)section;
+ }
+@@ -183,7 +183,7 @@ static inline struct section_ext * secti
+ if (section->syntax_indicator == 0)
+ return NULL;
+
+- bswap16((uint8_t *)section + sizeof(struct section));
++ ubswap16((uint8_t *)section + sizeof(struct section));
+
+ if (update_crc) {
+ uint8_t * buf = (uint8_t *) section;
+@@ -191,13 +191,13 @@ static inline struct section_ext * secti
+ uint32_t crc;
+
+ /* the crc has to be performed on the swapped data */
+- bswap16(buf+1);
++ ubswap16(buf+1);
+ crc = crc32(CRC32_INIT, buf, len-4);
+- bswap16(buf+1);
++ ubswap16(buf+1);
+
+ /* update the CRC */
+ *((uint32_t*) (buf+len-4)) = crc;
+- bswap32(buf+len-4);
++ ubswap32(buf+len-4);
+ }
+
+ return (struct section_ext *)section;
diff --git a/multimedia/dvb-apps/patches/patch-util_atsc__epg_Makefile b/multimedia/dvb-apps/patches/patch-util_atsc__epg_Makefile
new file mode 100644
index 00000000000..4c805f4beb5
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-util_atsc__epg_Makefile
@@ -0,0 +1,17 @@
+$NetBSD: patch-util_atsc__epg_Makefile,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- util/atsc_epg/Makefile.orig 2011-06-28 05:50:24.000000000 +0000
++++ util/atsc_epg/Makefile
+@@ -4,10 +4,10 @@ binaries = atsc_epg
+
+ inst_bin = $(binaries)
+
+-CPPFLAGS += -I../../lib -std=c99 -D_POSIX_SOURCE
++CPPFLAGS += -I../../lib -std=c99 -D_POSIX_SOURCE -D_NETBSD_SOURCE
+ #LDFLAGS += -static -L../../lib/libdvbapi -L../../lib/libucsi
+ LDFLAGS += -L../../lib/libdvbapi -L../../lib/libucsi
+-LDLIBS += -ldvbapi -lucsi
++LDLIBS += -ldvbapi -lucsi -Wl,-R$(prefix)/lib
+
+ .PHONY: all
+
diff --git a/multimedia/dvb-apps/patches/patch-util_dvbdate_Makefile b/multimedia/dvb-apps/patches/patch-util_dvbdate_Makefile
new file mode 100644
index 00000000000..5ec89ae46b3
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-util_dvbdate_Makefile
@@ -0,0 +1,13 @@
+$NetBSD: patch-util_dvbdate_Makefile,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- util/dvbdate/Makefile.orig 2011-06-28 05:50:24.000000000 +0000
++++ util/dvbdate/Makefile
+@@ -6,7 +6,7 @@ inst_bin = $(binaries)
+
+ CPPFLAGS += -I../../lib
+ LDFLAGS += -L../../lib/libdvbapi -L../../lib/libucsi
+-LDLIBS += -ldvbapi -lucsi
++LDLIBS += -ldvbapi -lucsi -Wl,-R$(prefix)/lib
+
+ .PHONY: all
+
diff --git a/multimedia/dvb-apps/patches/patch-util_dvbdate_dvbdate.c b/multimedia/dvb-apps/patches/patch-util_dvbdate_dvbdate.c
new file mode 100644
index 00000000000..bfdf59f36b2
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-util_dvbdate_dvbdate.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-util_dvbdate_dvbdate.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- util/dvbdate/dvbdate.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ util/dvbdate/dvbdate.c
+@@ -309,7 +309,12 @@ int atsc_scan_date(time_t *rx_time, unsi
+ */
+ int set_time(time_t * new_time)
+ {
++#ifdef __NetBSD__
++ struct timeval new_tv = { .tv_sec = new_time, .tv_usec = 0 };
++ if (settimeofday(&new_tv, NULL)) {
++#else
+ if (stime(new_time)) {
++#endif
+ perror("Unable to set time");
+ return -1;
+ }
diff --git a/multimedia/dvb-apps/patches/patch-util_szap_azap.c b/multimedia/dvb-apps/patches/patch-util_szap_azap.c
new file mode 100644
index 00000000000..a60e8911eb1
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-util_szap_azap.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-util_szap_azap.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- util/szap/azap.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ util/szap/azap.c
+@@ -10,8 +10,12 @@
+ #include <ctype.h>
+ #include <errno.h>
+
++#ifdef __NetBSD__
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/dvb/frontend.h>
+ #include <linux/dvb/dmx.h>
++#endif
+
+ #include "util.h"
+
diff --git a/multimedia/dvb-apps/patches/patch-util_szap_czap.c b/multimedia/dvb-apps/patches/patch-util_szap_czap.c
new file mode 100644
index 00000000000..705608c56cc
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-util_szap_czap.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-util_szap_czap.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- util/szap/czap.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ util/szap/czap.c
+@@ -10,8 +10,12 @@
+ #include <ctype.h>
+ #include <errno.h>
+
++#ifdef __NetBSD__
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/dvb/frontend.h>
+ #include <linux/dvb/dmx.h>
++#endif
+
+ #include "util.h"
+
diff --git a/multimedia/dvb-apps/patches/patch-util_szap_szap.c b/multimedia/dvb-apps/patches/patch-util_szap_szap.c
new file mode 100644
index 00000000000..8a627f24022
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-util_szap_szap.c
@@ -0,0 +1,29 @@
+$NetBSD: patch-util_szap_szap.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- util/szap/szap.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ util/szap/szap.c
+@@ -44,9 +44,13 @@
+ #include <stdint.h>
+ #include <sys/time.h>
+
++#ifdef __NetBSD__
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/dvb/frontend.h>
+ #include <linux/dvb/dmx.h>
+ #include <linux/dvb/audio.h>
++#endif
+ #include "lnb.h"
+ #include "util.h"
+
+@@ -304,8 +308,10 @@ int zap_to(unsigned int adapter, unsigne
+ if (diseqc(fefd, sat_no, pol, hiband))
+ if (do_tune(fefd, ifreq, sr))
+ if (set_pesfilter(dmxfdv, vpid, DMX_PES_VIDEO, dvr))
++#ifdef AUDIO_SET_BYPASS_MODE
+ if (audiofd >= 0)
+ (void)ioctl(audiofd, AUDIO_SET_BYPASS_MODE, bypass);
++#endif
+ if (set_pesfilter(dmxfda, apid, DMX_PES_AUDIO, dvr)) {
+ if (rec_psi) {
+ pmtpid = get_pmt_pid(dmxdev, sid);
diff --git a/multimedia/dvb-apps/patches/patch-util_szap_tzap.c b/multimedia/dvb-apps/patches/patch-util_szap_tzap.c
new file mode 100644
index 00000000000..e842ef7f5e0
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-util_szap_tzap.c
@@ -0,0 +1,21 @@
+$NetBSD: patch-util_szap_tzap.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- util/szap/tzap.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ util/szap/tzap.c
+@@ -32,8 +32,16 @@
+ #include <errno.h>
+ #include <signal.h>
+
++#ifndef O_LARGEFILE
++#define O_LARGEFILE 0
++#endif
++
++#ifdef __NetBSD__
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/dvb/frontend.h>
+ #include <linux/dvb/dmx.h>
++#endif
+
+ #include "util.h"
+
diff --git a/multimedia/dvb-apps/patches/patch-util_szap_util.c b/multimedia/dvb-apps/patches/patch-util_szap_util.c
new file mode 100644
index 00000000000..f058d47a1b9
--- /dev/null
+++ b/multimedia/dvb-apps/patches/patch-util_szap_util.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-util_szap_util.c,v 1.1 2011/07/15 22:59:21 jmcneill Exp $
+
+--- util/szap/util.c.orig 2011-06-28 05:50:24.000000000 +0000
++++ util/szap/util.c
+@@ -29,8 +29,12 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+
++#ifdef __NetBSD__
++#include <dev/dtv/dtvio.h>
++#else
+ #include <linux/dvb/frontend.h>
+ #include <linux/dvb/dmx.h>
++#endif
+
+
+ int set_pesfilter(int dmxfd, int pid, int pes_type, int dvr)