diff options
61 files changed, 747 insertions, 550 deletions
@@ -218,7 +218,6 @@ SRCS_COMMON = asxparser.c \ codec-cfg.c \ cpudetect.c \ defaultopts.c \ - edl.c \ fmt-conversion.c \ m_config.c \ m_option.c \ @@ -405,6 +404,7 @@ SRCS_COMMON = asxparser.c \ libvo/osd.c \ libvo/eosd_packer.c \ osdep/numcores.c \ + osdep/io.c \ osdep/$(GETCH) \ osdep/$(TIMER) \ stream/open.c \ diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 790a1d1503..75aa5553fe 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -491,7 +491,8 @@ const m_option_t common_opts[] = { // stop at given position {"endpos", &end_at, CONF_TYPE_TIME_SIZE, 0, 0, 0, NULL}, - {"edl", &edl_filename, CONF_TYPE_STRING, 0, 0, 0, NULL}, + OPT_ERRORMESSAGE("edl", "Old EDL functionality using the --edl option is " + "not supported.\n"), // AVI specific: force non-interleaved mode {"ni", &force_ni, CONF_TYPE_FLAG, 0, 0, 1, NULL}, @@ -1563,7 +1563,7 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg, { struct MPOpts *opts = &mpctx->opts; demux_stream_t *const d_sub = mpctx->d_sub; - int source = -1, reset_spu = 0; + int source = -1, reset_spu av_unused = 0; // used under CONFIG_DVDREAD int source_pos = -1; update_global_sub_size(mpctx); @@ -166,6 +166,7 @@ yasm_check() { } pkg_config_add() { + unset IFS # shell should not be used for programming echo >> "$TMPLOG" echo "$_pkg_config --cflags $@" >> "$TMPLOG" ctmp=$($_pkg_config --cflags "$@" 2>> "$TMPLOG") || return $? @@ -335,7 +336,7 @@ Optional features: --disable-networking disable networking [enable] --enable-winsock2_h enable winsock2_h [autodetect] --enable-smb enable Samba (SMB) input [autodetect] - --enable-live enable LIVE555 Streaming Media [autodetect] + --enable-live enable LIVE555 Streaming Media [disable] --enable-nemesi enable Nemesi Streaming Media [autodetect] --disable-vcd disable VCD support [autodetect] --disable-bluray disable Blu-ray support [autodetect] @@ -476,13 +477,14 @@ Available values for --language-msg are: all $msg_lang_all Miscellaneous options: --enable-runtime-cpudetection enable runtime CPU detection [disable] - --enable-cross-compile enable cross-compilation [autodetect] + --enable-cross-compile enable cross-compilation [disable] --cc=COMPILER C compiler to build MPlayer [gcc] --host-cc=COMPILER C compiler for tools needed while building [gcc] --as=ASSEMBLER assembler to build MPlayer [as] --nm=NM nm tool to build MPlayer [nm] --yasm=YASM Yasm assembler to build MPlayer [yasm] --ar=AR librarian to build MPlayer [ar] + --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config] --ranlib=RANLIB ranlib to build MPlayer [ranlib] --windres=WINDRES windres to build MPlayer [windres] --target=PLATFORM target platform (i386-linux, arm-linux, etc) @@ -551,16 +553,17 @@ neon=auto _iwmmxt=auto _altivec=auto _install=install -_ranlib=ranlib -_windres=windres -_cc=cc -_ar=ar +_pkg_config=auto +_ranlib=auto +_windres=auto +_cc=auto +_ar=auto test "$CC" && _cc="$CC" _as=auto _nm=auto -_yasm=yasm +_yasm=auto _runtime_cpudetection=no -_cross_compile=auto +_cross_compile=no _prefix="/usr/local" ffmpeg=auto ffmpeg_internals=no @@ -632,7 +635,7 @@ _dvdread_internal=auto _libdvdcss_internal=auto _xanim=auto _real=auto -_live=auto +_live=no _nemesi=auto _native_rtsp=yes _xinerama=auto @@ -799,6 +802,9 @@ for ac_option do --ar=*) _ar=$(echo $ac_option | cut -d '=' -f 2) ;; + --pkg-config=*) + _pkg_config=$(echo $ac_option | cut -d '=' -f 2) + ;; --ranlib=*) _ranlib=$(echo $ac_option | cut -d '=' -f 2) ;; @@ -1198,6 +1204,58 @@ test -z "$_confdir" && _confdir="$_prefix/etc/mplayer" test -z "$_libdir" && _libdir="$_prefix/lib" test -z "$_localedir" && _localedir="$_prefix/share/locale" +for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do + test "$tmpdir" && break +done + +mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$" +mkdir $mplayer_tmpdir || die "Unable to create tmpdir." + +TMPLOG="config.log" + +rm -f "$TMPLOG" +echo Parameters configure was run with: > "$TMPLOG" +if test -n "$CFLAGS" ; then + echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG" +fi +if test -n "$PKG_CONFIG_PATH" ; then + echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG" +fi +echo ./configure $configuration >> "$TMPLOG" +echo >> "$TMPLOG" + + +echocheck "cross compilation" +echores $_cross_compile + +if test $_cross_compile = yes; then + tmp_run() { + return 0 + } + test "$_host_cc" || _host_cc=cc +fi + +tool_prefix="" + +if test $_cross_compile = yes ; then + # Usually cross-compiler prefixes match with the target triplet + test -n "$_target" && tool_prefix="$_target"- +fi + +test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib +test "$_windres" = auto && _windres="$tool_prefix"windres +test "$_ar" = auto && _ar="$tool_prefix"ar +test "$_yasm" = auto && _yasm="$tool_prefix"yasm +test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config + +if test "$_cc" = auto ; then + if test -n "$tool_prefix" ; then + _cc="$tool_prefix"gcc + else + _cc=cc + fi +fi + # Determine our OS name and CPU architecture if test -z "$_target" ; then # OS name @@ -1268,21 +1326,25 @@ if test -z "$_target" ; then ;; esac else # if test -z "$_target" - system_name=$(echo $_target | cut -d '-' -f 2) - case "$(echo $system_name | tr A-Z a-z)" in - linux) system_name=Linux ;; - freebsd) system_name=FreeBSD ;; - gnu/kfreebsd) system_name=FreeBSD ;; - netbsd) system_name=NetBSD ;; - bsd/os) system_name=BSD/OS ;; - openbsd) system_name=OpenBSD ;; - dragonfly) system_name=DragonFly ;; - sunos) system_name=SunOS ;; - qnx) system_name=QNX ;; - morphos) system_name=MorphOS ;; - amigaos) system_name=AmigaOS ;; - mingw32*) system_name=MINGW32 ;; - esac + for i in 2 3; do + system_name=$(echo $_target | cut -d '-' -f $i) + case "$(echo $system_name | tr A-Z a-z)" in + linux) system_name=Linux ;; + freebsd) system_name=FreeBSD ;; + gnu/kfreebsd) system_name=FreeBSD ;; + netbsd) system_name=NetBSD ;; + bsd/os) system_name=BSD/OS ;; + openbsd) system_name=OpenBSD ;; + dragonfly) system_name=DragonFly ;; + sunos) system_name=SunOS ;; + qnx) system_name=QNX ;; + morphos) system_name=MorphOS ;; + amigaos) system_name=AmigaOS ;; + mingw32*) system_name=MINGW32 ;; + *) continue ;; + esac + break + done # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed host_arch=$(echo $_target | cut -d '-' -f 1) if test $(echo $host_arch) != "x86_64" ; then @@ -1336,6 +1398,7 @@ fi if mingw32 ; then _getch=getch2-win.c need_shmem=no + extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1" fi if amigaos ; then @@ -1359,25 +1422,12 @@ if os2 ; then def_priority="#define CONFIG_PRIORITY 1" fi -for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do - test "$tmpdir" && break -done - -mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$" -mkdir $mplayer_tmpdir || die "Unable to create tmpdir." - -TMPLOG="config.log" TMPC="$mplayer_tmpdir/tmp.c" TMPCPP="$mplayer_tmpdir/tmp.cpp" TMPEXE="$mplayer_tmpdir/tmp$_exesuf" TMPH="$mplayer_tmpdir/tmp.h" TMPS="$mplayer_tmpdir/tmp.S" -rm -f "$TMPLOG" -echo configuration: $configuration > "$TMPLOG" -echo >> "$TMPLOG" - - if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then die "Runtime CPU detection only works for x86, x86-64 and PPC!" fi @@ -1463,27 +1513,13 @@ EOF cc_check && host_arch=x86_64 || host_arch=i386 fi -echo "Detected operating system: $system_name" -echo "Detected host architecture: $host_arch" - -echocheck "cross compilation" -if test $_cross_compile = auto ; then - _cross_compile=yes - cflag_check "" && "$TMPEXE" && _cross_compile=no -fi -echores $_cross_compile - -if test $_cross_compile = yes; then - tmp_run() { - return 0 - } - test "$_host_cc" || _host_cc=cc -fi - echocheck "host cc" test "$_host_cc" || _host_cc=$_cc echores $_host_cc +echo "Detected operating system: $system_name" +echo "Detected host architecture: $host_arch" + # --- # now that we know what compiler should be used for compilation, try to find @@ -3611,7 +3647,6 @@ echores "$_apple_ir" fi #if linux echocheck "pkg-config" -_pkg_config=pkg-config if $($_pkg_config --version > /dev/null 2>&1); then if test "$_ld_static"; then _pkg_config="$_pkg_config --static" @@ -5711,7 +5746,7 @@ fi echores "$_nemesi" echocheck "LIVE555 Streaming Media libraries" -if test "$_live" = auto && test "$networking" = yes ; then +if test "$_live" != no && test "$networking" = yes ; then cat > $TMPCPP << EOF #include <liveMedia.hh> #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600) @@ -5768,9 +5803,7 @@ all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:l echocheck "Libav ($all_libav_libs)" if test "$ffmpeg" = auto ; then IFS=":" # shell should not be used for programming - if pkg_config_add $all_libav_libs ; then - unset IFS - else + if ! pkg_config_add $all_libav_libs ; then die "Unable to find development files for some of the required Libav libraries above. Aborting." fi fi diff --git a/edl.c b/edl.c deleted file mode 100644 index 677a2efb24..0000000000 --- a/edl.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <stdio.h> -#include <stdlib.h> -#include "config.h" -#include "mp_msg.h" -#include "edl.h" - -char *edl_filename; // file to extract EDL entries from (-edl) -char *edl_output_filename; // file to put EDL entries in (-edlout) - -/** - * Allocates a new EDL record and makes sure allocation was successful. - * - * \return New allocated EDL record. - * \brief Allocate new EDL record - */ - -static edl_record_ptr edl_alloc_new(edl_record_ptr next_edl_record) -{ - edl_record_ptr new_record = calloc(1, sizeof(struct edl_record)); - if (!new_record) { - mp_tmsg(MSGT_CPLAYER, MSGL_FATAL, "Can't allocate enough memory to hold EDL data.\n"); - exit(1); - } - - if (next_edl_record) // if this isn't the first record, tell the previous one what the new one is. - next_edl_record->next = new_record; - new_record->prev = next_edl_record; - new_record->next = NULL; - - return new_record; -} - -/** - * Goes through entire EDL records and frees all memory. - * Assumes next_edl_record is valid or NULL. - * - * \brief Free EDL memory - */ - -void free_edl(edl_record_ptr next_edl_record) -{ - edl_record_ptr tmp; - while (next_edl_record) { - tmp = next_edl_record->next; - free(next_edl_record); - next_edl_record = tmp; - } -} - -/** Parses edl_filename to fill EDL operations queue. - * Prints out how many EDL operations recorded total. - * \brief Fills EDL operations queue. - */ - -edl_record_ptr edl_parse_file(void) -{ - FILE *fd; - char line[100]; - float start, stop; - int action; - int record_count = 0; - int lineCount = 0; - edl_record_ptr edl_records = NULL; - edl_record_ptr next_edl_record = NULL; - - if (edl_filename) - { - if ((fd = fopen(edl_filename, "r")) == NULL) - { - return NULL; - } - - while (fgets(line, 99, fd) != NULL) - { - lineCount++; - - if ((sscanf(line, "%f %f %d", &start, &stop, &action)) - != 3) - { - mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Badly formatted EDL line [%d], discarding.\n", - lineCount); - continue; - } - - if (next_edl_record && start <= next_edl_record->stop_sec) - { - mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Invalid EDL line: %s\n", line); - mp_tmsg(MSGT_CPLAYER, MSGL_WARN, - "Last stop position was [%f]; next start is [%f].\n"\ - "Entries must be in chronological order, cannot overlap. Discarding.\n", - next_edl_record->stop_sec, start); - continue; - } - - if (stop <= start) - { - mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Invalid EDL line: %s\n", - line); - mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "Stop time has to be after start time.\n"); - continue; - } - - next_edl_record = edl_alloc_new(next_edl_record); - - if (!edl_records) edl_records = next_edl_record; - - next_edl_record->action = action; - - if (action == EDL_MUTE) - { - next_edl_record->length_sec = 0; - next_edl_record->start_sec = start; - next_edl_record->stop_sec = start; - - next_edl_record = edl_alloc_new(next_edl_record); - - next_edl_record->action = action; - next_edl_record->length_sec = 0; - next_edl_record->start_sec = stop; - next_edl_record->stop_sec = stop; - } else - { - next_edl_record->length_sec = stop - start; - next_edl_record->start_sec = start; - next_edl_record->stop_sec = stop; - } - - record_count++; - } - - fclose(fd); - } - - if (edl_records) - mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Read %d EDL actions.\n", record_count); - else - mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "There are no EDL actions to take care of.\n"); - - return edl_records; -} diff --git a/edl.h b/edl.h deleted file mode 100644 index 8160acb952..0000000000 --- a/edl.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * EDL version 0.6 - * - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef MPLAYER_EDL_H -#define MPLAYER_EDL_H - -#define EDL_SKIP 0 -#define EDL_MUTE 1 - -#define EDL_MUTE_START 1 -#define EDL_MUTE_END 0 - -struct edl_record { - float start_sec; - float stop_sec; - float length_sec; - short action; - struct edl_record* next; - struct edl_record* prev; -}; - -typedef struct edl_record* edl_record_ptr; - -extern char *edl_filename; // file to extract EDL entries from (-edl) -extern char *edl_output_filename; // file to put EDL entries in (-edlout) - -void free_edl(edl_record_ptr next_edl_record); // free's entire EDL list. -edl_record_ptr edl_parse_file(void); // fills EDL stack - -#endif /* MPLAYER_EDL_H */ diff --git a/input/input.c b/input/input.c index 1d973c3aa6..008c908634 100644 --- a/input/input.c +++ b/input/input.c @@ -31,6 +31,8 @@ #include <ctype.h> #include <assert.h> +#include "osdep/io.h" + #include "input.h" #include "mp_fifo.h" #include "keycodes.h" @@ -1815,13 +1817,16 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf) #endif if (input_conf->in_file) { - struct stat st; - int mode = O_RDONLY | O_NONBLOCK; + int mode = O_RDONLY; +#ifndef __MINGW32__ // Use RDWR for FIFOs to ensure they stay open over multiple accesses. - // Note that on Windows stat may fail for named pipes, - // but due to how the API works, using RDONLY should be ok. + // Note that on Windows due to how the API works, using RDONLY should + // be ok. + struct stat st; if (stat(input_conf->in_file, &st) == 0 && S_ISFIFO(st.st_mode)) - mode = O_RDWR | O_NONBLOCK; + mode = O_RDWR; + mode |= O_NONBLOCK; +#endif int in_file_fd = open(input_conf->in_file, mode); if (in_file_fd >= 0) mp_input_add_cmd_fd(ictx, in_file_fd, 1, NULL, close); diff --git a/libao2/ao_dsound.c b/libao2/ao_dsound.c index a7d30ec357.. |