From subversion at mplayerhq.hu Thu Feb 2 03:55:02 2012 From: subversion at mplayerhq.hu (komh) Date: Thu, 2 Feb 2012 03:55:02 +0100 (CET) Subject: [MPlayer-cvslog] r34644 - trunk/libvo/vo_kva.c Message-ID: <20120202025503.12652137EFE@avserver.banki.hu> Author: komh Date: Thu Feb 2 03:55:02 2012 New Revision: 34644 Log: Add IMGFMT_BGR32 supports Modified: trunk/libvo/vo_kva.c Modified: trunk/libvo/vo_kva.c ============================================================================== --- trunk/libvo/vo_kva.c Tue Jan 31 19:17:17 2012 (r34643) +++ trunk/libvo/vo_kva.c Thu Feb 2 03:55:02 2012 (r34644) @@ -184,6 +184,13 @@ static int query_format_info(int format, nChromaShift = 2; break; + case IMGFMT_BGR32: + fHWAccel = m_int.kvac.ulInputFormatFlags & KVAF_BGR32; + fcc = FOURCC_BGR4; + bpp = 3; + nChromaShift = 0; + break; + case IMGFMT_BGR24: fHWAccel = m_int.kvac.ulInputFormatFlags & KVAF_BGR24; fcc = FOURCC_BGR3; @@ -701,6 +708,8 @@ static int config(uint32_t width, uint32 dstFormat = IMGFMT_YUY2; else if (m_int.kvac.ulInputFormatFlags & KVAF_YVU9) dstFormat = IMGFMT_YVU9; + else if (m_int.kvac.ulInputFormatFlags & KVAF_BGR32) + dstFormat = IMGFMT_BGR32; else if (m_int.kvac.ulInputFormatFlags & KVAF_BGR24) dstFormat = IMGFMT_BGR24; else if (m_int.kvac.ulInputFormatFlags & KVAF_BGR16) From subversion at mplayerhq.hu Thu Feb 2 03:56:50 2012 From: subversion at mplayerhq.hu (komh) Date: Thu, 2 Feb 2012 03:56:50 +0100 (CET) Subject: [MPlayer-cvslog] r34645 - in trunk: configure libvo/vo_kva.c Message-ID: <20120202025650.4DC97137741@avserver.banki.hu> Author: komh Date: Thu Feb 2 03:56:50 2012 New Revision: 34645 Log: Add VMAN-backend supports Modified: trunk/configure trunk/libvo/vo_kva.c Modified: trunk/configure ============================================================================== --- trunk/configure Thu Feb 2 03:55:02 2012 (r34644) +++ trunk/configure Thu Feb 2 03:56:50 2012 (r34645) @@ -5195,7 +5195,7 @@ echores "$matrixview" if os2 ; then -echocheck "KVA (SNAP/WarpOverlay!/DIVE)" +echocheck "KVA (SNAP/WarpOverlay!/VMAN/DIVE)" if test "$_kva" = auto; then _kva=no; header_check_broken os2.h kva.h -lkva && _kva=yes Modified: trunk/libvo/vo_kva.c ============================================================================== --- trunk/libvo/vo_kva.c Thu Feb 2 03:55:02 2012 (r34644) +++ trunk/libvo/vo_kva.c Thu Feb 2 03:56:50 2012 (r34645) @@ -56,7 +56,7 @@ #include "libmpcodecs/vf_scale.h" static const vo_info_t info = { - "SNAP/WarpOverlay!/DIVE video output", + "SNAP/WarpOverlay!/VMAN/DIVE video output", "kva", "KO Myung-Hun ", "" @@ -552,18 +552,20 @@ static int preinit(const char *arg) int fUseSnap = 0; int fUseWO = 0; + int fUseVman = 0; int fUseDive = 0; int fFixT23 = 0; const opt_t subopts[] = { {"snap", OPT_ARG_BOOL, &fUseSnap, NULL}, {"wo", OPT_ARG_BOOL, &fUseWO, NULL}, + {"vman", OPT_ARG_BOOL, &fUseVman, NULL}, {"dive", OPT_ARG_BOOL, &fUseDive, NULL}, {"t23", OPT_ARG_BOOL, &fFixT23, NULL}, {NULL, 0, NULL, NULL} }; - PCSZ pcszVideoModeStr[3] = {"DIVE", "WarpOverlay!", "SNAP"}; + PCSZ pcszVideoModeStr[3] = {"DIVE", "WarpOverlay!", "SNAP", "VMAN"}; if (subopt_parse(arg, subopts) != 0) return -1; @@ -620,13 +622,15 @@ static int preinit(const char *arg) m_int.pfnwpOldFrame = WinSubclassWindow(m_int.hwndFrame, NewFrameWndProc); - if (!!fUseSnap + !!fUseWO + !!fUseDive > 1) + if (!!fUseSnap + !!fUseWO + !!fUseVman + !!fUseDive > 1) mp_msg(MSGT_VO, MSGL_WARN,"KVA: Multiple mode specified!!!\n"); if (fUseSnap) kvaMode = KVAM_SNAP; else if (fUseWO) kvaMode = KVAM_WO; + else if (fUseVman) + kvaMode = KVAM_VMAN; else if (fUseDive) kvaMode = KVAM_DIVE; else From subversion at mplayerhq.hu Thu Feb 2 04:04:53 2012 From: subversion at mplayerhq.hu (komh) Date: Thu, 2 Feb 2012 04:04:53 +0100 (CET) Subject: [MPlayer-cvslog] r34646 - trunk/libvo/vo_kva.c Message-ID: <20120202030453.25BF3137E06@avserver.banki.hu> Author: komh Date: Thu Feb 2 04:04:52 2012 New Revision: 34646 Log: Fix bpp for IMGFMT_BGR32 Modified: trunk/libvo/vo_kva.c Modified: trunk/libvo/vo_kva.c ============================================================================== --- trunk/libvo/vo_kva.c Thu Feb 2 03:56:50 2012 (r34645) +++ trunk/libvo/vo_kva.c Thu Feb 2 04:04:52 2012 (r34646) @@ -187,7 +187,7 @@ static int query_format_info(int format, case IMGFMT_BGR32: fHWAccel = m_int.kvac.ulInputFormatFlags & KVAF_BGR32; fcc = FOURCC_BGR4; - bpp = 3; + bpp = 4; nChromaShift = 0; break; From subversion at mplayerhq.hu Thu Feb 2 19:26:17 2012 From: subversion at mplayerhq.hu (compn) Date: Thu, 2 Feb 2012 19:26:17 +0100 (CET) Subject: [MPlayer-cvslog] r34647 - trunk/etc/codecs.conf Message-ID: <20120202182618.0EA43137E2E@avserver.banki.hu> Author: compn Date: Thu Feb 2 19:26:17 2012 New Revision: 34647 Log: add media-100 qtx binary codec samples at https://ffmpeg.org/trac/ffmpeg/ticket/959 dtmt fourcc / isom untested (no sample). Modified: trunk/etc/codecs.conf Modified: trunk/etc/codecs.conf ============================================================================== --- trunk/etc/codecs.conf Thu Feb 2 04:04:52 2012 (r34646) +++ trunk/etc/codecs.conf Thu Feb 2 19:26:17 2012 (r34647) @@ -3109,6 +3109,14 @@ videocodec ffdnxhd ; quicktime codecs: +videocodec qtm100 + info "Media-100 iFinish Transcoder" + status working + fourcc dtPA,dtnt,dtmt ;dtmt untested + driver qtvideo + dll "M100WinTranscoder.qtx" + out UYVY + videocodec qt3ivx info "win32/quicktime 3IV1 (3ivx)" status working From subversion at mplayerhq.hu Fri Feb 3 14:38:42 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 3 Feb 2012 14:38:42 +0100 (CET) Subject: [MPlayer-cvslog] r34648 - in trunk/gui: cfg.c skin/font.c skin/skin.c util/string.c util/string.h Message-ID: <20120203133842.9AA0E1384BE@avserver.banki.hu> Author: ib Date: Fri Feb 3 14:38:42 2012 New Revision: 34648 Log: Add fgetstr() to read from files without end-of-line characters. Use it where fgets'ed lines are cleared of EOLs. Remove gfgets() and replace these calls by fgetstr(). Modified: trunk/gui/cfg.c trunk/gui/skin/font.c trunk/gui/skin/skin.c trunk/gui/util/string.c trunk/gui/util/string.h Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 2 19:26:17 2012 (r34647) +++ trunk/gui/cfg.c Fri Feb 3 14:38:42 2012 (r34648) @@ -223,27 +223,6 @@ static const m_option_t gui_opts[] = { { NULL, NULL, 0, 0, 0, 0, NULL } }; -static char *gfgets(char *str, int size, FILE *f) -{ - char *s, c; - - s = fgets(str, size, f); - - if (s) { - c = s[strlen(s) - 1]; - - if (c == '\n' || c == '\r') - s[strlen(s) - 1] = 0; - - c = s[strlen(s) - 1]; - - if (c == '\n' || c == '\r') - s[strlen(s) - 1] = 0; - } - - return s; -} - int cfg_gui_include(m_option_t *conf, const char *filename) { (void)conf; @@ -290,12 +269,12 @@ int cfg_read(void) char tmp[512]; plItem *item; - if (gfgets(tmp, 512, f) == NULL) + if (fgetstr(tmp, 512, f) == NULL) continue; item = calloc(1, sizeof(plItem)); item->path = strdup(tmp); - gfgets(tmp, 512, f); + fgetstr(tmp, 512, f); item->name = strdup(tmp); listSet(gtkAddPlItem, item); } @@ -315,7 +294,7 @@ int cfg_read(void) char tmp[512]; urlItem *item; - if (gfgets(tmp, 512, f) == NULL) + if (fgetstr(tmp, 512, f) == NULL) continue; item = calloc(1, sizeof(urlItem)); @@ -339,7 +318,7 @@ int cfg_read(void) while (!feof(f)) { char tmp[512]; - if (gfgets(tmp, 512, f) == NULL) + if (fgetstr(tmp, 512, f) == NULL) continue; fsHistory[i++] = gstrdup(tmp); Modified: trunk/gui/skin/font.c ============================================================================== --- trunk/gui/skin/font.c Thu Feb 2 19:26:17 2012 (r34647) +++ trunk/gui/skin/font.c Fri Feb 3 14:38:42 2012 (r34648) @@ -125,8 +125,7 @@ int fntRead(char *path, char *fname) return -3; } - while (fgets(buf, sizeof(buf), f)) { - buf[strcspn(buf, "\n\r")] = 0; // remove any kind of newline, if any + while (fgetstr(buf, sizeof(buf), f)) { strswap(buf, '\t', ' '); trim(buf); decomment(buf); Modified: trunk/gui/skin/skin.c ============================================================================== --- trunk/gui/skin/skin.c Thu Feb 2 19:26:17 2012 (r34647) +++ trunk/gui/skin/skin.c Fri Feb 3 14:38:42 2012 (r34648) @@ -1055,10 +1055,9 @@ int skinRead(char *sname) currWinName[0] = 0; linenumber = 0; - while (fgets(line, sizeof(line), skinFile)) { + while (fgetstr(line, sizeof(line), skinFile)) { linenumber++; - line[strcspn(line, "\n\r")] = 0; // remove any kind of newline, if any strswap(line, '\t', ' '); trim(line); decomment(line); Modified: trunk/gui/util/string.c ============================================================================== --- trunk/gui/util/string.c Thu Feb 2 19:26:17 2012 (r34647) +++ trunk/gui/util/string.c Fri Feb 3 14:38:42 2012 (r34648) @@ -16,7 +16,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include #include #include @@ -321,3 +320,26 @@ char *TranslateFilename(int how, char *f return fname; } + +/** + * @brief Read characters from @a file. + * + * @note Reading stops with '\\r', '\\n' or EOF. + * + * @param str pointer to a buffer to receive the read characters + * @param size number of characters read at the most (including a terminating null-character) + * @param file file to read from + * + * @return str (success) or NULL (error) + */ +char *fgetstr(char *str, int size, FILE *file) +{ + char *s; + + s = fgets(str, size, file); + + if (s) + s[strcspn(s, "\n\r")] = 0; + + return s; +} Modified: trunk/gui/util/string.h ============================================================================== --- trunk/gui/util/string.h Thu Feb 2 19:26:17 2012 (r34647) +++ trunk/gui/util/string.h Fri Feb 3 14:38:42 2012 (r34648) @@ -19,7 +19,10 @@ #ifndef MPLAYER_GUI_STRING_H #define MPLAYER_GUI_STRING_H +#include + char *decomment(char *in); +char *fgetstr(char *str, int size, FILE *file); int gstrcasecmp(const char *a, const char *b); char *gstrchr(const char *str, int c); int gstrcmp(const char *a, const char *b); From subversion at mplayerhq.hu Fri Feb 3 14:57:10 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 3 Feb 2012 14:57:10 +0100 (CET) Subject: [MPlayer-cvslog] r34649 - in trunk/gui: cfg.c cfg.h win32/wincfg.c Message-ID: <20120203135710.D6B9F1384E5@avserver.banki.hu> Author: ib Date: Fri Feb 3 14:57:10 2012 New Revision: 34649 Log: Make cfg_read() and cfg_write() void functions. There is no error handling other than instantly exiting MPlayer and the return values aren't used anywhere. Modified: trunk/gui/cfg.c trunk/gui/cfg.h trunk/gui/win32/wincfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Fri Feb 3 14:38:42 2012 (r34648) +++ trunk/gui/cfg.c Fri Feb 3 14:57:10 2012 (r34649) @@ -230,7 +230,7 @@ int cfg_gui_include(m_option_t *conf, co return m_config_parse_config_file(gui_conf, filename, 0); } -int cfg_read(void) +void cfg_read(void) { char *cfg; FILE *f; @@ -328,11 +328,9 @@ int cfg_read(void) } free(cfg); - - return 0; } -int cfg_write(void) +void cfg_write(void) { char *cfg; FILE *f; @@ -420,6 +418,4 @@ int cfg_write(void) } free(cfg); - - return 0; } Modified: trunk/gui/cfg.h ============================================================================== --- trunk/gui/cfg.h Fri Feb 3 14:38:42 2012 (r34648) +++ trunk/gui/cfg.h Fri Feb 3 14:57:10 2012 (r34649) @@ -90,7 +90,7 @@ extern char *skinName; extern char *fsHistory[5]; int cfg_gui_include(m_option_t *conf, const char *filename); -int cfg_read(void); -int cfg_write(void); +void cfg_read(void); +void cfg_write(void); #endif /* MPLAYER_GUI_CFG_H */ Modified: trunk/gui/win32/wincfg.c ============================================================================== --- trunk/gui/win32/wincfg.c Fri Feb 3 14:38:42 2012 (r34648) +++ trunk/gui/win32/wincfg.c Fri Feb 3 14:57:10 2012 (r34649) @@ -93,7 +93,7 @@ int cfg_gui_include(m_option_t *conf, co return m_config_parse_config_file(gui_conf, filename, 0); } -int cfg_read(void) +void cfg_read(void) { char *cfg = get_path("gui.conf"); @@ -106,10 +106,9 @@ int cfg_read(void) if (m_config_parse_config_file(gui_conf, cfg, 1) < 0) mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_ConfigFileError); free(cfg); - return 0; } -int cfg_write(void) +void cfg_write(void) { char *cfg = get_path("gui.conf"); FILE *f; @@ -134,5 +133,4 @@ int cfg_write(void) fclose(f); } free(cfg); - return 0; } From subversion at mplayerhq.hu Fri Feb 3 15:32:00 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 3 Feb 2012 15:32:00 +0100 (CET) Subject: [MPlayer-cvslog] r34650 - trunk/gui/cfg.c Message-ID: <20120203143200.2A881138497@avserver.banki.hu> Author: ib Date: Fri Feb 3 15:31:59 2012 New Revision: 34650 Log: Add some missing #includes to cfg.c. Sort them. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Fri Feb 3 14:57:10 2012 (r34649) +++ trunk/gui/cfg.c Fri Feb 3 15:31:59 2012 (r34650) @@ -16,8 +16,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include #include +#include #include #include "cfg.h" @@ -28,6 +28,7 @@ #include "config.h" #include "help_mp.h" #include "libmpcodecs/vd.h" +#include "libmpdemux/demuxer.h" #include "libvo/video_out.h" #include "libvo/x11_common.h" #include "mixer.h" @@ -37,6 +38,8 @@ #include "mplayer.h" #include "parser-cfg.h" #include "path.h" +#include "stream/stream.h" +#include "sub/ass_mp.h" #include "sub/font_load.h" #include "sub/sub.h" From subversion at mplayerhq.hu Fri Feb 3 21:33:32 2012 From: subversion at mplayerhq.hu (reimar) Date: Fri, 3 Feb 2012 21:33:32 +0100 (CET) Subject: [MPlayer-cvslog] r34651 - trunk/libmpcodecs/ad_ffmpeg.c Message-ID: <20120203203332.EBD2B138618@avserver.banki.hu> Author: reimar Date: Fri Feb 3 21:33:32 2012 New Revision: 34651 Log: Fix format string for -a52drc option. Modified: trunk/libmpcodecs/ad_ffmpeg.c Modified: trunk/libmpcodecs/ad_ffmpeg.c ============================================================================== --- trunk/libmpcodecs/ad_ffmpeg.c Fri Feb 3 15:31:59 2012 (r34650) +++ trunk/libmpcodecs/ad_ffmpeg.c Fri Feb 3 21:33:32 2012 (r34651) @@ -106,7 +106,7 @@ static int init(sh_audio_t *sh_audio) lavc_context = avcodec_alloc_context3(lavc_codec); sh_audio->context=lavc_context; - snprintf(tmpstr, sizeof(tmpstr), "%i", drc_level); + snprintf(tmpstr, sizeof(tmpstr), "%f", drc_level); av_dict_set(&opts, "drc_scale", tmpstr, 0); lavc_context->sample_rate = sh_audio->samplerate; lavc_context->bit_rate = sh_audio->i_bps * 8; From subversion at mplayerhq.hu Sat Feb 4 00:11:48 2012 From: subversion at mplayerhq.hu (iive) Date: Sat, 4 Feb 2012 00:11:48 +0100 (CET) Subject: [MPlayer-cvslog] r34652 - trunk/libao2/ao_pulse.c Message-ID: <20120203231148.C7656138265@avserver.banki.hu> Author: iive Date: Sat Feb 4 00:11:48 2012 New Revision: 34652 Log: Workaround a bug in Pulse Audio (http://pulseaudio.org/ticket/866) that causes 2 second delay while trying to drain the current stream. It seems that if we wait for the data to be played before calling the pa_stream_drain function, it would not block for the whole duration of its internal buffer, thus avoid the 2 seconds delay. The code of this workaround is already used in ao_jack and ao_sdl. Special thanks to Rune Heggtveit who did all the heavy lifting in finding a working solution. Modified: trunk/libao2/ao_pulse.c Modified: trunk/libao2/ao_pulse.c ============================================================================== --- trunk/libao2/ao_pulse.c Fri Feb 3 21:33:32 2012 (r34651) +++ trunk/libao2/ao_pulse.c Sat Feb 4 00:11:48 2012 (r34652) @@ -26,6 +26,7 @@ #include "config.h" #include "libaf/af_format.h" +#include "osdep/timer.h" #include "mp_msg.h" #include "audio_out.h" #include "audio_out_internal.h" @@ -249,6 +250,10 @@ fail: /** Destroy libao driver */ static void uninit(int immed) { if (stream && !immed) { + /* Workaround the bug in pa_stream_drain that causes + a delay of 2 second if the buffer is not empty */ + usec_sleep(get_delay() * 1000 * 1000); + pa_threaded_mainloop_lock(mainloop); waitop(pa_stream_drain(stream, success_cb, NULL)); } From subversion at mplayerhq.hu Sun Feb 5 22:20:51 2012 From: subversion at mplayerhq.hu (cehoyos) Date: Sun, 5 Feb 2012 22:20:51 +0100 (CET) Subject: [MPlayer-cvslog] r34653 - in trunk: codec-cfg.c etc/codecs.conf fmt-conversion.c libmpcodecs/img_format.c libmpcodecs/img_format.h libmpcodecs/mp_image.c libmpcodecs/vf_scale.c m_option.c Message-ID: <20120205212051.A60EC138778@avserver.banki.hu> Author: cehoyos Date: Sun Feb 5 22:20:51 2012 New Revision: 34653 Log: Support v408 and AYUV decoding via FFmpeg. Modified: trunk/codec-cfg.c trunk/etc/codecs.conf trunk/fmt-conversion.c trunk/libmpcodecs/img_format.c trunk/libmpcodecs/img_format.h trunk/libmpcodecs/mp_image.c trunk/libmpcodecs/vf_scale.c trunk/m_option.c Modified: trunk/codec-cfg.c ============================================================================== --- trunk/codec-cfg.c Sat Feb 4 00:11:48 2012 (r34652) +++ trunk/codec-cfg.c Sun Feb 5 22:20:51 2012 (r34653) @@ -188,6 +188,7 @@ static const struct { {"420P9", IMGFMT_420P9}, {"420A", IMGFMT_420A}, {"444P", IMGFMT_444P}, + {"444A", IMGFMT_444A}, {"422P", IMGFMT_422P}, {"411P", IMGFMT_411P}, {"440P", IMGFMT_440P}, Modified: trunk/etc/codecs.conf ============================================================================== --- trunk/etc/codecs.conf Sat Feb 4 00:11:48 2012 (r34652) +++ trunk/etc/codecs.conf Sun Feb 5 22:20:51 2012 (r34653) @@ -234,6 +234,22 @@ videocodec ffv308 dll v308 out 444P +videocodec ffv408 + info "FFmpeg Quicktime v408 packed 4:4:4:4" + status working + fourcc v408 + driver ffmpeg + dll v408 + out 444A + +videocodec ffayuv + info "FFmpeg Microsoft ayuv packed 4:4:4:4" + status working + fourcc AYUV + driver ffmpeg + dll ayuv + out 444A + videocodec ffyuv4 info "FFmpeg libquicktime yuv4 packed 4:2:0" status working Modified: trunk/fmt-conversion.c ============================================================================== --- trunk/fmt-conversion.c Sat Feb 4 00:11:48 2012 (r34652) +++ trunk/fmt-conversion.c Sun Feb 5 22:20:51 2012 (r34653) @@ -63,6 +63,7 @@ static const struct { {IMGFMT_BGR32, PIX_FMT_0RGB32}, {IMGFMT_BGRA, PIX_FMT_BGR0}, {IMGFMT_RGBA, PIX_FMT_RGB0}, + {IMGFMT_444A, PIX_FMT_YUVA444P}, #endif #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 20, 1) {IMGFMT_GBR24P, PIX_FMT_GBRP}, Modified: trunk/libmpcodecs/img_format.c ============================================================================== --- trunk/libmpcodecs/img_format.c Sat Feb 4 00:11:48 2012 (r34652) +++ trunk/libmpcodecs/img_format.c Sun Feb 5 22:20:51 2012 (r34653) @@ -79,6 +79,7 @@ const char *vo_format_name(int format) case IMGFMT_444P9_BE: return "Planar 444P 9-bit big-endian"; case IMGFMT_420A: return "Planar 420P with alpha"; case IMGFMT_444P: return "Planar 444P"; + case IMGFMT_444A: return "Planar 444P with alpha"; case IMGFMT_422P: return "Planar 422P"; case IMGFMT_411P: return "Planar 411P"; case IMGFMT_NV12: return "Planar NV12"; @@ -172,6 +173,10 @@ int mp_get_chroma_shift(int format, int break; } } else switch (format) { + case IMGFMT_444A: + xs = 0; + ys = 0; + break; case IMGFMT_420A: case IMGFMT_I420: case IMGFMT_IYUV: @@ -197,7 +202,7 @@ int mp_get_chroma_shift(int format, int if (y_shift) *y_shift = ys; if (component_bits) *component_bits = bits; bpp = 8 + ((16 >> xs) >> ys); - if (format == IMGFMT_420A) + if (format == IMGFMT_420A || format == IMGFMT_444A) bpp += 8; bpp *= (bits + 7) >> 3; return err ? 0 : bpp; Modified: trunk/libmpcodecs/img_format.h ============================================================================== --- trunk/libmpcodecs/img_format.h Sat Feb 4 00:11:48 2012 (r34652) +++ trunk/libmpcodecs/img_format.h Sun Feb 5 22:20:51 2012 (r34653) @@ -122,6 +122,8 @@ // 4:2:0 planar with alpha #define IMGFMT_420A 0x41303234 +// 4:4:4 planar with alpha +#define IMGFMT_444A 0x41343434 #define IMGFMT_444P16_LE 0x51343434 #define IMGFMT_444P16_BE 0x34343451 Modified: trunk/libmpcodecs/mp_image.c ============================================================================== --- trunk/libmpcodecs/mp_image.c Sat Feb 4 00:11:48 2012 (r34652) +++ trunk/libmpcodecs/mp_image.c Sun Feb 5 22:20:51 2012 (r34653) @@ -141,6 +141,7 @@ void mp_image_setfmt(mp_image_t* mpi,uns case IMGFMT_YV12: return; case IMGFMT_420A: + case IMGFMT_444A: case IMGFMT_IF09: mpi->num_planes=4; case IMGFMT_YVU9: Modified: trunk/libmpcodecs/vf_scale.c ============================================================================== --- trunk/libmpcodecs/vf_scale.c Sat Feb 4 00:11:48 2012 (r34652) +++ trunk/libmpcodecs/vf_scale.c Sun Feb 5 22:20:51 2012 (r34653) @@ -88,6 +88,7 @@ static const unsigned int outfmt_list[]= IMGFMT_420P9_LE, IMGFMT_420P9_BE, IMGFMT_420A, + IMGFMT_444A, IMGFMT_IYUV, IMGFMT_YVU9, IMGFMT_IF09, Modified: trunk/m_option.c ============================================================================== --- trunk/m_option.c Sat Feb 4 00:11:48 2012 (r34652) +++ trunk/m_option.c Sun Feb 5 22:20:51 2012 (r34653) @@ -1098,6 +1098,7 @@ static struct { {"420p16", IMGFMT_420P16}, {"420p10", IMGFMT_420P10}, {"420p9", IMGFMT_420P9}, + {"444a", IMGFMT_444A}, {"420a", IMGFMT_420A}, {"444p", IMGFMT_444P}, {"422p", IMGFMT_422P}, From subversion at mplayerhq.hu Mon Feb 6 07:30:12 2012 From: subversion at mplayerhq.hu (siretart) Date: Mon, 6 Feb 2012 07:30:12 +0100 (CET) Subject: [MPlayer-cvslog] r34654 - in trunk: libaf/af_lavcac3enc.c libmpcodecs/vf_lavc.c libmpcodecs/vf_screenshot.c libmpcodecs/vf_spp.c libmpcodecs/vf_uspp.c libmpdemux/demux_rtp_codec.cpp libmpdemux/demuxer.c libvo/vo_pn... Message-ID: <20120206063013.172FD1388A6@avserver.banki.hu> Author: siretart Date: Mon Feb 6 07:30:12 2012 New Revision: 34654 Log: Update deprecated avcodec_alloc_context()/avcodec_open() API calls Modified: trunk/libaf/af_lavcac3enc.c trunk/libmpcodecs/vf_lavc.c trunk/libmpcodecs/vf_screenshot.c trunk/libmpcodecs/vf_spp.c trunk/libmpcodecs/vf_uspp.c trunk/libmpdemux/demux_rtp_codec.cpp trunk/libmpdemux/demuxer.c trunk/libvo/vo_png.c trunk/sub/av_sub.c Modified: trunk/libaf/af_lavcac3enc.c ============================================================================== --- trunk/libaf/af_lavcac3enc.c Sun Feb 5 22:20:51 2012 (r34653) +++ trunk/libaf/af_lavcac3enc.c Mon Feb 6 07:30:12 2012 (r34654) @@ -99,7 +99,7 @@ static int control(struct af_instance_s s->lavc_actx->sample_fmt = AV_SAMPLE_FMT_S16; s->lavc_actx->bit_rate = bit_rate; - if(avcodec_open(s->lavc_actx, s->lavc_acodec) < 0) { + if(avcodec_open2(s->lavc_actx, s->lavc_acodec, NULL) < 0) { mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_CouldntOpenCodec, "ac3", bit_rate); return AF_ERROR; } @@ -282,7 +282,7 @@ static int af_open(af_instance_t* af){ return AF_ERROR; } - s->lavc_actx = avcodec_alloc_context(); + s->lavc_actx = avcodec_alloc_context3(NULL); if (!s->lavc_actx) { mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_CouldntAllocateLavcContext); return AF_ERROR; Modified: trunk/libmpcodecs/vf_lavc.c ============================================================================== --- trunk/libmpcodecs/vf_lavc.c Sun Feb 5 22:20:51 2012 (r34653) +++ trunk/libmpcodecs/vf_lavc.c Mon Feb 6 07:30:12 2012 (r34654) @@ -74,7 +74,7 @@ static int config(struct vf_instance *vf vf->priv->outbuf_size=10000+width*height; // must be enough! vf->priv->outbuf = malloc(vf->priv->outbuf_size); - if (avcodec_open(&lavc_venc_context, vf->priv->codec) != 0) { + if (avcodec_open2(&lavc_venc_context, vf->priv->codec, NULL) != 0) { mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantOpenCodec); return 0; } @@ -148,7 +148,7 @@ static int vf_open(vf_instance_t *vf, ch return 0; } - vf->priv->context=avcodec_alloc_context(); + vf->priv->context=avcodec_alloc_context3(vf->priv->codec); vf->priv->pic = avcodec_alloc_frame(); // TODO: parse args -> Modified: trunk/libmpcodecs/vf_screenshot.c ============================================================================== --- trunk/libmpcodecs/vf_screenshot.c Sun Feb 5 22:20:51 2012 (r34653) +++ trunk/libmpcodecs/vf_screenshot.c Mon Feb 6 07:30:12 2012 (r34654) @@ -300,9 +300,9 @@ static int vf_open(vf_instance_t *vf, ch vf->priv->buffer=0; vf->priv->outbuffer=0; vf->priv->ctx=0; - vf->priv->avctx = avcodec_alloc_context(); + vf->priv->avctx = avcodec_alloc_context3(NULL); avcodec_register_all(); - if (avcodec_open(vf->priv->avctx, avcodec_find_encoder(CODEC_ID_PNG))) { + if (avcodec_open2(vf->priv->avctx, avcodec_find_encoder(CODEC_ID_PNG), NULL)) { mp_msg(MSGT_VFILTER, MSGL_FATAL, "Could not open libavcodec PNG encoder\n"); return 0; } Modified: trunk/libmpcodecs/vf_spp.c ============================================================================== --- trunk/libmpcodecs/vf_spp.c Sun Feb 5 22:20:51 2012 (r34653) +++ trunk/libmpcodecs/vf_spp.c Mon Feb 6 07:30:12 2012 (r34654) @@ -578,7 +578,7 @@ static int vf_open(vf_instance_t *vf, ch init_avcodec(); - vf->priv->avctx= avcodec_alloc_context(); + vf->priv->avctx= avcodec_alloc_context3(NULL); dsputil_init(&vf->priv->dsp, vf->priv->avctx); vf->priv->log2_count= 3; Modified: trunk/libmpcodecs/vf_uspp.c ============================================================================== --- trunk/libmpcodecs/vf_uspp.c Sun Feb 5 22:20:51 2012 (r34653) +++ trunk/libmpcodecs/vf_uspp.c Mon Feb 6 07:30:12 2012 (r34654) @@ -224,7 +224,7 @@ static int config(struct vf_instance *vf AVCodecContext *avctx_enc; avctx_enc= - vf->priv->avctx_enc[i]= avcodec_alloc_context(); + vf->priv->avctx_enc[i]= avcodec_alloc_context3(NULL); avctx_enc->width = width + BLOCK; avctx_enc->height = height + BLOCK; avctx_enc->time_base= (AVRational){1,25}; // meaningless @@ -234,7 +234,7 @@ static int config(struct vf_instance *vf avctx_enc->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_LOW_DELAY; avctx_enc->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; avctx_enc->global_quality= 123; - avcodec_open(avctx_enc, enc); + avcodec_open2(avctx_enc, enc, NULL); assert(avctx_enc->codec); } vf->priv->frame= avcodec_alloc_frame(); Modified: trunk/libmpdemux/demux_rtp_codec.cpp ============================================================================== --- trunk/libmpdemux/demux_rtp_codec.cpp Sun Feb 5 22:20:51 2012 (r34653) +++ trunk/libmpdemux/demux_rtp_codec.cpp Mon Feb 6 07:30:12 2012 (r34654) @@ -141,7 +141,7 @@ void rtpCodecInitialize_video(demuxer_t* const uint8_t* fooData; avcodec_register_all(); h264parserctx = av_parser_init(CODEC_ID_H264); - avcctx = avcodec_alloc_context(); + avcctx = avcodec_alloc_context3(NULL); // Pass the config to the parser h264parserctx->parser->parser_parse(h264parserctx, avcctx, &fooData, &fooLen, configData, configLen); Modified: trunk/libmpdemux/demuxer.c ============================================================================== --- trunk/libmpdemux/demuxer.c Sun Feb 5 22:20:51 2012 (r34653) +++ trunk/libmpdemux/demuxer.c Mon Feb 6 07:30:12 2012 (r34654) @@ -529,7 +529,7 @@ static void allocate_parser(AVCodecConte break; } if (codec_id != CODEC_ID_NONE) { - *avctx = avcodec_alloc_context(); + *avctx = avcodec_alloc_context3(NULL); if (!*avctx) return; *parser = av_parser_init(codec_id); Modified: trunk/libvo/vo_png.c ============================================================================== --- trunk/libvo/vo_png.c Sun Feb 5 22:20:51 2012 (r34653) +++ trunk/libvo/vo_png.c Mon Feb 6 07:30:12 2012 (r34654) @@ -232,8 +232,8 @@ static int preinit(const char *arg) return -1; } avcodec_register_all(); - avctx = avcodec_alloc_context(); - if (avcodec_open(avctx, avcodec_find_encoder(CODEC_ID_PNG)) < 0) { + avctx = avcodec_alloc_context3(NULL); + if (avcodec_open2(avctx, avcodec_find_encoder(CODEC_ID_PNG), NULL) < 0) { uninit(); return -1; } Modified: trunk/sub/av_sub.c ============================================================================== --- trunk/sub/av_sub.c Sun Feb 5 22:20:51 2012 (r34653) +++ trunk/sub/av_sub.c Mon Feb 6 07:30:12 2012 (r34654) @@ -65,9 +65,9 @@ int decode_avsub(struct sh_sub *sh, uint if (!ctx) { AVCodec *sub_codec; init_avcodec(); - ctx = avcodec_alloc_context(); + ctx = avcodec_alloc_context3(NULL); sub_codec = avcodec_find_decoder(cid); - if (!ctx || !sub_codec || avcodec_open(ctx, sub_codec) < 0) { + if (!ctx || !sub_codec || avcodec_open2(ctx, sub_codec, NULL) < 0) { mp_msg(MSGT_SUBREADER, MSGL_FATAL, "Could not open subtitle decoder\n"); av_freep(&ctx); From subversion at mplayerhq.hu Tue Feb 7 13:27:23 2012 From: subversion at mplayerhq.hu (cigaes) Date: Tue, 7 Feb 2012 13:27:23 +0100 (CET) Subject: [MPlayer-cvslog] r34655 - in trunk: Makefile configure Message-ID: <20120207122723.D649113A05A@avserver.banki.hu> Author: cigaes Date: Tue Feb 7 13:27:23 2012 New Revision: 34655 Log: build: fix lavfi dependencies (swscale and swresample). Modified: trunk/Makefile trunk/configure Modified: trunk/Makefile ============================================================================== --- trunk/Makefile Mon Feb 6 07:30:12 2012 (r34654) +++ trunk/Makefile Tue Feb 7 13:27:23 2012 (r34655) @@ -689,7 +689,8 @@ SRCS_MENCODER = mencoder.c \ $(SRCS_MENCODER-yes) # (linking) order matters for these libraries -FFMPEGPARTS = libpostproc libswscale libavfilter libavformat libavcodec libavutil +FFMPEGPARTS_ALL = libpostproc libavfilter libavformat libavcodec libswscale libswresample libavutil +FFMPEGPARTS = $(foreach part, $(FFMPEGPARTS_ALL), $(if $(wildcard ffmpeg/$(part)), $(part))) FFMPEGLIBS = $(foreach part, $(FFMPEGPARTS), ffmpeg/$(part)/$(part).a) FFMPEGFILES = $(foreach part, $(FFMPEGPARTS), $(wildcard $(addprefix ffmpeg/$(part)/,*.[chS] /*/*.[chS] /*/*.asm))) Modified: trunk/configure ============================================================================== --- trunk/configure Mon Feb 6 07:30:12 2012 (r34654) +++ trunk/configure Tue Feb 7 13:27:23 2012 (r34655) @@ -8160,6 +8160,7 @@ CONFIG_AVFORMAT = $ffmpeg_a CONFIG_AVUTIL = $ffmpeg_a CONFIG_POSTPROC = $ffmpeg_a CONFIG_SWSCALE = $ffmpeg_a +CONFIG_SWRESAMPLE = $ffmpeg_a ASFLAGS = \$(CFLAGS) AS_DEPFLAGS= $DEPFLAGS From subversion at mplayerhq.hu Tue Feb 7 15:07:54 2012 From: subversion at mplayerhq.hu (siretart) Date: Tue, 7 Feb 2012 15:07:54 +0100 (CET) Subject: [MPlayer-cvslog] r34656 - trunk/debian/rules Message-ID: <20120207140754.1393213A22E@avserver.banki.hu> Author: siretart Date: Tue Feb 7 15:07:53 2012 New Revision: 34656 Log: enable radio support, addresses https://launchpad.net/bugs/593548 Modified: trunk/debian/rules Modified: trunk/debian/rules ============================================================================== --- trunk/debian/rules Tue Feb 7 13:27:23 2012 (r34655) +++ trunk/debian/rules Tue Feb 7 15:07:53 2012 (r34656) @@ -44,6 +44,7 @@ CONFIGURE_FLAGS = \ --confdir=/etc/mplayer \ --enable-xvmc \ --enable-menu \ + --enable-radio --enable-radio-capture \ --disable-arts \ --language=all \ $(archconf) From subversion at mplayerhq.hu Tue Feb 7 15:52:23 2012 From: subversion at mplayerhq.hu (siretart) Date: Tue, 7 Feb 2012 15:52:23 +0100 (CET) Subject: [MPlayer-cvslog] r34657 - trunk/libmpcodecs/vf_lavfi.c Message-ID: <20120207145223.C50CC13A313@avserver.banki.hu> Author: siretart Date: Tue Feb 7 15:52:23 2012 New Revision: 34657 Log: Add missing libavutil #include. Modified: trunk/libmpcodecs/vf_lavfi.c Modified: trunk/libmpcodecs/vf_lavfi.c ============================================================================== --- trunk/libmpcodecs/vf_lavfi.c Tue Feb 7 15:07:53 2012 (r34656) +++ trunk/libmpcodecs/vf_lavfi.c Tue Feb 7 15:52:23 2012 (r34657) @@ -24,6 +24,7 @@ #include "mp_msg.h" #include "libavfilter/avfilter.h" #include "libavfilter/avfiltergraph.h" +#include "libavutil/mathematics.h" #include "libavutil/pixdesc.h" struct vf_priv_s { From subversion at mplayerhq.hu Tue Feb 7 22:56:46 2012 From: subversion at mplayerhq.hu (cehoyos) Date: Tue, 7 Feb 2012 22:56:46 +0100 (CET) Subject: [MPlayer-cvslog] r34658 - trunk/libvo/vo_x11.c Message-ID: <20120207215646.624A913A96C@avserver.banki.hu> Author: cehoyos Date: Tue Feb 7 22:56:45 2012 New Revision: 34658 Log: X11 non-native RGB/BGR "emulation" only works for 32bit. Modified: trunk/libvo/vo_x11.c Modified: trunk/libvo/vo_x11.c ============================================================================== --- trunk/libvo/vo_x11.c Tue Feb 7 15:52:23 2012 (r34657) +++ trunk/libvo/vo_x11.c Tue Feb 7 22:56:45 2012 (r34658) @@ -425,9 +425,8 @@ static int config(uint32_t width, uint32 draw_alpha_fnc = draw_alpha_null; } out_offset = 0; - // for these formats conversion is currently not support and - // we can easily "emulate" them. - if (out_format & 64 && (IMGFMT_IS_RGB(out_format) || IMGFMT_IS_BGR(out_format))) { + // We can easily "emulate" non-native RGB32 and BGR32 + if (out_format == (IMGFMT_BGR32 | 64) || out_format == (IMGFMT_RGB32 | 64)) { out_format &= ~64; #if HAVE_BIGENDIAN out_offset = 1; From subversion at mplayerhq.hu Tue Feb 7 23:07:09 2012 From: subversion at mplayerhq.hu (cehoyos) Date: Tue, 7 Feb 2012 23:07:09 +0100 (CET) Subject: [MPlayer-cvslog] r34659 - in trunk: libmpcodecs/img_format.h libvo/vo_x11.c Message-ID: <20120207220709.A909913A97D@avserver.banki.hu> Author: cehoyos Date: Tue Feb 7 23:07:09 2012 New Revision: 34659 Log: Use 128 instead of 64 to define non-native RGB image formats. Modified: trunk/libmpcodecs/img_format.h trunk/libvo/vo_x11.c Modified: trunk/libmpcodecs/img_format.h ============================================================================== --- trunk/libmpcodecs/img_format.h Tue Feb 7 22:56:45 2012 (r34658) +++ trunk/libmpcodecs/img_format.h Tue Feb 7 23:07:09 2012 (r34659) @@ -53,39 +53,39 @@ #if HAVE_BIGENDIAN #define IMGFMT_ABGR IMGFMT_RGB32 -#define IMGFMT_BGRA (IMGFMT_RGB32|64) +#define IMGFMT_BGRA (IMGFMT_RGB32|128) #define IMGFMT_ARGB IMGFMT_BGR32 -#define IMGFMT_RGBA (IMGFMT_BGR32|64) +#define IMGFMT_RGBA (IMGFMT_BGR32|128) #define IMGFMT_RGB48NE IMGFMT_RGB48BE #define IMGFMT_RGB12BE IMGFMT_RGB12 -#define IMGFMT_RGB12LE (IMGFMT_RGB12|64) +#define IMGFMT_RGB12LE (IMGFMT_RGB12|128) #define IMGFMT_RGB15BE IMGFMT_RGB15 -#define IMGFMT_RGB15LE (IMGFMT_RGB15|64) +#define IMGFMT_RGB15LE (IMGFMT_RGB15|128) #define IMGFMT_RGB16BE IMGFMT_RGB16 -#define IMGFMT_RGB16LE (IMGFMT_RGB16|64) +#define IMGFMT_RGB16LE (IMGFMT_RGB16|128) #define IMGFMT_BGR12BE IMGFMT_BGR12 -#define IMGFMT_BGR12LE (IMGFMT_BGR12|64) +#define IMGFMT_BGR12LE (IMGFMT_BGR12|128) #define IMGFMT_BGR15BE IMGFMT_BGR15 -#define IMGFMT_BGR15LE (IMGFMT_BGR15|64) +#define IMGFMT_BGR15LE (IMGFMT_BGR15|128) #define IMGFMT_BGR16BE IMGFMT_BGR16 -#define IMGFMT_BGR16LE (IMGFMT_BGR16|64) +#define IMGFMT_BGR16LE (IMGFMT_BGR16|128) #else -#define IMGFMT_ABGR (IMGFMT_BGR32|64) +#define IMGFMT_ABGR (IMGFMT_BGR32|128) #define IMGFMT_BGRA IMGFMT_BGR32 -#define IMGFMT_ARGB (IMGFMT_RGB32|64) +#define IMGFMT_ARGB (IMGFMT_RGB32|128) #define IMGFMT_RGBA IMGFMT_RGB32 #define IMGFMT_RGB48NE IMGFMT_RGB48LE -#define IMGFMT_RGB12BE (IMGFMT_RGB12|64) +#define IMGFMT_RGB12BE (IMGFMT_RGB12|128) #define IMGFMT_RGB12LE IMGFMT_RGB12 -#define IMGFMT_RGB15BE (IMGFMT_RGB15|64) +#define IMGFMT_RGB15BE (IMGFMT_RGB15|128) #define IMGFMT_RGB15LE IMGFMT_RGB15 -#define IMGFMT_RGB16BE (IMGFMT_RGB16|64) +#define IMGFMT_RGB16BE (IMGFMT_RGB16|128) #define IMGFMT_RGB16LE IMGFMT_RGB16 -#define IMGFMT_BGR12BE (IMGFMT_BGR12|64) +#define IMGFMT_BGR12BE (IMGFMT_BGR12|128) #define IMGFMT_BGR12LE IMGFMT_BGR12 -#define IMGFMT_BGR15BE (IMGFMT_BGR15|64) +#define IMGFMT_BGR15BE (IMGFMT_BGR15|128) #define IMGFMT_BGR15LE IMGFMT_BGR15 -#define IMGFMT_BGR16BE (IMGFMT_BGR16|64) +#define IMGFMT_BGR16BE (IMGFMT_BGR16|128) #define IMGFMT_BGR16LE IMGFMT_BGR16 #endif Modified: trunk/libvo/vo_x11.c ============================================================================== --- trunk/libvo/vo_x11.c Tue Feb 7 22:56:45 2012 (r34658) +++ trunk/libvo/vo_x11.c Tue Feb 7 23:07:09 2012 (r34659) @@ -426,8 +426,8 @@ static int config(uint32_t width, uint32 } out_offset = 0; // We can easily "emulate" non-native RGB32 and BGR32 - if (out_format == (IMGFMT_BGR32 | 64) || out_format == (IMGFMT_RGB32 | 64)) { - out_format &= ~64; + if (out_format == (IMGFMT_BGR32 | 128) || out_format == (IMGFMT_RGB32 | 128)) { + out_format &= ~128; #if HAVE_BIGENDIAN out_offset = 1; #else From subversion at mplayerhq.hu Wed Feb 8 00:04:30 2012 From: subversion at mplayerhq.hu (cehoyos) Date: Wed, 8 Feb 2012 00:04:30 +0100 (CET) Subject: [MPlayer-cvslog] r34660 - in trunk: codec-cfg.c etc/codecs.conf fmt-conversion.c libmpcodecs/img_format.c libmpcodecs/img_format.h libvo/gl_common.c m_option.c Message-ID: <20120207230430.CB73F13AA1B@avserver.banki.hu> Author: cehoyos Date: Wed Feb 8 00:04:30 2012 New Revision: 34660 Log: Support displaying 64bit RGB via OpenGL. Modified: trunk/codec-cfg.c trunk/etc/codecs.conf trunk/fmt-conversion.c trunk/libmpcodecs/img_format.c trunk/libmpcodecs/img_format.h trunk/libvo/gl_common.c trunk/m_option.c Modified: trunk/codec-cfg.c ============================================================================== --- trunk/codec-cfg.c Tue Feb 7 23:07:09 2012 (r34659) +++ trunk/codec-cfg.c Wed Feb 8 00:04:30 2012 (r34660) @@ -199,6 +199,8 @@ static const struct { {"UYVY", IMGFMT_UYVY}, {"YVYU", IMGFMT_YVYU}, + {"RGB64LE", IMGFMT_RGB64LE}, + {"RGB64BE", IMGFMT_RGB64BE}, {"RGB48LE", IMGFMT_RGB48LE}, {"RGB48BE", IMGFMT_RGB48BE}, {"RGB4", IMGFMT_RGB4}, Modified: trunk/etc/codecs.conf ============================================================================== --- trunk/etc/codecs.conf Tue Feb 7 23:07:09 2012 (r34659) +++ trunk/etc/codecs.conf Wed Feb 8 00:04:30 2012 (r34660) @@ -579,7 +579,7 @@ videocodec ffdpx fourcc "dpx " ; "dpx " is an internal MPlayer FOURCC driver ffmpeg dll dpx - out RGB48BE,RGB48LE,RGB24,RGBA + out RGB64BE,RGB64LE,RGB48BE,RGB48LE,RGB24,RGBA videocodec ffgif info "FFmpeg GIF" @@ -595,7 +595,7 @@ videocodec fftiff fourcc "tiff" ; for TIFF-encoded QuickTime files driver ffmpeg dll tiff - out BGR8,Y800,RGB48BE,RGB48LE,RGBA,RGB32,RGB24 + out BGR32,BGR24,BGR8,Y800,RGB64LE,RGB64BE,RGB32,RGB24,RGB8 videocodec ffpcx info "FFmpeg PCX" @@ -612,7 +612,7 @@ videocodec ffpng fourcc "png " ; for PNG-encoded QuickTime files driver ffmpeg dll png - out BGR32,BGR8,Y800,RGB48BE,RGBA,RGB24 + out BGR32,BGR8,Y800,RGB64BE,RGB48BE,RGBA,RGB24 videocodec mpng info "PNG image" @@ -655,7 +655,7 @@ videocodec ffsgi fourcc SGI1 ; SGI1 is an internal MPlayer FOURCC driver ffmpeg dll sgi - out RGB24,Y800,RGB48BE,RGBA + out RGB24,Y800,RGB64BE,RGB48BE,RGBA videocodec sgi info "SGI image" @@ -1798,6 +1798,7 @@ videocodec fflibopenjpeg fourcc mjp2 driver ffmpeg dll "libopenjpeg" + out RGB64LE,RGB64BE out RGB24,RGB32,BGR32,Y8,Y800 out 420P16,420P10,420P9 out 422P16,422P10,422P9 Modified: trunk/fmt-conversion.c ============================================================================== --- trunk/fmt-conversion.c Tue Feb 7 23:07:09 2012 (r34659) +++ trunk/fmt-conversion.c Wed Feb 8 00:04:30 2012 (r34660) @@ -63,6 +63,8 @@ static const struct { {IMGFMT_BGR32, PIX_FMT_0RGB32}, {IMGFMT_BGRA, PIX_FMT_BGR0}, {IMGFMT_RGBA, PIX_FMT_RGB0}, + {IMGFMT_RGB64LE, PIX_FMT_RGBA64LE}, + {IMGFMT_RGB64BE, PIX_FMT_RGBA64BE}, {IMGFMT_444A, PIX_FMT_YUVA444P}, #endif #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 20, 1) Modified: trunk/libmpcodecs/img_format.c ============================================================================== --- trunk/libmpcodecs/img_format.c Tue Feb 7 23:07:09 2012 (r34659) +++ trunk/libmpcodecs/img_format.c Wed Feb 8 00:04:30 2012 (r34660) @@ -37,6 +37,8 @@ const char *vo_format_name(int format) // case IMGFMT_RGB32: return "RGB 32-bit"; case IMGFMT_RGB48LE: return "RGB 48-bit LE"; case IMGFMT_RGB48BE: return "RGB 48-bit BE"; + case IMGFMT_RGB64LE: return "RGB 64-bit LE"; + case IMGFMT_RGB64BE: return "RGB 64-bit BE"; case IMGFMT_BGR1: return "BGR 1-bit"; case IMGFMT_BGR4: return "BGR 4-bit"; case IMGFMT_BG4B: return "BGR 4-bit per byte"; Modified: trunk/libmpcodecs/img_format.h ============================================================================== --- trunk/libmpcodecs/img_format.h Tue Feb 7 23:07:09 2012 (r34659) +++ trunk/libmpcodecs/img_format.h Wed Feb 8 00:04:30 2012 (r34660) @@ -36,6 +36,8 @@ #define IMGFMT_RGB32 (IMGFMT_RGB|32) #define IMGFMT_RGB48LE (IMGFMT_RGB|48) #define IMGFMT_RGB48BE (IMGFMT_RGB|48|128) +#define IMGFMT_RGB64LE (IMGFMT_RGB|64) +#define IMGFMT_RGB64BE (IMGFMT_RGB|64|128) #define IMGFMT_BGR_MASK 0xFFFFFF00 #define IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8)) @@ -56,6 +58,7 @@ #define IMGFMT_BGRA (IMGFMT_RGB32|128) #define IMGFMT_ARGB IMGFMT_BGR32 #define IMGFMT_RGBA (IMGFMT_BGR32|128) +#define IMGFMT_RGB64NE IMGFMT_RGB64BE #define IMGFMT_RGB48NE IMGFMT_RGB48BE #define IMGFMT_RGB12BE IMGFMT_RGB12 #define IMGFMT_RGB12LE (IMGFMT_RGB12|128) @@ -74,6 +77,7 @@ #define IMGFMT_BGRA IMGFMT_BGR32 #define IMGFMT_ARGB (IMGFMT_RGB32|128) #define IMGFMT_RGBA IMGFMT_RGB32 +#define IMGFMT_RGB64NE IMGFMT_RGB64LE #define IMGFMT_RGB48NE IMGFMT_RGB48LE #define IMGFMT_RGB12BE (IMGFMT_RGB12|128) #define IMGFMT_RGB12LE IMGFMT_RGB12 @@ -96,8 +100,8 @@ #define IMGFMT_IS_RGB(fmt) (((fmt)&IMGFMT_RGB_MASK)==IMGFMT_RGB) #define IMGFMT_IS_BGR(fmt) (((fmt)&IMGFMT_BGR_MASK)==IMGFMT_BGR) -#define IMGFMT_RGB_DEPTH(fmt) ((fmt)&0x3F) -#define IMGFMT_BGR_DEPTH(fmt) ((fmt)&0x3F) +#define IMGFMT_RGB_DEPTH(fmt) ((fmt)&0x7F) +#define IMGFMT_BGR_DEPTH(fmt) ((fmt)&0x7F) /* Planar YUV Formats */ Modified: trunk/libvo/gl_common.c ============================================================================== --- trunk/libvo/gl_common.c Tue Feb 7 23:07:09 2012 (r34659) +++ trunk/libvo/gl_common.c Wed Feb 8 00:04:30 2012 (r34660) @@ -272,6 +272,8 @@ int glFindFormat(uint32_t fmt, int *bpp, *bpp = IMGFMT_IS_BGR(fmt)?IMGFMT_BGR_DEPTH(fmt):IMGFMT_RGB_DEPTH(fmt); *gl_texfmt = 3; switch (fmt) { + case IMGFMT_RGB64NE: + *gl_texfmt = 4; case IMGFMT_RGB48NE: *gl_format = GL_RGB; *gl_type = GL_UNSIGNED_SHORT; Modified: trunk/m_option.c ============================================================================== --- trunk/m_option.c Tue Feb 7 23:07:09 2012 (r34659) +++ trunk/m_option.c Wed Feb 8 00:04:30 2012 (r34660) @@ -1127,6 +1127,8 @@ static struct { {"bgr4", IMGFMT_BGR4}, {"bg4b", IMGFMT_BG4B}, {"bgr1", IMGFMT_BGR1}, + {"rgb64be", IMGFMT_RGB64BE}, + {"rgb64le", IMGFMT_RGB64LE}, {"rgb48be", IMGFMT_RGB48BE}, {"rgb48le", IMGFMT_RGB48LE}, {"rgb48ne", IMGFMT_RGB48NE}, From subversion at mplayerhq.hu Wed Feb 8 00:09:53 2012 From: subversion at mplayerhq.hu (cehoyos) Date: Wed, 8 Feb 2012 00:09:53 +0100 (CET) Subject: [MPlayer-cvslog] r34661 - trunk/etc/codecs.conf Message-ID: <20120207230953.141EB13AA33@avserver.banki.hu> Author: cehoyos Date: Wed Feb 8 00:09:52 2012 New Revision: 34661 Log: Support RGB48 tiff decoding. Modified: trunk/etc/codecs.conf Modified: trunk/etc/codecs.conf ============================================================================== --- trunk/etc/codecs.conf Wed Feb 8 00:04:30 2012 (r34660) +++ trunk/etc/codecs.conf Wed Feb 8 00:09:52 2012 (r34661) @@ -595,7 +595,7 @@ videocodec fftiff fourcc "tiff" ; for TIFF-encoded QuickTime files driver ffmpeg dll tiff - out BGR32,BGR24,BGR8,Y800,RGB64LE,RGB64BE,RGB32,RGB24,RGB8 + out BGR32,BGR24,BGR8,Y800,RGB64LE,RGB64BE,RGB48LE,RGB48BE,RGB32,RGB24,RGB8 videocodec ffpcx info "FFmpeg PCX" From subversion at mplayerhq.hu Thu Feb 9 13:52:10 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 13:52:10 +0100 (CET) Subject: [MPlayer-cvslog] r34664 - in trunk/gui: cfg.c win32/wincfg.c Message-ID: <20120209125210.1868F13C29F@avserver.banki.hu> Author: ib Date: Thu Feb 9 13:52:09 2012 New Revision: 34664 Log: Replace string constants by symbolic constants. This allows definition at one single location. Modified: trunk/gui/cfg.c trunk/gui/win32/wincfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 13:43:09 2012 (r34663) +++ trunk/gui/cfg.c Thu Feb 9 13:52:09 2012 (r34664) @@ -43,6 +43,11 @@ #include "sub/font_load.h" #include "sub/sub.h" +#define GUI_CONFIGURATION "gui.conf" +#define GUI_HISTORY "gui.history" +#define GUI_PLAYLIST "gui.pl" +#define GUI_URLLIST "gui.url" + m_config_t *gui_conf; int gtkCacheOn; @@ -242,7 +247,7 @@ void cfg_read(void) // configuration - cfg = get_path("gui.conf"); + cfg = get_path(GUI_CONFIGURATION); mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[cfg] file: %s\n", cfg); @@ -264,7 +269,7 @@ void cfg_read(void) // playlist - cfg = get_path("gui.pl"); + cfg = get_path(GUI_PLAYLIST); f = fopen(cfg, "rt"); if (f) { @@ -289,7 +294,7 @@ void cfg_read(void) // URL list - cfg = get_path("gui.url"); + cfg = get_path(GUI_URLLIST); f = fopen(cfg, "rt"); if (f) { @@ -312,7 +317,7 @@ void cfg_read(void) // directory history - cfg = get_path("gui.history"); + cfg = get_path(GUI_HISTORY); f = fopen(cfg, "rt+"); if (f) { @@ -341,7 +346,7 @@ void cfg_write(void) // configuration - cfg = get_path("gui.conf"); + cfg = get_path(GUI_CONFIGURATION); f = fopen(cfg, "wt+"); if (f) { @@ -366,7 +371,7 @@ void cfg_write(void) // playlist - cfg = get_path("gui.pl"); + cfg = get_path(GUI_PLAYLIST); f = fopen(cfg, "wt+"); if (f) { @@ -388,7 +393,7 @@ void cfg_write(void) // URL list - cfg = get_path("gui.url"); + cfg = get_path(GUI_URLLIST); f = fopen(cfg, "wt+"); if (f) { @@ -406,7 +411,7 @@ void cfg_write(void) // directory history - cfg = get_path("gui.history"); + cfg = get_path(GUI_HISTORY); f = fopen(cfg, "wt+"); if (f) { Modified: trunk/gui/win32/wincfg.c ============================================================================== --- trunk/gui/win32/wincfg.c Thu Feb 9 13:43:09 2012 (r34663) +++ trunk/gui/win32/wincfg.c Thu Feb 9 13:52:09 2012 (r34664) @@ -38,6 +38,8 @@ #include "gui/interface.h" #include "gui.h" +#define GUI_CONFIGURATION "gui.conf" + /* params */ int gtkAONorm = 0; int gtkAOExtraStereo = 0; @@ -95,7 +97,7 @@ int cfg_gui_include(m_option_t *conf, co void cfg_read(void) { - char *cfg = get_path("gui.conf"); + char *cfg = get_path(GUI_CONFIGURATION); player_idle_mode = 1; // GUI is in idle mode by default @@ -110,7 +112,7 @@ void cfg_read(void) void cfg_write(void) { - char *cfg = get_path("gui.conf"); + char *cfg = get_path(GUI_CONFIGURATION); FILE *f; int i; From subversion at mplayerhq.hu Thu Feb 9 14:25:05 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 14:25:05 +0100 (CET) Subject: [MPlayer-cvslog] r34665 - in trunk/gui: cfg.c win32/wincfg.c Message-ID: <20120209132505.4FC7813C2D0@avserver.banki.hu> Author: ib Date: Thu Feb 9 14:25:05 2012 New Revision: 34665 Log: In case of a GUI config error, exit MPlayer with error. Additionally, add missing newline to error message and adjust Win32 message level to MSGL_ERR. Modified: trunk/gui/cfg.c trunk/gui/win32/wincfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 13:52:09 2012 (r34664) +++ trunk/gui/cfg.c Thu Feb 9 14:25:05 2012 (r34665) @@ -261,8 +261,8 @@ void cfg_read(void) m_config_register_options(gui_conf, gui_opts); if (!disable_gui_conf && (m_config_parse_config_file(gui_conf, cfg, 1) < 0)) { - gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_ConfigFileError); -// mplayer(MPLAYER_EXIT_GUI, 1, 0); + gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_ConfigFileError "\n"); + mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); } free(cfg); Modified: trunk/gui/win32/wincfg.c ============================================================================== --- trunk/gui/win32/wincfg.c Thu Feb 9 13:52:09 2012 (r34664) +++ trunk/gui/win32/wincfg.c Thu Feb 9 14:25:05 2012 (r34665) @@ -106,7 +106,7 @@ void cfg_read(void) gui_conf = m_config_new(); m_config_register_options(gui_conf, gui_opts); if (m_config_parse_config_file(gui_conf, cfg, 1) < 0) - mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_ConfigFileError); + mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_ConfigFileError "\n"); free(cfg); } From subversion at mplayerhq.hu Thu Feb 9 14:43:23 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 14:43:23 +0100 (CET) Subject: [MPlayer-cvslog] r34666 - in trunk/gui: cfg.c skin/font.c skin/skin.c Message-ID: <20120209134323.7952113C2D6@avserver.banki.hu> Author: ib Date: Thu Feb 9 14:43:23 2012 New Revision: 34666 Log: Cosmetic: Change some variable names. Modified: trunk/gui/cfg.c trunk/gui/skin/font.c trunk/gui/skin/skin.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 14:25:05 2012 (r34665) +++ trunk/gui/cfg.c Thu Feb 9 14:43:23 2012 (r34666) @@ -240,16 +240,16 @@ int cfg_gui_include(m_option_t *conf, co void cfg_read(void) { - char *cfg; - FILE *f; + char *fname; + FILE *file; player_idle_mode = 1; // GUI is in idle mode by default // configuration - cfg = get_path(GUI_CONFIGURATION); + fname = get_path(GUI_CONFIGURATION); - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[cfg] file: %s\n", cfg); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[cfg] file: %s\n", fname); gui_conf = m_config_new(); @@ -260,49 +260,49 @@ void cfg_read(void) m_config_register_options(gui_conf, gui_opts); - if (!disable_gui_conf && (m_config_parse_config_file(gui_conf, cfg, 1) < 0)) { + if (!disable_gui_conf && (m_config_parse_config_file(gui_conf, fname, 1) < 0)) { gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_ConfigFileError "\n"); mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); } - free(cfg); + free(fname); // playlist - cfg = get_path(GUI_PLAYLIST); - f = fopen(cfg, "rt"); + fname = get_path(GUI_PLAYLIST); + file = fopen(fname, "rt"); - if (f) { - while (!feof(f)) { + if (file) { + while (!feof(file)) { char tmp[512]; plItem *item; - if (fgetstr(tmp, 512, f) == NULL) + if (fgetstr(tmp, 512, file) == NULL) continue; item = calloc(1, sizeof(plItem)); item->path = strdup(tmp); - fgetstr(tmp, 512, f); + fgetstr(tmp, 512, file); item->name = strdup(tmp); listSet(gtkAddPlItem, item); } - fclose(f); + fclose(file); } - free(cfg); + free(fname); // URL list - cfg = get_path(GUI_URLLIST); - f = fopen(cfg, "rt"); + fname = get_path(GUI_URLLIST); + file = fopen(fname, "rt"); - if (f) { - while (!feof(f)) { + if (file) { + while (!feof(file)) { char tmp[512]; urlItem *item; - if (fgetstr(tmp, 512, f) == NULL) + if (fgetstr(tmp, 512, file) == NULL) continue; item = calloc(1, sizeof(urlItem)); @@ -310,120 +310,120 @@ void cfg_read(void) listSet(gtkAddURLItem, item); } - fclose(f); + fclose(file); } - free(cfg); + free(fname); // directory history - cfg = get_path(GUI_HISTORY); - f = fopen(cfg, "rt+"); + fname = get_path(GUI_HISTORY); + file = fopen(fname, "rt+"); - if (f) { + if (file) { int i = 0; - while (!feof(f)) { + while (!feof(file)) { char tmp[512]; - if (fgetstr(tmp, 512, f) == NULL) + if (fgetstr(tmp, 512, file) == NULL) continue; fsHistory[i++] = gstrdup(tmp); } - fclose(f); + fclose(file); } - free(cfg); + free(fname); } void cfg_write(void) { - char *cfg; - FILE *f; + char *fname; + FILE *file; int i; // configuration - cfg = get_path(GUI_CONFIGURATION); - f = fopen(cfg, "wt+"); + fname = get_path(GUI_CONFIGURATION); + file = fopen(fname, "wt+"); - if (f) { + if (file) { for (i = 0; gui_opts[i].name; i++) { - char *v = m_option_print(&gui_opts[i], gui_opts[i].p); + char *val = m_option_print(&gui_opts[i], gui_opts[i].p); - if (v == (char *)-1) { + if (val == (char *)-1) { mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_UnableToSaveOption, gui_opts[i].name); - v = NULL; + val = NULL; } - if (v) { - fprintf(f, "%s = \"%s\"\n", gui_opts[i].name, v); - free(v); + if (val) { + fprintf(file, "%s = \"%s\"\n", gui_opts[i].name, val); + free(val); } } - fclose(f); + fclose(file); } - free(cfg); + free(fname); // playlist - cfg = get_path(GUI_PLAYLIST); - f = fopen(cfg, "wt+"); + fname = get_path(GUI_PLAYLIST); + file = fopen(fname, "wt+"); - if (f) { + if (file) { plCurrent = plList; while (plCurrent) { if (plCurrent->path && plCurrent->name) { - fprintf(f, "%s\n", plCurrent->path); - fprintf(f, "%s\n", plCurrent->name); + fprintf(file, "%s\n", plCurrent->path); + fprintf(file, "%s\n", plCurrent->name); } plCurrent = plCurrent->next; } - fclose(f); + fclose(file); } - free(cfg); + free(fname); // URL list - cfg = get_path(GUI_URLLIST); - f = fopen(cfg, "wt+"); + fname = get_path(GUI_URLLIST); + file = fopen(fname, "wt+"); - if (f) { + if (file) { while (urlList) { if (urlList->url) - fprintf(f, "%s\n", urlList->url); + fprintf(file, "%s\n", urlList->url); urlList = urlList->next; } - fclose(f); + fclose(file); } - free(cfg); + free(fname); // directory history - cfg = get_path(GUI_HISTORY); - f = fopen(cfg, "wt+"); + fname = get_path(GUI_HISTORY); + file = fopen(fname, "wt+"); - if (f) { + if (file) { int i = 0; // while (fsHistory[i] != NULL) for (i = 0; i < 5; i++) if (fsHistory[i]) - fprintf(f, "%s\n", fsHistory[i]); + fprintf(file, "%s\n", fsHistory[i]); - fclose(f); + fclose(file); } - free(cfg); + free(fname); } Modified: trunk/gui/skin/font.c ============================================================================== --- trunk/gui/skin/font.c Thu Feb 9 14:25:05 2012 (r34665) +++ trunk/gui/skin/font.c Thu Feb 9 14:43:23 2012 (r34666) @@ -104,7 +104,7 @@ void fntFreeFont(void) */ int fntRead(char *path, char *fname) { - FILE *f; + FILE *file; unsigned char buf[512]; unsigned char item[32]; unsigned char param[256]; @@ -118,14 +118,14 @@ int fntRead(char *path, char *fname) av_strlcpy(buf, path, sizeof(buf)); av_strlcat(buf, fname, sizeof(buf)); av_strlcat(buf, ".fnt", sizeof(buf)); - f = fopen(buf, "rt"); + file = fopen(buf, "rt"); - if (!f) { + if (!file) { nfree(Fonts[id]); return -3; } - while (fgetstr(buf, sizeof(buf), f)) { + while (fgetstr(buf, sizeof(buf), file)) { strswap(buf, '\t', ' '); trim(buf); decomment(buf); @@ -182,13 +182,13 @@ int fntRead(char *path, char *fname) if (skinImageRead(buf, &Fonts[id]->Bitmap) != 0) { bpFree(&Fonts[id]->Bitmap); nfree(Fonts[id]); - fclose(f); + fclose(file); return -4; } } } - fclose(f); + fclose(file); return 0; } Modified: trunk/gui/skin/skin.c ============================================================================== --- trunk/gui/skin/skin.c Thu Feb 9 14:25:05 2012 (r34665) +++ trunk/gui/skin/skin.c Thu Feb 9 14:43:23 2012 (r34666) @@ -1030,7 +1030,7 @@ static char *setname(char *dir, char *sn int skinRead(char *sname) { char *skinfname; - FILE *skinFile; + FILE *skinfile; unsigned char line[256]; unsigned char item[32]; unsigned char param[256]; @@ -1038,10 +1038,10 @@ int skinRead(char *sname) skinfname = setname(skinDirInHome, sname); - if ((skinFile = fopen(skinfname, "rt")) == NULL) { + if ((skinfile = fopen(skinfname, "rt")) == NULL) { skinfname = setname(skinMPlayerDir, sname); - if ((skinFile = fopen(skinfname, "rt")) == NULL) { + if ((skinfile = fopen(skinfname, "rt")) == NULL) { mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_SkinFileNotFound, skinfname); return -1; } @@ -1055,7 +1055,7 @@ int skinRead(char *sname) currWinName[0] = 0; linenumber = 0; - while (fgetstr(line, sizeof(line), skinFile)) { + while (fgetstr(line, sizeof(line), skinfile)) { linenumber++; strswap(line, '\t', ' '); From subversion at mplayerhq.hu Thu Feb 9 14:57:25 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 14:57:25 +0100 (CET) Subject: [MPlayer-cvslog] r34667 - trunk/gui/cfg.c Message-ID: <20120209135725.67BA013C1EE@avserver.banki.hu> Author: ib Date: Thu Feb 9 14:57:25 2012 New Revision: 34667 Log: Fix history file read-only fopen mode. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 14:43:23 2012 (r34666) +++ trunk/gui/cfg.c Thu Feb 9 14:57:25 2012 (r34667) @@ -318,7 +318,7 @@ void cfg_read(void) // directory history fname = get_path(GUI_HISTORY); - file = fopen(fname, "rt+"); + file = fopen(fname, "rt"); if (file) { int i = 0; From subversion at mplayerhq.hu Thu Feb 9 15:14:39 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 15:14:39 +0100 (CET) Subject: [MPlayer-cvslog] r34668 - trunk/gui/cfg.c Message-ID: <20120209141439.4EC5513C2F7@avserver.banki.hu> Author: ib Date: Thu Feb 9 15:14:39 2012 New Revision: 34668 Log: Move buffer at top of function and rename it. Additionally, use sizeof() instead of numeric constant for its size. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 14:57:25 2012 (r34667) +++ trunk/gui/cfg.c Thu Feb 9 15:14:39 2012 (r34668) @@ -240,7 +240,7 @@ int cfg_gui_include(m_option_t *conf, co void cfg_read(void) { - char *fname; + char *fname, line[512]; FILE *file; player_idle_mode = 1; // GUI is in idle mode by default @@ -274,16 +274,15 @@ void cfg_read(void) if (file) { while (!feof(file)) { - char tmp[512]; plItem *item; - if (fgetstr(tmp, 512, file) == NULL) + if (fgetstr(line, sizeof(line), file) == NULL) continue; item = calloc(1, sizeof(plItem)); - item->path = strdup(tmp); - fgetstr(tmp, 512, file); - item->name = strdup(tmp); + item->path = strdup(line); + fgetstr(line, sizeof(line), file); + item->name = strdup(line); listSet(gtkAddPlItem, item); } @@ -299,14 +298,13 @@ void cfg_read(void) if (file) { while (!feof(file)) { - char tmp[512]; urlItem *item; - if (fgetstr(tmp, 512, file) == NULL) + if (fgetstr(line, sizeof(line), file) == NULL) continue; item = calloc(1, sizeof(urlItem)); - item->url = strdup(tmp); + item->url = strdup(line); listSet(gtkAddURLItem, item); } @@ -324,12 +322,10 @@ void cfg_read(void) int i = 0; while (!feof(file)) { - char tmp[512]; - - if (fgetstr(tmp, 512, file) == NULL) + if (fgetstr(line, sizeof(line), file) == NULL) continue; - fsHistory[i++] = gstrdup(tmp); + fsHistory[i++] = gstrdup(line); } fclose(file); From subversion at mplayerhq.hu Thu Feb 9 15:26:12 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 15:26:12 +0100 (CET) Subject: [MPlayer-cvslog] r34669 - trunk/gui/cfg.c Message-ID: <20120209142612.887BC13C317@avserver.banki.hu> Author: ib Date: Thu Feb 9 15:26:12 2012 New Revision: 34669 Log: Simplify end-of-file detection. Don't double-check foef() and fgetstr(), because fgetstr() already reports EOF. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 15:14:39 2012 (r34668) +++ trunk/gui/cfg.c Thu Feb 9 15:26:12 2012 (r34669) @@ -273,12 +273,9 @@ void cfg_read(void) file = fopen(fname, "rt"); if (file) { - while (!feof(file)) { + while (fgetstr(line, sizeof(line), file)) { plItem *item; - if (fgetstr(line, sizeof(line), file) == NULL) - continue; - item = calloc(1, sizeof(plItem)); item->path = strdup(line); fgetstr(line, sizeof(line), file); @@ -297,12 +294,9 @@ void cfg_read(void) file = fopen(fname, "rt"); if (file) { - while (!feof(file)) { + while (fgetstr(line, sizeof(line), file)) { urlItem *item; - if (fgetstr(line, sizeof(line), file) == NULL) - continue; - item = calloc(1, sizeof(urlItem)); item->url = strdup(line); listSet(gtkAddURLItem, item); @@ -321,12 +315,8 @@ void cfg_read(void) if (file) { int i = 0; - while (!feof(file)) { - if (fgetstr(line, sizeof(line), file) == NULL) - continue; - + while (fgetstr(line, sizeof(line), file)) fsHistory[i++] = gstrdup(line); - } fclose(file); } From subversion at mplayerhq.hu Thu Feb 9 15:37:06 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 15:37:06 +0100 (CET) Subject: [MPlayer-cvslog] r34670 - trunk/gui/cfg.c Message-ID: <20120209143706.D6BAB13C323@avserver.banki.hu> Author: ib Date: Thu Feb 9 15:37:06 2012 New Revision: 34670 Log: Check for allocation error. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 15:26:12 2012 (r34669) +++ trunk/gui/cfg.c Thu Feb 9 15:37:06 2012 (r34670) @@ -277,6 +277,12 @@ void cfg_read(void) plItem *item; item = calloc(1, sizeof(plItem)); + + if (!item) { + gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_MemAllocFailed); + mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); + } + item->path = strdup(line); fgetstr(line, sizeof(line), file); item->name = strdup(line); @@ -298,6 +304,12 @@ void cfg_read(void) urlItem *item; item = calloc(1, sizeof(urlItem)); + + if (!item) { + gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_MemAllocFailed); + mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); + } + item->url = strdup(line); listSet(gtkAddURLItem, item); } From subversion at mplayerhq.hu Thu Feb 9 15:37:38 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 15:37:38 +0100 (CET) Subject: [MPlayer-cvslog] r34671 - trunk/gui/cfg.c Message-ID: <20120209143738.5124F13C327@avserver.banki.hu> Author: ib Date: Thu Feb 9 15:37:38 2012 New Revision: 34671 Log: Cosmetic: Adjust indent. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 15:37:06 2012 (r34670) +++ trunk/gui/cfg.c Thu Feb 9 15:37:38 2012 (r34671) @@ -276,7 +276,7 @@ void cfg_read(void) while (fgetstr(line, sizeof(line), file)) { plItem *item; - item = calloc(1, sizeof(plItem)); + item = calloc(1, sizeof(plItem)); if (!item) { gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_MemAllocFailed); @@ -303,7 +303,7 @@ void cfg_read(void) while (fgetstr(line, sizeof(line), file)) { urlItem *item; - item = calloc(1, sizeof(urlItem)); + item = calloc(1, sizeof(urlItem)); if (!item) { gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_MemAllocFailed); From subversion at mplayerhq.hu Thu Feb 9 15:52:22 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 15:52:22 +0100 (CET) Subject: [MPlayer-cvslog] r34672 - trunk/gui/cfg.c Message-ID: <20120209145222.65A7513C21A@avserver.banki.hu> Author: ib Date: Thu Feb 9 15:52:22 2012 New Revision: 34672 Log: Check for playlist errors (path, but no file). Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 15:37:38 2012 (r34671) +++ trunk/gui/cfg.c Thu Feb 9 15:52:22 2012 (r34672) @@ -284,9 +284,14 @@ void cfg_read(void) } item->path = strdup(line); - fgetstr(line, sizeof(line), file); + + if (fgetstr(line, sizeof(line), file)) { item->name = strdup(line); listSet(gtkAddPlItem, item); + } else { + free(item->path); + free(item); + } } fclose(file); From subversion at mplayerhq.hu Thu Feb 9 15:53:24 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 15:53:24 +0100 (CET) Subject: [MPlayer-cvslog] r34673 - trunk/gui/cfg.c Message-ID: <20120209145324.B3CB713C21A@avserver.banki.hu> Author: ib Date: Thu Feb 9 15:53:24 2012 New Revision: 34673 Log: Cosmetic: Adjust indent. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 15:52:22 2012 (r34672) +++ trunk/gui/cfg.c Thu Feb 9 15:53:24 2012 (r34673) @@ -286,8 +286,8 @@ void cfg_read(void) item->path = strdup(line); if (fgetstr(line, sizeof(line), file)) { - item->name = strdup(line); - listSet(gtkAddPlItem, item); + item->name = strdup(line); + listSet(gtkAddPlItem, item); } else { free(item->path); free(item); From subversion at mplayerhq.hu Thu Feb 9 16:01:32 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 16:01:32 +0100 (CET) Subject: [MPlayer-cvslog] r34674 - trunk/gui/cfg.c Message-ID: <20120209150132.A77FE13C2F9@avserver.banki.hu> Author: ib Date: Thu Feb 9 16:01:32 2012 New Revision: 34674 Log: Prevent out-of-bounds array access of fsHistory. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 15:53:24 2012 (r34673) +++ trunk/gui/cfg.c Thu Feb 9 16:01:32 2012 (r34674) @@ -27,6 +27,7 @@ #include "config.h" #include "help_mp.h" +#include "libavutil/common.h" #include "libmpcodecs/vd.h" #include "libmpdemux/demuxer.h" #include "libvo/video_out.h" @@ -330,9 +331,10 @@ void cfg_read(void) file = fopen(fname, "rt"); if (file) { - int i = 0; + unsigned int i = 0; while (fgetstr(line, sizeof(line), file)) + if (i < FF_ARRAY_ELEMS(fsHistory)) fsHistory[i++] = gstrdup(line); fclose(file); From subversion at mplayerhq.hu Thu Feb 9 16:02:16 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 16:02:16 +0100 (CET) Subject: [MPlayer-cvslog] r34675 - trunk/gui/cfg.c Message-ID: <20120209150216.B730A13C315@avserver.banki.hu> Author: ib Date: Thu Feb 9 16:02:16 2012 New Revision: 34675 Log: Cosmetic: Adjust indent. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 16:01:32 2012 (r34674) +++ trunk/gui/cfg.c Thu Feb 9 16:02:16 2012 (r34675) @@ -335,7 +335,7 @@ void cfg_read(void) while (fgetstr(line, sizeof(line), file)) if (i < FF_ARRAY_ELEMS(fsHistory)) - fsHistory[i++] = gstrdup(line); + fsHistory[i++] = gstrdup(line); fclose(file); } From subversion at mplayerhq.hu Thu Feb 9 16:12:58 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 9 Feb 2012 16:12:58 +0100 (CET) Subject: [MPlayer-cvslog] r34676 - trunk/gui/cfg.c Message-ID: <20120209151258.EDE5613C34E@avserver.banki.hu> Author: ib Date: Thu Feb 9 16:12:58 2012 New Revision: 34676 Log: Prevent reading empty lines. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 16:02:16 2012 (r34675) +++ trunk/gui/cfg.c Thu Feb 9 16:12:58 2012 (r34676) @@ -277,6 +277,9 @@ void cfg_read(void) while (fgetstr(line, sizeof(line), file)) { plItem *item; + if (!*line) + continue; + item = calloc(1, sizeof(plItem)); if (!item) { @@ -286,7 +289,7 @@ void cfg_read(void) item->path = strdup(line); - if (fgetstr(line, sizeof(line), file)) { + if (fgetstr(line, sizeof(line), file) && *line) { item->name = strdup(line); listSet(gtkAddPlItem, item); } else { @@ -309,6 +312,9 @@ void cfg_read(void) while (fgetstr(line, sizeof(line), file)) { urlItem *item; + if (!*line) + continue; + item = calloc(1, sizeof(urlItem)); if (!item) { @@ -334,7 +340,7 @@ void cfg_read(void) unsigned int i = 0; while (fgetstr(line, sizeof(line), file)) - if (i < FF_ARRAY_ELEMS(fsHistory)) + if (*line && (i < FF_ARRAY_ELEMS(fsHistory))) fsHistory[i++] = gstrdup(line); fclose(file); From Reimar.Doeffinger at gmx.de Thu Feb 9 21:23:28 2012 From: Reimar.Doeffinger at gmx.de (Reimar =?iso-8859-1?Q?D=F6ffinger?=) Date: Thu, 9 Feb 2012 21:23:28 +0100 Subject: [MPlayer-cvslog] r34664 - in trunk/gui: cfg.c win32/wincfg.c In-Reply-To: <20120209125210.1868F13C29F@avserver.banki.hu> References: <20120209125210.1868F13C29F@avserver.banki.hu> Message-ID: <20120209202328.GE2882@1und1.de> On Thu, Feb 09, 2012 at 01:52:10PM +0100, ib wrote: > +#define GUI_CONFIGURATION "gui.conf" > +#define GUI_HISTORY "gui.history" > +#define GUI_PLAYLIST "gui.pl" > +#define GUI_URLLIST "gui.url" Not important but usually I think it's better to avoid defines and use e.g. static const char gui_configuration[] = "gui.conf"; etc. From ib at wupperonline.de Fri Feb 10 12:47:02 2012 From: ib at wupperonline.de (=?ISO-8859-1?Q?Ingo=20Br=FCckl?=) Date: Fri, 10 Feb 2012 12:47:02 +0100 Subject: [MPlayer-cvslog] r34632 - trunk/stream/stream_ffmpeg.c In-Reply-To: <20120128134701.59D67137239@avserver.banki.hu> Message-ID: <4f3508b2.2281b2f2.bm001@wupperonline.de> reimar wrote on Sat, 28 Jan 2012 14:47:01 +0100 (CET): > Author: reimar > Date: Sat Jan 28 14:47:01 2012 > New Revision: 34632 > Log: > Some hacks to allow stream_ffmpeg to compile against newer FFmpeg. > Keep the old code so that it is still possible to compile > against older FFmpeg without using internal API. > Modified: > trunk/stream/stream_ffmpeg.c > Modified: trunk/stream/stream_ffmpeg.c > ============================================================================== > +++ trunk/stream/stream_ffmpeg.c Sat Jan 28 14:47:01 2012 (r34632) > @@ -26,6 +26,16 @@ > #include "m_struct.h" > #include "av_helpers.h" > > +#ifndef URL_RDONLY > +#include "libavformat/url.h" > +#define url_read_complete ffurl_read_complete > +#define url_write ffurl_write > +#define url_seek ffurl_seek > +#define url_filesize ffurl_size > +#define url_close ffurl_close > +#define url_open(c, n, f) ffurl_open(c, n, f, NULL, NULL) > +#endif I have problems with shared ffmpeg (just cloned and compiled): LD mplayer stream/stream_ffmpeg.o: In function `open_f': stream_ffmpeg.c:(.text+0x12d): undefined reference to `ffurl_size' stream/stream_ffmpeg.o: In function `control': stream_ffmpeg.c:(.text+0x2a4): undefined reference to `ffurl_size' stream/stream_ffmpeg.o: In function `fill_buffer': stream_ffmpeg.c:(.text+0x31e): undefined reference to `ffurl_read_complete' stream/stream_ffmpeg.o: In function `seek': stream_ffmpeg.c:(.text+0x35d): undefined reference to `ffurl_seek' make: *** [mplayer] Error 1 Is diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v index 6949884..e2fb65a 100644 --- a/libavformat/libavformat.v +++ b/libavformat/libavformat.v @@ -12,6 +12,9 @@ LIBAVFORMAT_$MAJOR { ffio_open_dyn_packet_buf; ffurl_close; ffurl_open; + ffurl_read_complete; + ffurl_seek; + ffurl_size; ffurl_write; url_open; url_close; the right way to fix it (and does it have a chance to get committed)? (I know, wrong mailing list to ask, but before I embarrass myself on ffmpeg-user...) Ingo From ib at wupperonline.de Fri Feb 10 13:51:44 2012 From: ib at wupperonline.de (=?ISO-8859-1?Q?Ingo=20Br=FCckl?=) Date: Fri, 10 Feb 2012 13:51:44 +0100 Subject: [MPlayer-cvslog] r34664 - in trunk/gui: cfg.c win32/wincfg.c In-Reply-To: <20120209202328.GE2882@1und1.de> Message-ID: <4f3512e4.0bb028e7.bm000@wupperonline.de> Reimar D?ffinger wrote on Thu, 9 Feb 2012 21:23:28 +0100: > On Thu, Feb 09, 2012 at 01:52:10PM +0100, ib wrote: >> +#define GUI_CONFIGURATION "gui.conf" >> +#define GUI_HISTORY "gui.history" >> +#define GUI_PLAYLIST "gui.pl" >> +#define GUI_URLLIST "gui.url" > Not important but usually I think it's better to avoid defines and use > e.g. > static const char gui_configuration[] = "gui.conf"; > etc. Is there a general advantage or only when using the definition more than once? Ingo From siretart at gmail.com Fri Feb 10 14:03:13 2012 From: siretart at gmail.com (Reinhard Tartler) Date: Fri, 10 Feb 2012 14:03:13 +0100 Subject: [MPlayer-cvslog] r34664 - in trunk/gui: cfg.c win32/wincfg.c In-Reply-To: <4f3512e4.0bb028e7.bm000@wupperonline.de> References: <20120209202328.GE2882@1und1.de> <4f3512e4.0bb028e7.bm000@wupperonline.de> Message-ID: On Fri, Feb 10, 2012 at 1:51 PM, Ingo Br?ckl wrote: > Reimar D?ffinger wrote on Thu, 9 Feb 2012 21:23:28 +0100: > >> On Thu, Feb 09, 2012 at 01:52:10PM +0100, ib wrote: >>> +#define GUI_CONFIGURATION "gui.conf" >>> +#define GUI_HISTORY ? ? ? "gui.history" >>> +#define GUI_PLAYLIST ? ? ?"gui.pl" >>> +#define GUI_URLLIST ? ? ? "gui.url" > >> Not important but usually I think it's better to avoid defines and use >> e.g. >> static const char gui_configuration[] = "gui.conf"; >> etc. > > Is there a general advantage or only when using the definition more than > once? generally, macros manipulate the token stream and cannot be type-checked by various tools such as the compiler, etc. -- regards, ? ? Reinhard From subversion at mplayerhq.hu Fri Feb 10 14:06:44 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 10 Feb 2012 14:06:44 +0100 (CET) Subject: [MPlayer-cvslog] r34677 - trunk/gui/cfg.c Message-ID: <20120210130644.6073E13CA8A@avserver.banki.hu> Author: ib Date: Fri Feb 10 14:06:43 2012 New Revision: 34677 Log: Don't unnecessarily use gstrdup(). The line has already been checked for content. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 9 16:12:58 2012 (r34676) +++ trunk/gui/cfg.c Fri Feb 10 14:06:43 2012 (r34677) @@ -341,7 +341,7 @@ void cfg_read(void) while (fgetstr(line, sizeof(line), file)) if (*line && (i < FF_ARRAY_ELEMS(fsHistory))) - fsHistory[i++] = gstrdup(line); + fsHistory[i++] = strdup(line); fclose(file); } From subversion at mplayerhq.hu Fri Feb 10 14:44:25 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 10 Feb 2012 14:44:25 +0100 (CET) Subject: [MPlayer-cvslog] r34678 - trunk/gui/cfg.c Message-ID: <20120210134425.4B82513C9FF@avserver.banki.hu> Author: ib Date: Fri Feb 10 14:44:25 2012 New Revision: 34678 Log: Remove unnecessary variable definition and commented code. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Fri Feb 10 14:06:43 2012 (r34677) +++ trunk/gui/cfg.c Fri Feb 10 14:44:25 2012 (r34678) @@ -426,9 +426,6 @@ void cfg_write(void) file = fopen(fname, "wt+"); if (file) { - int i = 0; - -// while (fsHistory[i] != NULL) for (i = 0; i < 5; i++) if (fsHistory[i]) fprintf(file, "%s\n", fsHistory[i]); From subversion at mplayerhq.hu Fri Feb 10 14:48:42 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 10 Feb 2012 14:48:42 +0100 (CET) Subject: [MPlayer-cvslog] r34679 - trunk/gui/cfg.c Message-ID: <20120210134842.F23DD13CAA2@avserver.banki.hu> Author: ib Date: Fri Feb 10 14:48:42 2012 New Revision: 34679 Log: Use macro FF_ARRAY_ELEMS() instead of numeric constant. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Fri Feb 10 14:44:25 2012 (r34678) +++ trunk/gui/cfg.c Fri Feb 10 14:48:42 2012 (r34679) @@ -353,7 +353,7 @@ void cfg_write(void) { char *fname; FILE *file; - int i; + unsigned int i; // configuration @@ -426,7 +426,7 @@ void cfg_write(void) file = fopen(fname, "wt+"); if (file) { - for (i = 0; i < 5; i++) + for (i = 0; i < FF_ARRAY_ELEMS(fsHistory); i++) if (fsHistory[i]) fprintf(file, "%s\n", fsHistory[i]); From subversion at mplayerhq.hu Fri Feb 10 15:13:14 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 10 Feb 2012 15:13:14 +0100 (CET) Subject: [MPlayer-cvslog] r34680 - trunk/gui/cfg.c Message-ID: <20120210141314.A5C3613CAD0@avserver.banki.hu> Author: ib Date: Fri Feb 10 15:13:14 2012 New Revision: 34680 Log: Show option save error in message box. The user probably won't notice otherwise. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Fri Feb 10 14:48:42 2012 (r34679) +++ trunk/gui/cfg.c Fri Feb 10 15:13:14 2012 (r34680) @@ -365,7 +365,7 @@ void cfg_write(void) char *val = m_option_print(&gui_opts[i], gui_opts[i].p); if (val == (char *)-1) { - mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_UnableToSaveOption, gui_opts[i].name); + gmp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_UnableToSaveOption, gui_opts[i].name); val = NULL; } From diego at biurrun.de Fri Feb 10 15:18:08 2012 From: diego at biurrun.de (Diego Biurrun) Date: Fri, 10 Feb 2012 15:18:08 +0100 Subject: [MPlayer-cvslog] r34632 - trunk/stream/stream_ffmpeg.c In-Reply-To: <4f3508b2.2281b2f2.bm001@wupperonline.de> References: <20120128134701.59D67137239@avserver.banki.hu> <4f3508b2.2281b2f2.bm001@wupperonline.de> Message-ID: <20120210141808.GA30660@pool.informatik.rwth-aachen.de> On Fri, Feb 10, 2012 at 12:47:02PM +0100, Ingo Br?ckl wrote: > reimar wrote on Sat, 28 Jan 2012 14:47:01 +0100 (CET): > > > Log: > > Some hacks to allow stream_ffmpeg to compile against newer FFmpeg. > > > Keep the old code so that it is still possible to compile > > against older FFmpeg without using internal API. > > > +++ trunk/stream/stream_ffmpeg.c Sat Jan 28 14:47:01 2012 (r34632) > > @@ -26,6 +26,16 @@ > > #include "m_struct.h" > > #include "av_helpers.h" > > > > +#ifndef URL_RDONLY > > +#include "libavformat/url.h" > > +#define url_read_complete ffurl_read_complete > > +#define url_write ffurl_write > > +#define url_seek ffurl_seek > > +#define url_filesize ffurl_size > > +#define url_close ffurl_close > > +#define url_open(c, n, f) ffurl_open(c, n, f, NULL, NULL) > > +#endif > > I have problems with shared ffmpeg (just cloned and compiled): > > LD mplayer > stream/stream_ffmpeg.o: In function `open_f': > stream_ffmpeg.c:(.text+0x12d): undefined reference to `ffurl_size' > stream/stream_ffmpeg.o: In function `control': > stream_ffmpeg.c:(.text+0x2a4): undefined reference to `ffurl_size' > stream/stream_ffmpeg.o: In function `fill_buffer': > stream_ffmpeg.c:(.text+0x31e): undefined reference to `ffurl_read_complete' > stream/stream_ffmpeg.o: In function `seek': > stream_ffmpeg.c:(.text+0x35d): undefined reference to `ffurl_seek' > make: *** [mplayer] Error 1 > > Is > > diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v > index 6949884..e2fb65a 100644 > --- a/libavformat/libavformat.v > +++ b/libavformat/libavformat.v > @@ -12,6 +12,9 @@ LIBAVFORMAT_$MAJOR { > ffio_open_dyn_packet_buf; > ffurl_close; > ffurl_open; > + ffurl_read_complete; > + ffurl_seek; > + ffurl_size; > ffurl_write; > url_open; > url_close; > > the right way to fix it (and does it have a chance to get committed)? > (I know, wrong mailing list to ask, but before I embarrass myself on > ffmpeg-user...) The right way is to fix MPlayer not to misuse internal API, not export more symbols from libavformat. Diego From subversion at mplayerhq.hu Fri Feb 10 15:57:29 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 10 Feb 2012 15:57:29 +0100 (CET) Subject: [MPlayer-cvslog] r34681 - in trunk/gui: cfg.c win32/wincfg.c Message-ID: <20120210145729.D236213CAFA@avserver.banki.hu> Author: ib Date: Fri Feb 10 15:57:29 2012 New Revision: 34681 Log: Adjust content of GUI configuration file to MPlayer configuration files. Use option= without spaces and quote value only if necessary. (The change of the output format is purely cosmetic, but shall make the interested GUI user aware that defining options is basically the same for MPlayer and the GUI.) Modified: trunk/gui/cfg.c trunk/gui/win32/wincfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Fri Feb 10 15:13:14 2012 (r34680) +++ trunk/gui/cfg.c Fri Feb 10 15:57:29 2012 (r34681) @@ -370,7 +370,12 @@ void cfg_write(void) } if (val) { - fprintf(file, "%s = \"%s\"\n", gui_opts[i].name, val); + char delim[] = { "\"" }; + + if (!strchr(val, ' ')) + *delim = 0; + + fprintf(file, "%s=%s%s%s\n", gui_opts[i].name, delim, val, delim); free(val); } } Modified: trunk/gui/win32/wincfg.c ============================================================================== --- trunk/gui/win32/wincfg.c Fri Feb 10 15:13:14 2012 (r34680) +++ trunk/gui/win32/wincfg.c Fri Feb 10 15:57:29 2012 (r34681) @@ -128,7 +128,11 @@ void cfg_write(void) } if(v) { - fprintf(f, "%s = \"%s\"\n", gui_opts[i].name, v); + char delim[] = {"\""}; + + if (!strchr(val, ' ')) *delim = 0; + + fprintf(f, "%s=%s%s%s\n", gui_opts[i].name, v); free(v); } } From subversion at mplayerhq.hu Fri Feb 10 16:06:59 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 10 Feb 2012 16:06:59 +0100 (CET) Subject: [MPlayer-cvslog] r34682 - trunk/gui/cfg.c Message-ID: <20120210150659.EF40113CB0A@avserver.banki.hu> Author: ib Date: Fri Feb 10 16:06:59 2012 New Revision: 34682 Log: Don't destroy list pointers while saving list items. Use temporary pointers instead. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Fri Feb 10 15:57:29 2012 (r34681) +++ trunk/gui/cfg.c Fri Feb 10 16:06:59 2012 (r34682) @@ -391,15 +391,15 @@ void cfg_write(void) file = fopen(fname, "wt+"); if (file) { - plCurrent = plList; + plItem *item = plList; - while (plCurrent) { - if (plCurrent->path && plCurrent->name) { - fprintf(file, "%s\n", plCurrent->path); - fprintf(file, "%s\n", plCurrent->name); + while (item) { + if (item->path && item->name) { + fprintf(file, "%s\n", item->path); + fprintf(file, "%s\n", item->name); } - plCurrent = plCurrent->next; + item = item->next; } fclose(file); @@ -413,11 +413,13 @@ void cfg_write(void) file = fopen(fname, "wt+"); if (file) { - while (urlList) { - if (urlList->url) - fprintf(file, "%s\n", urlList->url); + urlItem *item = urlList; - urlList = urlList->next; + while (item) { + if (item->url) + fprintf(file, "%s\n", item->url); + + item = item->next; } fclose(file); From subversion at mplayerhq.hu Fri Feb 10 16:24:28 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 10 Feb 2012 16:24:28 +0100 (CET) Subject: [MPlayer-cvslog] r34683 - in trunk/gui: cfg.c win32/wincfg.c Message-ID: <20120210152428.164A013CABA@avserver.banki.hu> Author: ib Date: Fri Feb 10 16:24:27 2012 New Revision: 34683 Log: Simplify character array definition. Modified: trunk/gui/cfg.c trunk/gui/win32/wincfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Fri Feb 10 16:06:59 2012 (r34682) +++ trunk/gui/cfg.c Fri Feb 10 16:24:27 2012 (r34683) @@ -370,7 +370,7 @@ void cfg_write(void) } if (val) { - char delim[] = { "\"" }; + char delim[] = "\""; if (!strchr(val, ' ')) *delim = 0; Modified: trunk/gui/win32/wincfg.c ============================================================================== --- trunk/gui/win32/wincfg.c Fri Feb 10 16:06:59 2012 (r34682) +++ trunk/gui/win32/wincfg.c Fri Feb 10 16:24:27 2012 (r34683) @@ -128,7 +128,7 @@ void cfg_write(void) } if(v) { - char delim[] = {"\""}; + char delim[] = "\""; if (!strchr(val, ' ')) *delim = 0; From subversion at mplayerhq.hu Fri Feb 10 16:40:53 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 10 Feb 2012 16:40:53 +0100 (CET) Subject: [MPlayer-cvslog] r34684 - in trunk/gui: cfg.c ui/widgets.c win32/wincfg.c Message-ID: <20120210154053.B31C113C9A0@avserver.banki.hu> Author: ib Date: Fri Feb 10 16:40:53 2012 New Revision: 34684 Log: Prefer static const char arrays for string constants to #defines. Modified: trunk/gui/cfg.c trunk/gui/ui/widgets.c trunk/gui/win32/wincfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Fri Feb 10 16:24:27 2012 (r34683) +++ trunk/gui/cfg.c Fri Feb 10 16:40:53 2012 (r34684) @@ -44,11 +44,6 @@ #include "sub/font_load.h" #include "sub/sub.h" -#define GUI_CONFIGURATION "gui.conf" -#define GUI_HISTORY "gui.history" -#define GUI_PLAYLIST "gui.pl" -#define GUI_URLLIST "gui.url" - m_config_t *gui_conf; int gtkCacheOn; @@ -103,6 +98,11 @@ char *skinName; char *fsHistory[5]; +static const char gui_configuration[] = "gui.conf"; +static const char gui_history[] = "gui.history"; +static const char gui_playlist[] = "gui.pl"; +static const char gui_urllist[] = "gui.url"; + static const m_option_t gui_opts[] = { { "cache", >kCacheOn, CONF_TYPE_FLAG, 0, 0, 1, NULL }, { "cache_size", >kCacheSize, CONF_TYPE_INT, CONF_RANGE, 32, 1048576, NULL }, @@ -248,7 +248,7 @@ void cfg_read(void) // configuration - fname = get_path(GUI_CONFIGURATION); + fname = get_path(gui_configuration); mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[cfg] file: %s\n", fname); @@ -270,7 +270,7 @@ void cfg_read(void) // playlist - fname = get_path(GUI_PLAYLIST); + fname = get_path(gui_playlist); file = fopen(fname, "rt"); if (file) { @@ -305,7 +305,7 @@ void cfg_read(void) // URL list - fname = get_path(GUI_URLLIST); + fname = get_path(gui_urllist); file = fopen(fname, "rt"); if (file) { @@ -333,7 +333,7 @@ void cfg_read(void) // directory history - fname = get_path(GUI_HISTORY); + fname = get_path(gui_history); file = fopen(fname, "rt"); if (file) { @@ -357,7 +357,7 @@ void cfg_write(void) // configuration - fname = get_path(GUI_CONFIGURATION); + fname = get_path(gui_configuration); file = fopen(fname, "wt+"); if (file) { @@ -387,7 +387,7 @@ void cfg_write(void) // playlist - fname = get_path(GUI_PLAYLIST); + fname = get_path(gui_playlist); file = fopen(fname, "wt+"); if (file) { @@ -409,7 +409,7 @@ void cfg_write(void) // URL list - fname = get_path(GUI_URLLIST); + fname = get_path(gui_urllist); file = fopen(fname, "wt+"); if (file) { @@ -429,7 +429,7 @@ void cfg_write(void) // directory history - fname = get_path(GUI_HISTORY); + fname = get_path(gui_history); file = fopen(fname, "wt+"); if (file) { Modified: trunk/gui/ui/widgets.c ============================================================================== --- trunk/gui/ui/widgets.c Fri Feb 10 16:24:27 2012 (r34683) +++ trunk/gui/ui/widgets.c Fri Feb 10 16:40:53 2012 (r34684) @@ -64,7 +64,7 @@ int gtkInitialized = 0; #include "gtk/url.h" #include "gtk/equalizer.h" -#define GUI_ICON_NAME "mplayer" +static const char gui_icon_name[] = "mplayer"; #define THRESHOLD 128 // transparency values equal to or above this will become // opaque, all values below this will become transparent @@ -79,7 +79,7 @@ static void gtkLoadIcon(GtkIconTheme *th guchar *data; int csize, i; - pixbuf = gtk_icon_theme_load_icon(theme, GUI_ICON_NAME, size, 0, NULL); + pixbuf = gtk_icon_theme_load_icon(theme, gui_icon_name, size, 0, NULL); if (pixbuf) gdk_pixbuf_render_pixmap_and_mask_for_colormap(pixbuf, gdk_colormap_get_system(), gdkIcon, gdkIconMask, THRESHOLD); @@ -105,7 +105,7 @@ static void gtkLoadIcon(GtkIconTheme *th g_object_unref(pixbuf); } else - mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_ICONERROR, GUI_ICON_NAME, size); + mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_ICONERROR, gui_icon_name, size); // start up GTK which realizes the pixmaps gtk_main_iteration_do(FALSE); Modified: trunk/gui/win32/wincfg.c ============================================================================== --- trunk/gui/win32/wincfg.c Fri Feb 10 16:24:27 2012 (r34683) +++ trunk/gui/win32/wincfg.c Fri Feb 10 16:40:53 2012 (r34684) @@ -38,7 +38,7 @@ #include "gui/interface.h" #include "gui.h" -#define GUI_CONFIGURATION "gui.conf" +static const char gui_configuration[] = "gui.conf"; /* params */ int gtkAONorm = 0; @@ -97,7 +97,7 @@ int cfg_gui_include(m_option_t *conf, co void cfg_read(void) { - char *cfg = get_path(GUI_CONFIGURATION); + char *cfg = get_path(gui_configuration); player_idle_mode = 1; // GUI is in idle mode by default @@ -112,7 +112,7 @@ void cfg_read(void) void cfg_write(void) { - char *cfg = get_path(GUI_CONFIGURATION); + char *cfg = get_path(gui_configuration); FILE *f; int i; From Reimar.Doeffinger at gmx.de Fri Feb 10 19:44:24 2012 From: Reimar.Doeffinger at gmx.de (=?utf-8?Q?Reimar_D=C3=B6ffinger?=) Date: Fri, 10 Feb 2012 19:44:24 +0100 Subject: [MPlayer-cvslog] r34632 - trunk/stream/stream_ffmpeg.c In-Reply-To: <20120210141808.GA30660@pool.informatik.rwth-aachen.de> References: <20120128134701.59D67137239@avserver.banki.hu> <4f3508b2.2281b2f2.bm001@wupperonline.de> <20120210141808.GA30660@pool.informatik.rwth-aachen.de> Message-ID: <00FF0B84-741F-4958-A858-409035D2A6B7@gmx.de> On 10 Feb 2012, at 15:18, Diego Biurrun wrote: > On Fri, Feb 10, 2012 at 12:47:02PM +0100, Ingo Br?ckl wrote: >> reimar wrote on Sat, 28 Jan 2012 14:47:01 +0100 (CET): >> >>> Log: >>> Some hacks to allow stream_ffmpeg to compile against newer FFmpeg. >> >>> Keep the old code so that it is still possible to compile >>> against older FFmpeg without using internal API. >> >>> +++ trunk/stream/stream_ffmpeg.c Sat Jan 28 14:47:01 2012 (r34632) >>> @@ -26,6 +26,16 @@ >>> #include "m_struct.h" >>> #include "av_helpers.h" >>> >>> +#ifndef URL_RDONLY >>> +#include "libavformat/url.h" >>> +#define url_read_complete ffurl_read_complete >>> +#define url_write ffurl_write >>> +#define url_seek ffurl_seek >>> +#define url_filesize ffurl_size >>> +#define url_close ffurl_close >>> +#define url_open(c, n, f) ffurl_open(c, n, f, NULL, NULL) >>> +#endif >> >> I have problems with shared ffmpeg (just cloned and compiled): >> >> LD mplayer >> stream/stream_ffmpeg.o: In function `open_f': >> stream_ffmpeg.c:(.text+0x12d): undefined reference to `ffurl_size' >> stream/stream_ffmpeg.o: In function `control': >> stream_ffmpeg.c:(.text+0x2a4): undefined reference to `ffurl_size' >> stream/stream_ffmpeg.o: In function `fill_buffer': >> stream_ffmpeg.c:(.text+0x31e): undefined reference to `ffurl_read_complete' >> stream/stream_ffmpeg.o: In function `seek': >> stream_ffmpeg.c:(.text+0x35d): undefined reference to `ffurl_seek' >> make: *** [mplayer] Error 1 >> >> Is >> >> diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v >> index 6949884..e2fb65a 100644 >> --- a/libavformat/libavformat.v >> +++ b/libavformat/libavformat.v >> @@ -12,6 +12,9 @@ LIBAVFORMAT_$MAJOR { >> ffio_open_dyn_packet_buf; >> ffurl_close; >> ffurl_open; >> + ffurl_read_complete; >> + ffurl_seek; >> + ffurl_size; >> ffurl_write; >> url_open; >> url_close; >> >> the right way to fix it (and does it have a chance to get committed)? >> (I know, wrong mailing list to ask, but before I embarrass myself on >> ffmpeg-user...) > > The right way is to fix MPlayer not to misuse internal API, not export > more symbols from libavformat. There is no suitable alternative to the (only now) internal API. FFmpeg should be easy enough to convince to expose the low-level API again. Libav probably not since they drove removing the old API without replacement. From ib at wupperonline.de Fri Feb 10 20:03:04 2012 From: ib at wupperonline.de (=?ISO-8859-1?Q?Ingo=20Br=FCckl?=) Date: Fri, 10 Feb 2012 20:03:04 +0100 Subject: [MPlayer-cvslog] r34632 - trunk/stream/stream_ffmpeg.c In-Reply-To: <00FF0B84-741F-4958-A858-409035D2A6B7@gmx.de> Message-ID: <4f3569f3.083a0ee3.bm000@wupperonline.de> Reimar D?ffinger wrote on Fri, 10 Feb 2012 19:44:24 +0100: > There is no suitable alternative to the (only now) internal API. > FFmpeg should be easy enough to convince to expose the low-level API > again. So you'd suggest sending the patch to the ffmpeg-user mailing-list? Ingo From ubitux at gmail.com Fri Feb 10 20:27:43 2012 From: ubitux at gmail.com (=?utf-8?B?Q2zDqW1lbnQgQsWTc2No?=) Date: Fri, 10 Feb 2012 20:27:43 +0100 Subject: [MPlayer-cvslog] r34632 - trunk/stream/stream_ffmpeg.c In-Reply-To: <4f3569f3.083a0ee3.bm000@wupperonline.de> References: <00FF0B84-741F-4958-A858-409035D2A6B7@gmx.de> <4f3569f3.083a0ee3.bm000@wupperonline.de> Message-ID: <20120210192743.GB28249@leki> On Fri, Feb 10, 2012 at 08:03:04PM +0100, Ingo Br?ckl wrote: > Reimar D?ffinger wrote on Fri, 10 Feb 2012 19:44:24 +0100: > > > There is no suitable alternative to the (only now) internal API. > > FFmpeg should be easy enough to convince to expose the low-level API > > again. > > So you'd suggest sending the patch to the ffmpeg-user mailing-list? > I guess you can send a patch on ffmpeg-devel similar to this one: http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=fa94f8a8484474f1d1630c5e255daa7574c61e9f Also, see this: http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2012-February/120575.html -- Cl?ment B. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 490 bytes Desc: not available URL: From Reimar.Doeffinger at gmx.de Fri Feb 10 20:32:13 2012 From: Reimar.Doeffinger at gmx.de (Reimar =?iso-8859-1?Q?D=F6ffinger?=) Date: Fri, 10 Feb 2012 20:32:13 +0100 Subject: [MPlayer-cvslog] r34632 - trunk/stream/stream_ffmpeg.c In-Reply-To: <4f3569f3.083a0ee3.bm000@wupperonline.de> References: <00FF0B84-741F-4958-A858-409035D2A6B7@gmx.de> <4f3569f3.083a0ee3.bm000@wupperonline.de> Message-ID: <20120210193212.GA24328@1und1.de> On Fri, Feb 10, 2012 at 08:03:04PM +0100, Ingo Br?ckl wrote: > Reimar D?ffinger wrote on Fri, 10 Feb 2012 19:44:24 +0100: > > > There is no suitable alternative to the (only now) internal API. > > FFmpeg should be easy enough to convince to expose the low-level API > > again. > > So you'd suggest sending the patch to the ffmpeg-user mailing-list? ffmpeg-user not. ffmpeg-devel, however ffurl stuff probably shouldn't be make public. Instead the necessary functions should probably be exported with av_ prefix. From subversion at mplayerhq.hu Sat Feb 11 16:35:39 2012 From: subversion at mplayerhq.hu (reimar) Date: Sat, 11 Feb 2012 16:35:39 +0100 (CET) Subject: [MPlayer-cvslog] r34685 - in trunk/libvo: sdl_common.c vo_sdl.c Message-ID: <20120211153539.A8C1213C1C3@avserver.banki.hu> Author: reimar Date: Sat Feb 11 16:35:39 2012 New Revision: 34685 Log: Support -noborder with SDL. Modified: trunk/libvo/sdl_common.c trunk/libvo/vo_sdl.c Modified: trunk/libvo/sdl_common.c ============================================================================== --- trunk/libvo/sdl_common.c Fri Feb 10 16:40:53 2012 (r34684) +++ trunk/libvo/sdl_common.c Sat Feb 11 16:35:39 2012 (r34685) @@ -117,6 +117,8 @@ int sdl_set_mode(int bpp, uint32_t flags // doublebuf with opengl creates flickering if (vo_doublebuffering && !(flags & SDL_OPENGL)) flags |= SDL_DOUBLEBUF; + if (!vo_border) + flags |= SDL_NOFRAME; s = SDL_SetVideoMode(vo_dwidth, vo_dheight, bpp, flags); if (!s) { mp_msg(MSGT_VO, MSGL_FATAL, "SDL SetVideoMode failed: %s\n", SDL_GetError()); Modified: trunk/libvo/vo_sdl.c ============================================================================== --- trunk/libvo/vo_sdl.c Fri Feb 10 16:40:53 2012 (r34684) +++ trunk/libvo/vo_sdl.c Sat Feb 11 16:35:39 2012 (r34685) @@ -396,6 +396,8 @@ static int sdl_open (void *plugin, void if (vo_doublebuffering) priv->sdlflags |= SDL_DOUBLEBUF; #endif + if (!vo_border) + priv->sdlflags |= SDL_NOFRAME; /* get information about the graphics adapter */ vidInfo = SDL_GetVideoInfo (); From subversion at mplayerhq.hu Sat Feb 11 18:21:15 2012 From: subversion at mplayerhq.hu (reimar) Date: Sat, 11 Feb 2012 18:21:15 +0100 (CET) Subject: [MPlayer-cvslog] r34686 - trunk/TOOLS/midentify.sh Message-ID: <20120211172115.3685E13CADD@avserver.banki.hu> Author: reimar Date: Sat Feb 11 18:21:14 2012 New Revision: 34686 Log: Optimize midentify script to not wasted time filling the cache. This could take particularly much time when the file is live audio stream and the cache is set large in the configuration. Based on suggestion by Rodrigo Campos [rodrigo [at] sdfg com ar] Modified: trunk/TOOLS/midentify.sh Modified: trunk/TOOLS/midentify.sh ============================================================================== --- trunk/TOOLS/midentify.sh Sat Feb 11 16:35:39 2012 (r34685) +++ trunk/TOOLS/midentify.sh Sat Feb 11 18:21:14 2012 (r34686) @@ -12,7 +12,7 @@ if [ -z "$1" ]; then exit 1 fi -mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null | +mplayer -noconfig all -cache-min 0 -vo null -ao null -frames 0 -identify "$@" 2>/dev/null | sed -ne '/^ID_/ { s/[]()|&;<>`'"'"'\\!$" []/\\&/g;p }' From subversion at mplayerhq.hu Sat Feb 11 21:42:20 2012 From: subversion at mplayerhq.hu (ib) Date: Sat, 11 Feb 2012 21:42:20 +0100 (CET) Subject: [MPlayer-cvslog] r34687 - in trunk/gui/util: list.c list.h Message-ID: <20120211204221.0575313CB98@avserver.banki.hu> Author: ib Date: Sat Feb 11 21:42:20 2012 New Revision: 34687 Log: Add code to free the URL list items. Modified: trunk/gui/util/list.c trunk/gui/util/list.h Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Sat Feb 11 18:21:14 2012 (r34686) +++ trunk/gui/util/list.c Sat Feb 11 21:42:20 2012 (r34687) @@ -187,6 +187,13 @@ void *listSet(int cmd, void *vparam) urlList = url_item; } return NULL; + + case gtkDelURL: + while (urlList) { + free(urlList->url); + urlList = urlList->next; + } + return NULL; } return NULL; Modified: trunk/gui/util/list.h ============================================================================== --- trunk/gui/util/list.h Sat Feb 11 18:21:14 2012 (r34686) +++ trunk/gui/util/list.h Sat Feb 11 21:42:20 2012 (r34687) @@ -24,6 +24,7 @@ #define gtkGetPrevPlItem 7 #define gtkGetCurrPlItem 8 #define gtkDelPl 9 +#define gtkDelURL 10 #define gtkDelCurrPlItem 23 #define gtkInsertPlItem 24 #define gtkSetCurrPlItem 25 From subversion at mplayerhq.hu Sat Feb 11 21:43:02 2012 From: subversion at mplayerhq.hu (ib) Date: Sat, 11 Feb 2012 21:43:02 +0100 (CET) Subject: [MPlayer-cvslog] r34688 - trunk/gui/interface.c Message-ID: <20120211204302.B0FBA13CB99@avserver.banki.hu> Author: ib Date: Sat Feb 11 21:43:02 2012 New Revision: 34688 Log: Free playlist and URL list items when GUI ends. Modified: trunk/gui/interface.c Modified: trunk/gui/interface.c ============================================================================== --- trunk/gui/interface.c Sat Feb 11 21:42:20 2012 (r34687) +++ trunk/gui/interface.c Sat Feb 11 21:43:02 2012 (r34688) @@ -268,6 +268,8 @@ void guiDone(void) } appFreeStruct(); + listSet(gtkDelPl, NULL); + listSet(gtkDelURL, NULL); free(guiIcon.collection); if (gui_conf) { From subversion at mplayerhq.hu Sat Feb 11 22:05:34 2012 From: subversion at mplayerhq.hu (ib) Date: Sat, 11 Feb 2012 22:05:34 +0100 (CET) Subject: [MPlayer-cvslog] r34689 - trunk/gui/util/list.c Message-ID: <20120211210534.9DB2813CBAD@avserver.banki.hu> Author: ib Date: Sat Feb 11 22:05:34 2012 New Revision: 34689 Log: Fix bug in freeing URL list items. The urlItem structure wasn't freed. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Sat Feb 11 21:43:02 2012 (r34688) +++ trunk/gui/util/list.c Sat Feb 11 22:05:34 2012 (r34689) @@ -190,8 +190,12 @@ void *listSet(int cmd, void *vparam) case gtkDelURL: while (urlList) { + urlItem *next = urlList->next; + free(urlList->url); - urlList = urlList->next; + free(urlList); + + urlList = next; } return NULL; } From subversion at mplayerhq.hu Sat Feb 11 22:17:51 2012 From: subversion at mplayerhq.hu (ib) Date: Sat, 11 Feb 2012 22:17:51 +0100 (CET) Subject: [MPlayer-cvslog] r34690 - trunk/gui/util/list.c Message-ID: <20120211211751.12E1F13CBA0@avserver.banki.hu> Author: ib Date: Sat Feb 11 22:17:50 2012 New Revision: 34690 Log: Fix bug in freeing playlist items. If there were several items, the last item wasn't freed. Simplify code. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Sat Feb 11 22:05:34 2012 (r34689) +++ trunk/gui/util/list.c Sat Feb 11 22:17:50 2012 (r34690) @@ -139,30 +139,16 @@ void *listSet(int cmd, void *vparam) // delete list case gtkDelPl: - { - plItem *curr = plList; - plItem *next; + while (plList) { + plItem *next = plList->next; - if (!plList) - return NULL; + free(plList->path); + free(plList->name); + free(plList); - if (!curr->next) { - free(curr->path); - free(curr->name); - free(curr); - } else { - while (curr->next) { - next = curr->next; - free(curr->path); - free(curr->name); - free(curr); - curr = next; - } + plList = next; } - - plList = NULL; plCurrent = NULL; - } return NULL; // handle url From subversion at mplayerhq.hu Sat Feb 11 23:33:23 2012 From: subversion at mplayerhq.hu (iive) Date: Sat, 11 Feb 2012 23:33:23 +0100 (CET) Subject: [MPlayer-cvslog] r34691 - trunk/libmpcodecs/vf_yadif.c Message-ID: <20120211223323.0DCF913CDDF@avserver.banki.hu> Author: iive Date: Sat Feb 11 23:33:22 2012 New Revision: 34691 Log: Fix green bottom line on yadif with certain parity. This implementation of the filter method needs a padding, that mplayer allocates but never fills with data. Do the padding properly and tweak the height alignment to even number of lines, instead of rounding to 32. Modified: trunk/libmpcodecs/vf_yadif.c Modified: trunk/libmpcodecs/vf_yadif.c ============================================================================== --- trunk/libmpcodecs/vf_yadif.c Sat Feb 11 22:17:50 2012 (r34690) +++ trunk/libmpcodecs/vf_yadif.c Sat Feb 11 23:33:22 2012 (r34691) @@ -60,8 +60,19 @@ static void store_ref(struct vf_priv_s * for(i=0; i<3; i++){ int is_chroma= !!i; + int pn_width = width >>is_chroma; + int pn_height = height>>is_chroma; - memcpy_pic(p->ref[2][i], src[i], width>>is_chroma, height>>is_chroma, p->stride[i], src_stride[i]); + + memcpy_pic(p->ref[2][i], src[i], pn_width, pn_height, p->stride[i], src_stride[i]); + + fast_memcpy(p->ref[2][i] + pn_height * p->stride[i], + src[i] + (pn_height-1)*src_stride[i], pn_width); + fast_memcpy(p->ref[2][i] + (pn_height+1)* p->stride[i], + src[i] + (pn_height-1)*src_stride[i], pn_width); + + fast_memcpy(p->ref[2][i] - p->stride[i], src[i], pn_width); + fast_memcpy(p->ref[2][i] - 2*p->stride[i], src[i], pn_width); } } @@ -373,7 +384,7 @@ static int config(struct vf_instance *vf for(i=0; i<3; i++){ int is_chroma= !!i; int w= ((width + 31) & (~31))>>is_chroma; - int h= ((height+6+ 31) & (~31))>>is_chroma; + int h=(((height + 1) & ( ~1))>>is_chroma) + 6; vf->priv->stride[i]= w; for(j=0; j<3; j++) From subversion at mplayerhq.hu Sun Feb 12 14:35:18 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 12 Feb 2012 14:35:18 +0100 (CET) Subject: [MPlayer-cvslog] r34693 - trunk/mplayer.c Message-ID: <20120212133518.1048C13CF12@avserver.banki.hu> Author: reimar Date: Sun Feb 12 14:35:17 2012 New Revision: 34693 Log: Try to detect when an audio driver ends up hanging after repeated seeks. This should at least give a clear message in the case of bug 2039. Modified: trunk/mplayer.c Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Sun Feb 12 01:37:23 2012 (r34692) +++ trunk/mplayer.c Sun Feb 12 14:35:17 2012 (r34693) @@ -2119,6 +2119,7 @@ static int fill_audio_out_buffers(void) int audio_eof = 0; int bytes_to_write; int format_change = 0; + int timeout = 0; sh_audio_t *const sh_audio = mpctx->sh_audio; current_module = "play_audio"; @@ -2132,6 +2133,10 @@ static int fill_audio_out_buffers(void) bytes_to_write = mpctx->audio_out->get_space(); if (mpctx->sh_video || bytes_to_write >= ao_data.outburst) break; + if (timeout++ > 10) { + mp_msg(MSGT_CPLAYER, MSGL_WARN, "Audio device got stuck!\n"); + break; + } // handle audio-only case: // this is where mplayer sleeps during audio-only playback From subversion at mplayerhq.hu Sun Feb 12 16:37:04 2012 From: subversion at mplayerhq.hu (ib) Date: Sun, 12 Feb 2012 16:37:04 +0100 (CET) Subject: [MPlayer-cvslog] r34694 - in trunk: help/help_mp-en.h mplayer.c Message-ID: <20120212153704.5CBC413CF3C@avserver.banki.hu> Author: ib Date: Sun Feb 12 16:37:04 2012 New Revision: 34694 Log: Make mplayer.c messages translatable. Modified: trunk/mplayer.c Changes in other areas also in this revision: Modified: trunk/help/help_mp-en.h Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Sun Feb 12 14:35:17 2012 (r34693) +++ trunk/mplayer.c Sun Feb 12 16:37:04 2012 (r34694) @@ -528,7 +528,7 @@ static void print_file_properties(const if (start_pts != MP_NOPTS_VALUE) mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_START_TIME=%.2f\n", start_pts); else - mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_START_TIME=unknown\n"); + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_START_TIME=%s\n", MSGTR_Unknown); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_LENGTH=%.2f\n", demuxer_get_time_length(mpctx->demuxer)); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SEEKABLE=%d\n", mpctx->stream->seek && (!mpctx->demuxer || mpctx->demuxer->seekable)); @@ -805,7 +805,7 @@ static void exit_sighandler(int x) #endif } mp_msg(MSGT_CPLAYER, MSGL_FATAL, "\n" MSGTR_IntBySignal, x, - current_module ? current_module : "unknown" + current_module ? current_module : MSGTR_Unknown ); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SIGNAL=%d\n", x); if (sig_count <= 1) @@ -831,17 +831,17 @@ static void exit_sighandler(int x) #ifdef CONFIG_CRASH_DEBUG if (crash_debug) { int gdb_pid; - mp_msg(MSGT_CPLAYER, MSGL_INFO, "Forking...\n"); + mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_Forking); gdb_pid = fork(); - mp_msg(MSGT_CPLAYER, MSGL_INFO, "Forked...\n"); + mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_Forked); if (gdb_pid == 0) { // We are the child char spid[20]; snprintf(spid, sizeof(spid), "%i", getppid()); getch2_disable(); // allow terminal to work properly with gdb if (execlp("gdb", "gdb", prog_path, spid, "-ex", "bt", NULL) == -1) - mp_msg(MSGT_CPLAYER, MSGL_ERR, "Couldn't start gdb\n"); + mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_CouldntStartGdb); } else if (gdb_pid < 0) - mp_msg(MSGT_CPLAYER, MSGL_ERR, "Couldn't fork\n"); + mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_CouldntFork); else { waitpid(gdb_pid, NULL, 0); } @@ -967,7 +967,7 @@ static void load_per_file_config(m_confi const char *name; if (strlen(file) > PATH_MAX - 14) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, "Filename is too long, can not load file or directory specific config files\n"); + mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_FilenameTooLong); return; } sprintf(cfg, "%s.conf", file); @@ -2134,7 +2134,7 @@ static int fill_audio_out_buffers(void) if (mpctx->sh_video || bytes_to_write >= ao_data.outburst) break; if (timeout++ > 10) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, "Audio device got stuck!\n"); + mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_AudioDeviceStuck); break; } @@ -2195,7 +2195,7 @@ static int fill_audio_out_buffers(void) } else if ((format_change || audio_eof) && mpctx->audio_out->get_delay() < .04) { // Sanity check to avoid hanging in case current ao doesn't output // partial chunks and doesn't check for AOPLAY_FINAL_CHUNK - mp_msg(MSGT_CPLAYER, MSGL_WARN, "Audio output truncated at end.\n"); + mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_AudioOutputTruncated); sh_audio->a_out_buffer_len = 0; } } @@ -2342,7 +2342,7 @@ int reinit_video_chain(void) if (vf_ass) sh_video->vfilter = vf_ass; else - mp_msg(MSGT_CPLAYER, MSGL_ERR, "ASS: cannot add video filter\n"); + mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_ASSCannotAddVideoFilter); } } #endif @@ -2469,7 +2469,7 @@ static double update_video(int *blit_fra ((vf_instance_t *)sh_video->vfilter)->control(sh_video->vfilter, VFCTRL_GET_PTS, &sh_video->pts); if (sh_video->pts == MP_NOPTS_VALUE) { - mp_msg(MSGT_CPLAYER, MSGL_ERR, "pts after filters MISSING\n"); + mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_PtsAfterFiltersMissing); sh_video->pts = sh_video->last_pts; } if (sh_video->last_pts == MP_NOPTS_VALUE) @@ -2904,7 +2904,7 @@ int main(int argc, char *argv[]) // Many users forget to include command line in bugreports... if (mp_msg_test(MSGT_CPLAYER, MSGL_V)) { - mp_msg(MSGT_CPLAYER, MSGL_INFO, "CommandLine:"); + mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_CommandLine); for (i = 1; i < argc; i++) mp_msg(MSGT_CPLAYER, MSGL_INFO, " '%s'", argv[i]); mp_msg(MSGT_CPLAYER, MSGL_INFO, "\n"); @@ -2976,7 +2976,7 @@ int main(int argc, char *argv[]) if (menu_init(mpctx, MPLAYER_CONFDIR "/menu.conf")) mp_msg(MSGT_CPLAYER, MSGL_V, "Menu initialized: %s\n", MPLAYER_CONFDIR "/menu.conf"); else { - mp_msg(MSGT_CPLAYER, MSGL_ERR, "Menu init failed.\n"); + mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_MenuInitFailed); use_menu = 0; } } From Reimar.Doeffinger at gmx.de Sun Feb 12 17:41:21 2012 From: Reimar.Doeffinger at gmx.de (=?utf-8?Q?Reimar_D=C3=B6ffinger?=) Date: Sun, 12 Feb 2012 17:41:21 +0100 Subject: [MPlayer-cvslog] r34694 - in trunk: help/help_mp-en.h mplayer.c In-Reply-To: <20120212153704.5CBC413CF3C@avserver.banki.hu> References: <20120212153704.5CBC413CF3C@avserver.banki.hu> Message-ID: On 12 Feb 2012, at 16:37, ib wrote: > Author: ib > Date: Sun Feb 12 16:37:04 2012 > New Revision: 34694 > > Log: > Make mplayer.c messages translatable. > > Modified: > trunk/mplayer.c > > Changes in other areas also in this revision: > Modified: > trunk/help/help_mp-en.h > > Modified: trunk/mplayer.c > ============================================================================== > --- trunk/mplayer.c Sun Feb 12 14:35:17 2012 (r34693) > +++ trunk/mplayer.c Sun Feb 12 16:37:04 2012 (r34694) > @@ -528,7 +528,7 @@ static void print_file_properties(const > if (start_pts != MP_NOPTS_VALUE) > mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_START_TIME=%.2f\n", start_pts); > else > - mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_START_TIME=unknown\n"); > + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_START_TIME=%s\n", MSGTR_Unknown); Never, never ever make MSGT_IDENTIFY messages translatable! This would cause incredible pain for any GUI. From subversion at mplayerhq.hu Sun Feb 12 18:27:06 2012 From: subversion at mplayerhq.hu (ib) Date: Sun, 12 Feb 2012 18:27:06 +0100 (CET) Subject: [MPlayer-cvslog] r34695 - trunk/mplayer.c Message-ID: <20120212172706.64F2013CBC3@avserver.banki.hu> Author: ib Date: Sun Feb 12 18:27:06 2012 New Revision: 34695 Log: Revert one change of r34694. MSGT_IDENTIFY must never be translatable. Modified: trunk/mplayer.c Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Sun Feb 12 16:37:04 2012 (r34694) +++ trunk/mplayer.c Sun Feb 12 18:27:06 2012 (r34695) @@ -528,7 +528,7 @@ static void print_file_properties(const if (start_pts != MP_NOPTS_VALUE) mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_START_TIME=%.2f\n", start_pts); else - mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_START_TIME=%s\n", MSGTR_Unknown); + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_START_TIME=unknown\n"); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_LENGTH=%.2f\n", demuxer_get_time_length(mpctx->demuxer)); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SEEKABLE=%d\n", mpctx->stream->seek && (!mpctx->demuxer || mpctx->demuxer->seekable)); From subversion at mplayerhq.hu Sun Feb 12 19:39:28 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 12 Feb 2012 19:39:28 +0100 (CET) Subject: [MPlayer-cvslog] r34697 - trunk/libvo/vo_sdl.c Message-ID: <20120212183928.1C30D13CF73@avserver.banki.hu> Author: reimar Date: Sun Feb 12 19:39:27 2012 New Revision: 34697 Log: Remove code that has been unused and disabled since a very long time. Modified: trunk/libvo/vo_sdl.c Modified: trunk/libvo/vo_sdl.c ============================================================================== --- trunk/libvo/vo_sdl.c Sun Feb 12 18:29:27 2012 (r34696) +++ trunk/libvo/vo_sdl.c Sun Feb 12 19:39:27 2012 (r34697) @@ -485,81 +485,6 @@ static int sdl_close (void) return 0; } -/** - * Do aspect ratio calculations - * - * params : srcw == sourcewidth - * srch == sourceheight - * dstw == destinationwidth - * dsth == destinationheight - * - * returns : SDL_Rect structure with new x and y, w and h - **/ - -#if 0 -static SDL_Rect aspect(int srcw, int srch, int dstw, int dsth) { - SDL_Rect newres; - mp_msg(MSGT_VO,MSGL_V, "SDL Aspect-Destinationres: %ix%i (x: %i, y: %i)\n", newres.w, newres.h, newres.x, newres.y); - newres.h = ((float)dstw / (float)srcw * (float)srch) * ((float)dsth/((float)dstw/(MONITOR_ASPECT))); - if(newres.h > dsth) { - newres.w = ((float)dsth / (float)newres.h) * dstw; - newres.h = dsth; - newres.x = (dstw - newres.w) / 2; - newres.y = 0; - } - else { - newres.w = dstw; - newres.x = 0; - newres.y = (dsth - newres.h) / 2; - } - - mp_msg(MSGT_VO,MSGL_V, "SDL Mode: %d: %d x %d\n", i, priv->fullmodes[i]->w, priv->fullmodes[i]->h); - - return newres; -} -#endif - -/** - * Sets the specified fullscreen mode. - * - * params : mode == index of the desired fullscreen mode - * returns : doesn't return - **/ - -#if 0 -static void set_fullmode (int mode) -{ - struct sdl_priv_s *priv = &sdl_priv; - SDL_Surface *newsurface = NULL; - int haspect, waspect = 0; - - /* if we haven't set a fullmode yet, default to the lowest res fullmode first */ - if (mode < 0) - mode = priv->fullmode = findArrayEnd(priv->fullmodes) - 1; - - /* Calculate proper aspect ratio for fullscreen - * Height smaller than expected: add horizontal black bars (haspect)*/ - haspect = (priv->width * (float) ((float) priv->fullmodes[mode]->h / (float) priv->fullmodes[mode]->w) - priv->height) * (float) ((float) priv->fullmodes[mode]->w / (float) priv->width); - /* Height bigger than expected: add vertical black bars (waspect)*/ - if (haspect < 0) { - haspect = 0; /* set haspect to zero because image will be scaled horizontal instead of vertical */ - waspect = priv->fullmodes[mode]->w - ((float) ((float) priv->fullmodes[mode]->h / (float) priv->height) * (float) priv->width); - } -// printf ("W-Aspect: %i H-Aspect: %i\n", waspect, haspect); - - /* change to given fullscreen mode and hide the mouse cursor */ - newsurface = SDL_SetVideoMode(priv->fullmodes[mode]->w - waspect, priv->fullmodes[mode]->h - haspect, priv->bpp, priv->sdlfullflags); - - /* if we were successful hide the mouse cursor and save the mode */ - if (newsurface) { - if (priv->surface) - SDL_FreeSurface(priv->surface); - priv->surface = newsurface; - SDL_ShowCursor(0); - } -} -#endif - /* Set video mode. Not fullscreen */ static void set_video_mode(int width, int height, int bpp, uint32_t sdlflags) { From subversion at mplayerhq.hu Sun Feb 12 19:44:19 2012 From: subversion at mplayerhq.hu (ib) Date: Sun, 12 Feb 2012 19:44:19 +0100 (CET) Subject: [MPlayer-cvslog] r34698 - in trunk/gui: cfg.c interface.c ui/actions.c ui/gtk/playlist.c ui/gtk/preferences.c ui/gtk/url.c ui/main.c util/list.c util/list.h win32/interface.c win32/preferences.c Message-ID: <20120212184420.220C413CE68@avserver.banki.hu> Author: ib Date: Sun Feb 12 19:44:19 2012 New Revision: 34698 Log: Cosmetic: Rename functions in list.c. Additionally, change a parameter name of new listMgr() and add some doxygen comments to list.h. Modified: trunk/gui/cfg.c trunk/gui/interface.c trunk/gui/ui/actions.c trunk/gui/ui/gtk/playlist.c trunk/gui/ui/gtk/preferences.c trunk/gui/ui/gtk/url.c trunk/gui/ui/main.c trunk/gui/util/list.c trunk/gui/util/list.h trunk/gui/win32/interface.c trunk/gui/win32/preferences.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/cfg.c Sun Feb 12 19:44:19 2012 (r34698) @@ -291,7 +291,7 @@ void cfg_read(void) if (fgetstr(line, sizeof(line), file) && *line) { item->name = strdup(line); - listSet(gtkAddPlItem, item); + listMgr(gtkAddPlItem, item); } else { free(item->path); free(item); @@ -323,7 +323,7 @@ void cfg_read(void) } item->url = strdup(line); - listSet(gtkAddURLItem, item); + listMgr(gtkAddURLItem, item); } fclose(file); Modified: trunk/gui/interface.c ============================================================================== --- trunk/gui/interface.c Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/interface.c Sun Feb 12 19:44:19 2012 (r34698) @@ -268,8 +268,8 @@ void guiDone(void) } appFreeStruct(); - listSet(gtkDelPl, NULL); - listSet(gtkDelURL, NULL); + listMgr(gtkDelPl, NULL); + listMgr(gtkDelURL, NULL); free(guiIcon.collection); if (gui_conf) { @@ -449,7 +449,7 @@ int gui(int what, void *data) while (video_out_drivers[i++]) { if (video_out_drivers[i - 1]->control(VOCTRL_GUISUPPORT, NULL) == VO_TRUE) { - gaddlist(&video_driver_list, (char *)video_out_drivers[i - 1]->info->short_name); + listSet(&video_driver_list, (char *)video_out_drivers[i - 1]->info->short_name); break; } } @@ -487,10 +487,10 @@ int gui(int what, void *data) // if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; } if (gtkAONorm) - greplace(&af_cfg.list, "volnorm", "volnorm"); + listRepl(&af_cfg.list, "volnorm", "volnorm"); if (gtkEnableAudioEqualizer) - greplace(&af_cfg.list, "equalizer", "equalizer"); + listRepl(&af_cfg.list, "equalizer", "equalizer"); if (gtkAOExtraStereo) { char *name; @@ -498,7 +498,7 @@ int gui(int what, void *data) name = malloc(12 + 20 + 1); snprintf(name, 12 + 20, "extrastereo=%f", gtkAOExtraStereoMul); name[12 + 20] = 0; - greplace(&af_cfg.list, "extrastereo", name); + listRepl(&af_cfg.list, "extrastereo", name); free(name); } @@ -514,7 +514,7 @@ int gui(int what, void *data) } else tmp = strdup("oss"); - gaddlist(&audio_driver_list, tmp); + listSet(&audio_driver_list, tmp); free(tmp); } @@ -530,7 +530,7 @@ int gui(int what, void *data) } else tmp = strdup("alsa"); - gaddlist(&audio_driver_list, tmp); + listSet(&audio_driver_list, tmp); free(tmp); } @@ -543,7 +543,7 @@ int gui(int what, void *data) } else tmp = strdup("sdl"); - gaddlist(&audio_driver_list, tmp); + listSet(&audio_driver_list, tmp); free(tmp); } @@ -556,7 +556,7 @@ int gui(int what, void *data) } else tmp = strdup("esd"); - gaddlist(&audio_driver_list, tmp); + listSet(&audio_driver_list, tmp); free(tmp); } @@ -777,7 +777,7 @@ int gui(int what, void *data) break; } - if (guiInfo.Playing && (next = listSet(gtkGetNextPlItem, NULL)) && (plLastPlayed != next)) { + if (guiInfo.Playing && (next = listMgr(gtkGetNextPlItem, NULL)) && (plLastPlayed != next)) { plLastPlayed = next; uiSetFileName(next->path, next->name, STREAMTYPE_FILE); guiInfo.NewPlay = GUI_FILE_NEW; @@ -858,9 +858,9 @@ static int import_file_into_gui(char *te item->path = pathname; if (insert) - listSet(gtkInsertPlItem, item); // inserts the item after current, and makes current=item + listMgr(gtkInsertPlItem, item); // inserts the item after current, and makes current=item else - listSet(gtkAddPlItem, item); + listMgr(gtkAddPlItem, item); return 1; } @@ -875,7 +875,7 @@ int guiPlaylistInitialize(play_tree_t *m int result = 0; if (!enqueue) - listSet(gtkDelPl, NULL); // delete playlist before "appending" + listMgr(gtkDelPl, NULL); // delete playlist before "appending" if ((my_pt_iter = pt_iter_create(&my_playtree, config))) { while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL) @@ -904,7 +904,7 @@ int guiPlaylistAdd(play_tree_t *my_playt int result = 0; plItem *save; - save = (plItem *)listSet(gtkGetCurrPlItem, NULL); // save current item + save = (plItem *)listMgr(gtkGetCurrPlItem, NULL); // save current item if ((my_pt_iter = pt_iter_create(&my_playtree, config))) { while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL) @@ -916,12 +916,12 @@ int guiPlaylistAdd(play_tree_t *my_playt } if (save) - listSet(gtkSetCurrPlItem, save); + listMgr(gtkSetCurrPlItem, save); else - listSet(gtkSetCurrPlItem, plList); // go to head, if plList was empty before + listMgr(gtkSetCurrPlItem, plList); // go to head, if plList was empty before if (save && result) - listSet(gtkDelCurrPlItem, NULL); + listMgr(gtkDelCurrPlItem, NULL); uiCurr(); // update filename Modified: trunk/gui/ui/actions.c ============================================================================== --- trunk/gui/ui/actions.c Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/ui/actions.c Sun Feb 12 19:44:19 2012 (r34698) @@ -254,7 +254,7 @@ void uiCurr(void) default: - curr = listSet(gtkGetCurrPlItem, NULL); + curr = listMgr(gtkGetCurrPlItem, NULL); if (curr) { uiSetFileName(curr->path, curr->name, STREAMTYPE_FILE); @@ -310,7 +310,7 @@ void uiPrev(void) default: - prev = listSet(gtkGetPrevPlItem, NULL); + prev = listMgr(gtkGetPrevPlItem, NULL); if (prev) { uiSetFileName(prev->path, prev->name, STREAMTYPE_FILE); @@ -371,7 +371,7 @@ void uiNext(void) default: - next = listSet(gtkGetNextPlItem, NULL); + next = listMgr(gtkGetNextPlItem, NULL); if (next) { uiSetFileName(next->path, next->name, STREAMTYPE_FILE); Modified: trunk/gui/ui/gtk/playlist.c ============================================================================== --- trunk/gui/ui/gtk/playlist.c Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/ui/gtk/playlist.c Sun Feb 12 19:44:19 2012 (r34698) @@ -191,7 +191,7 @@ static void plButtonReleased( GtkButton case 1: // ok { int i; - if ( plList ) listSet( gtkDelPl,NULL ); + if ( plList ) listMgr( gtkDelPl,NULL ); for ( i=0;iname ) item->name = strdup( text[0] ); item->path=g_filename_from_utf8( text[1], -1, NULL, NULL, NULL ); if ( !item->path ) item->path = strdup( text[1] ); - listSet( gtkAddPlItem,item ); + listMgr( gtkAddPlItem,item ); } if ( plCurrent ) { Modified: trunk/gui/ui/gtk/preferences.c ============================================================================== --- trunk/gui/ui/gtk/preferences.c Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/ui/gtk/preferences.c Sun Feb 12 19:44:19 2012 (r34698) @@ -537,8 +537,8 @@ static void prButton( GtkButton * button mplayer( MPLAYER_SET_EXTRA_STEREO,HSExtraStereoMuladj->value,0 ); audio_delay=HSAudioDelayadj->value; - gaddlist( &audio_driver_list,ao_driver[0] ); - gaddlist( &video_driver_list,vo_driver[0] ); + listSet( &audio_driver_list,ao_driver[0] ); + listSet( &video_driver_list,vo_driver[0] ); // -- 2. page vo_doublebuffering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) ); @@ -599,7 +599,7 @@ static void prButton( GtkButton * button const char * tmp = gtk_entry_get_text( GTK_ENTRY( EVFM ) ); for( i=0;mpcodecs_vd_drivers[i];i++ ) if ( !gstrcmp( tmp,(char *)mpcodecs_vd_drivers[i]->info->name ) ) - { gaddlist( &video_fm_list,(char *)mpcodecs_vd_drivers[i]->info->short_name ); break; } + { listSet( &video_fm_list,(char *)mpcodecs_vd_drivers[i]->info->short_name ); break; } } { @@ -607,7 +607,7 @@ static void prButton( GtkButton * button const char * tmp = gtk_entry_get_text( GTK_ENTRY( EAFM ) ); for( i=0;mpcodecs_ad_drivers[i];i++ ) if ( !gstrcmp( tmp,(char *)mpcodecs_ad_drivers[i]->info->name ) ) - { gaddlist( &audio_fm_list,(char *)mpcodecs_ad_drivers[i]->info->short_name ); break; } + { listSet( &audio_fm_list,(char *)mpcodecs_ad_drivers[i]->info->short_name ); break; } } // --- 6. page Modified: trunk/gui/ui/gtk/url.c ============================================================================== --- trunk/gui/ui/gtk/url.c Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/ui/gtk/url.c Sun Feb 12 19:44:19 2012 (r34698) @@ -101,7 +101,7 @@ static void on_Button_pressed( GtkButton item=calloc( 1,sizeof( urlItem ) ); item->url=gstrdup( str ); - listSet( gtkAddURLItem,item ); + listMgr( gtkAddURLItem,item ); uiSetFileName( NULL,str,STREAMTYPE_STREAM ); guiInfo.NewPlay=GUI_FILE_NEW; uiEventHandling( evPlay,0 ); Modified: trunk/gui/ui/main.c ============================================================================== --- trunk/gui/ui/main.c Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/ui/main.c Sun Feb 12 19:44:19 2012 (r34698) @@ -111,7 +111,7 @@ static void guiInfoMediumClear (int what nfree(guiInfo.Filename); nfree(guiInfo.SubtitleFilename); nfree(guiInfo.AudioFilename); - listSet(gtkDelPl, NULL); + listMgr(gtkDelPl, NULL); } if (what & CLEAR_VCD) guiInfo.Tracks = 0; @@ -208,9 +208,9 @@ play: if ( ( msg == evPlaySwitchToPause )&&( guiInfo.Playing == GUI_PAUSE ) ) goto NoPause; - if ( listSet( gtkGetCurrPlItem,NULL ) &&( guiInfo.StreamType == STREAMTYPE_FILE ) ) + if ( listMgr( gtkGetCurrPlItem,NULL ) &&( guiInfo.StreamType == STREAMTYPE_FILE ) ) { - plItem * next = listSet( gtkGetCurrPlItem,NULL ); + plItem * next = listMgr( gtkGetCurrPlItem,NULL ); plLastPlayed=next; uiSetFileName( next->path,next->name,SAME_STREAMTYPE ); } @@ -271,7 +271,7 @@ NoPause: uiMainAutoPlay=1; // guiInfo.StreamType=STREAMTYPE_FILE; case evLoad: - listSet( gtkDelPl,NULL ); + listMgr( gtkDelPl,NULL ); gtkShow( evLoad,NULL ); break; case evLoadSubtitle: gtkShow( evLoadSubtitle,NULL ); break; @@ -643,7 +643,7 @@ void uiDandDHandler(int num,char** files /* clear playlist */ if (filename == NULL) { filename = files[f]; - listSet(gtkDelPl,NULL); + listMgr(gtkDelPl,NULL); } item = calloc(1,sizeof(plItem)); @@ -658,7 +658,7 @@ void uiDandDHandler(int num,char** files item->name = strdup(str); item->path = strdup(""); } - listSet(gtkAddPlItem,item); + listMgr(gtkAddPlItem,item); } else { mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_NotAFile,str ); } Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/util/list.c Sun Feb 12 19:44:19 2012 (r34698) @@ -28,10 +28,10 @@ plItem *plLastPlayed; urlItem *urlList; -void *listSet(int cmd, void *vparam) +void *listMgr(int cmd, void *data) { - plItem *item = (plItem *)vparam; - urlItem *url_item = (urlItem *)vparam; + plItem *item = (plItem *)data; + urlItem *url_item = (urlItem *)data; int is_added = 1; switch (cmd) { @@ -72,7 +72,7 @@ void *listSet(int cmd, void *vparam) return plCurrent; } else - return listSet(gtkAddPlItem, item); + return listMgr(gtkAddPlItem, item); // get next item from playlist case gtkGetNextPlItem: @@ -192,7 +192,7 @@ void *listSet(int cmd, void *vparam) /** * \brief This actually creates a new list containing only one element... */ -void gaddlist(char ***list, const char *entry) +void listSet(char ***list, const char *entry) { int i; @@ -212,7 +212,7 @@ void gaddlist(char ***list, const char * * \brief This replaces a string starting with search by replace. * If not found, replace is appended. */ -void greplace(char ***list, const char *search, const char *replace) +void listRepl(char ***list, const char *search, const char *replace) { int i = 0; int len = (search ? strlen(search) : 0); Modified: trunk/gui/util/list.h ============================================================================== --- trunk/gui/util/list.h Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/util/list.h Sun Feb 12 19:44:19 2012 (r34698) @@ -47,8 +47,13 @@ extern plItem *plLastPlayed; extern urlItem *urlList; -void gaddlist(char ***list, const char *entry); -void greplace(char ***list, const char *search, const char *replace); -void *listSet(int cmd, void *vparam); +/// list manager (playlist, URL list) +void *listMgr(int cmd, void *data); + +//@{ +/// char pointer list operations +void listRepl(char ***list, const char *search, const char *replace); +void listSet(char ***list, const char *entry); +//@} #endif /* MPLAYER_GUI_LIST_H */ Modified: trunk/gui/win32/interface.c ============================================================================== --- trunk/gui/win32/interface.c Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/win32/interface.c Sun Feb 12 19:44:19 2012 (r34698) @@ -601,13 +601,13 @@ int gui(int what, void *data) } } guiInfo.VideoWindow = 1; - if(gtkAONorm) greplace(&af_cfg.list, "volnorm", "volnorm"); + if(gtkAONorm) listRepl(&af_cfg.list, "volnorm", "volnorm"); if(gtkAOExtraStereo) { char *name = malloc(12 + 20 + 1); snprintf(name, 12 + 20, "extrastereo=%f", gtkAOExtraStereoMul); name[12 + 20] = 0; - greplace(&af_cfg.list, "extrastereo", name); + listRepl(&af_cfg.list, "extrastereo", name); free(name); } if(gtkCacheOn) stream_cache_size = gtkCacheSize; Modified: trunk/gui/win32/preferences.c ============================================================================== --- trunk/gui/win32/preferences.c Sun Feb 12 19:39:27 2012 (r34697) +++ trunk/gui/win32/preferences.c Sun Feb 12 19:44:19 2012 (r34698) @@ -347,7 +347,7 @@ static LRESULT CALLBACK PrefsWndProc(HWN while(video_out_drivers[i]) { const vo_info_t *info = video_out_drivers[i++]->info; - if(!video_driver_list) gaddlist(&video_driver_list, (char *)info->short_name); + if(!video_driver_list) listSet(&video_driver_list, (char *)info->short_name); SendDlgItemMessage(hwnd, ID_VO_DRIVER, CB_ADDSTRING, 0, (LPARAM) info->short_name); } /* Special case for directx:noaccel */ @@ -361,7 +361,7 @@ static LRESULT CALLBACK PrefsWndProc(HWN { // FIXME: default priority (i.e. order in audio_out_drivers) should be fixed instead // if win32 as default is really desirable - gaddlist(&audio_driver_list, "win32"/*(char *)info->short_name*/); + listSet(&audio_driver_list, "win32"/*(char *)info->short_name*/); } SendDlgItemMessage(hwnd, ID_AO_DRIVER, CB_ADDSTRING, 0, (LPARAM) info->short_name); } From subversion at mplayerhq.hu Sun Feb 12 19:49:07 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 12 Feb 2012 19:49:07 +0100 (CET) Subject: [MPlayer-cvslog] r34699 - in trunk/libvo: gl_common.c sdl_common.c sdl_common.h vo_sdl.c Message-ID: <20120212184907.62DA713CF73@avserver.banki.hu> Author: reimar Date: Sun Feb 12 19:49:07 2012 New Revision: 34699 Log: vo_sdl: reuse some more sdl_common code. Modified: trunk/libvo/gl_common.c trunk/libvo/sdl_common.c trunk/libvo/sdl_common.h trunk/libvo/vo_sdl.c Modified: trunk/libvo/gl_common.c ============================================================================== --- trunk/libvo/gl_common.c Sun Feb 12 19:44:19 2012 (r34698) +++ trunk/libvo/gl_common.c Sun Feb 12 19:49:07 2012 (r34699) @@ -2037,7 +2037,7 @@ static void *sdlgpa(const GLubyte *name) } static int setGlWindow_sdl(MPGLContext *ctx) { - if (sdl_set_mode(0, SDL_OPENGL | SDL_RESIZABLE) < 0) + if (!sdl_set_mode(0, SDL_OPENGL | SDL_RESIZABLE)) return SET_WINDOW_FAILED; SDL_GL_LoadLibrary(NULL); getFunctions(sdlgpa, NULL); Modified: trunk/libvo/sdl_common.c ============================================================================== --- trunk/libvo/sdl_common.c Sun Feb 12 19:44:19 2012 (r34698) +++ trunk/libvo/sdl_common.c Sun Feb 12 19:49:07 2012 (r34699) @@ -109,24 +109,26 @@ void vo_sdl_fullscreen(void) reinit = 1; } -int sdl_set_mode(int bpp, uint32_t flags) +SDL_Surface *sdl_set_mode(int bpp, uint32_t flags) { SDL_Surface *s; mode_flags = flags; if (vo_fs) flags |= SDL_FULLSCREEN; // doublebuf with opengl creates flickering +#if !defined( __AMIGAOS4__ ) && !defined( __APPLE__ ) if (vo_doublebuffering && !(flags & SDL_OPENGL)) flags |= SDL_DOUBLEBUF; +#endif if (!vo_border) flags |= SDL_NOFRAME; s = SDL_SetVideoMode(vo_dwidth, vo_dheight, bpp, flags); if (!s) { mp_msg(MSGT_VO, MSGL_FATAL, "SDL SetVideoMode failed: %s\n", SDL_GetError()); - return -1; + return NULL; } vo_dwidth = s->w; vo_dheight = s->h; - return 0; + return s; } static const struct mp_keymap keysym_map[] = { Modified: trunk/libvo/sdl_common.h ============================================================================== --- trunk/libvo/sdl_common.h Sun Feb 12 19:44:19 2012 (r34698) +++ trunk/libvo/sdl_common.h Sun Feb 12 19:49:07 2012 (r34699) @@ -32,7 +32,7 @@ int vo_sdl_init(void); void vo_sdl_uninit(void); void vo_sdl_fullscreen(void); -int sdl_set_mode(int bpp, uint32_t flags); +SDL_Surface *sdl_set_mode(int bpp, uint32_t flags); int sdl_default_handle_event(SDL_Event *event); #endif /* MPLAYER_SDL_COMMON_H */ Modified: trunk/libvo/vo_sdl.c ============================================================================== --- trunk/libvo/vo_sdl.c Sun Feb 12 19:44:19 2012 (r34698) +++ trunk/libvo/vo_sdl.c Sun Feb 12 19:49:07 2012 (r34699) @@ -393,11 +393,7 @@ static int sdl_open (void *plugin, void #if !defined( __AMIGAOS4__ ) && !defined( __APPLE__ ) priv->sdlfullflags |= SDL_DOUBLEBUF; - if (vo_doublebuffering) - priv->sdlflags |= SDL_DOUBLEBUF; #endif - if (!vo_border) - priv->sdlflags |= SDL_NOFRAME; /* get information about the graphics adapter */ vidInfo = SDL_GetVideoInfo (); @@ -499,7 +495,9 @@ static void set_video_mode(int width, in priv->rgbsurface = NULL; priv->overlay = NULL; - newsurface = SDL_SetVideoMode(width, height, bpp, sdlflags); + vo_dwidth = width; + vo_dheight = height; + newsurface = sdl_set_mode(bpp, sdlflags); if(newsurface) { @@ -510,13 +508,9 @@ static void set_video_mode(int width, in priv->surface = newsurface; priv->dstwidth = width; priv->dstheight = height; - vo_dwidth = width; - vo_dheight = height; setup_surfaces(); } - else - mp_msg(MSGT_VO,MSGL_WARN, "set_video_mode: SDL_SetVideoMode failed: %s\n", SDL_GetError()); } static void set_fullmode (int mode) { @@ -577,8 +571,9 @@ static void set_fullmode (int mode) { } /* try to change to given fullscreenmode */ - newsurface = SDL_SetVideoMode(priv->dstwidth, screen_surface_h, priv->bpp, - priv->sdlfullflags); + vo_dwidth = priv->dstwidth; + vo_dheight = screen_surface_h; + newsurface = sdl_set_mode(priv->bpp, priv->sdlfullflags); /* * In Mac OS X (and possibly others?) SDL_SetVideoMode() appears to @@ -614,8 +609,6 @@ static void set_fullmode (int mode) { SDL_SRF_UNLOCK(priv->surface) setup_surfaces(); } - else - mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_SDL_SetVideoModeFailedFull, SDL_GetError()); } From subversion at mplayerhq.hu Sun Feb 12 19:49:46 2012 From: subversion at mplayerhq.hu (ib) Date: Sun, 12 Feb 2012 19:49:46 +0100 (CET) Subject: [MPlayer-cvslog] r34700 - trunk/gui/util/list.h Message-ID: <20120212184946.EDCD313CF76@avserver.banki.hu> Author: ib Date: Sun Feb 12 19:49:46 2012 New Revision: 34700 Log: Cosmetic: Rearrange structure members. Modified: trunk/gui/util/list.h Modified: trunk/gui/util/list.h ============================================================================== --- trunk/gui/util/list.h Sun Feb 12 19:49:07 2012 (r34699) +++ trunk/gui/util/list.h Sun Feb 12 19:49:46 2012 (r34700) @@ -31,14 +31,14 @@ #define gtkAddURLItem 15 typedef struct plItem { - struct plItem *prev, *next; char *path; char *name; + struct plItem *prev, *next; } plItem; typedef struct urlItem { - struct urlItem *next; char *url; + struct urlItem *next; } urlItem; extern plItem *plList; From subversion at mplayerhq.hu Sun Feb 12 20:03:19 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 12 Feb 2012 20:03:19 +0100 (CET) Subject: [MPlayer-cvslog] r34702 - trunk/libvo/sdl_common.c Message-ID: <20120212190319.CD7AA13CF7C@avserver.banki.hu> Author: reimar Date: Sun Feb 12 20:03:19 2012 New Revision: 34702 Log: SDL: add support for setting window position. Currently only works with -vo gl since -vo sdl does not yet call geometry(). Modified: trunk/libvo/sdl_common.c Modified: trunk/libvo/sdl_common.c ============================================================================== --- trunk/libvo/sdl_common.c Sun Feb 12 19:52:38 2012 (r34701) +++ trunk/libvo/sdl_common.c Sun Feb 12 20:03:19 2012 (r34702) @@ -25,6 +25,7 @@ #include "input/input.h" #include "input/mouse.h" #include "video_out.h" +#include "geometry.h" static int old_w; static int old_h; @@ -121,6 +122,11 @@ SDL_Surface *sdl_set_mode(int bpp, uint3 #endif if (!vo_border) flags |= SDL_NOFRAME; + if (geometry_xy_changed) { + char envstr[20]; + snprintf(envstr, sizeof(envstr), "%i,%i", vo_dx, vo_dy); + setenv("SDL_VIDEO_WINDOW_POS", envstr, 1); + } s = SDL_SetVideoMode(vo_dwidth, vo_dheight, bpp, flags); if (!s) { mp_msg(MSGT_VO, MSGL_FATAL, "SDL SetVideoMode failed: %s\n", SDL_GetError()); From subversion at mplayerhq.hu Sun Feb 12 20:27:35 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 12 Feb 2012 20:27:35 +0100 (CET) Subject: [MPlayer-cvslog] r34703 - trunk/libvo/vo_sdl.c Message-ID: <20120212192735.ABE6D13CF81@avserver.banki.hu> Author: reimar Date: Sun Feb 12 20:27:35 2012 New Revision: 34703 Log: Deduplicate some code that exists both in the if and else branch. Modified: trunk/libvo/vo_sdl.c Modified: trunk/libvo/vo_sdl.c ============================================================================== --- trunk/libvo/vo_sdl.c Sun Feb 12 20:03:19 2012 (r34702) +++ trunk/libvo/vo_sdl.c Sun Feb 12 20:27:35 2012 (r34703) @@ -552,13 +552,9 @@ static void set_fullmode (int mode) { } mp_msg(MSGT_VO,MSGL_V, "SET SDL Mode: %d: %d x %d\n", mode, priv->fullmodes[mode]->w, priv->fullmodes[mode]->h); priv->fullmode = mode; - screen_surface_h = priv->fullmodes[mode]->h; - screen_surface_w = priv->fullmodes[mode]->w; } - else { screen_surface_h = priv->fullmodes[mode]->h; screen_surface_w = priv->fullmodes[mode]->w; - } aspect_save_screenres(screen_surface_w, screen_surface_h); From subversion at mplayerhq.hu Sun Feb 12 20:39:54 2012 From: subversion at mplayerhq.hu (diego) Date: Sun, 12 Feb 2012 20:39:54 +0100 (CET) Subject: [MPlayer-cvslog] r34704 - trunk/DOCS/tech/slave.txt Message-ID: <20120212193954.EC27613CDAF@avserver.banki.hu> Author: diego Date: Sun Feb 12 20:39:54 2012 New Revision: 34704 Log: slave.txt: Fix a number of typos. partially based on a patch by Jan Christoph Uhde, Jan UhdeJc com Modified: trunk/DOCS/tech/slave.txt Modified: trunk/DOCS/tech/slave.txt ============================================================================== --- trunk/DOCS/tech/slave.txt Sun Feb 12 20:27:35 2012 (r34703) +++ trunk/DOCS/tech/slave.txt Sun Feb 12 20:39:54 2012 (r34704) @@ -11,7 +11,7 @@ To try slave mode out by hand, run and type slave commands into the console window. -You can also use a fifo file (named pipe): +You can also use a FIFO file (named pipe): mkfifo mplayer -slave -input file= @@ -362,21 +362,21 @@ sub_source [source] of each currently available source (forward or backward respectively). sub_file [value] - Display subtitle specifid by [value] for file subs. The [value] is + Display subtitle specified by [value] for file subs. The [value] is corresponding to ID_FILE_SUB_ID values reported by '-identify'. If [value] is -1, will turn off subtitle display. If [value] is omitted or less than -1, will cycle all file subs (forward or backward respectively). sub_vob [value] - Display subtitle specifid by [value] for vobsubs. The [value] is + Display subtitle specified by [value] for VOBsubs. The [value] is corresponding to ID_VOBSUB_ID values reported by '-identify'. If [value] is -1, will turn off subtitle display. - If [value] is omitted or less than -1, will cycle all vobsubs + If [value] is omitted or less than -1, will cycle all VOBsubs (forward or backward respectively). sub_demux [value] - Display subtitle specifid by [value] for subtitles from DVD or embedded + Display subtitle specified by [value] for subtitles from DVD or embedded in media file. The [value] is corresponding to ID_SUBTITLE_ID values reported by '-identify'. If [value] is -1, will turn off subtitle display. If [value] is omitted or less than -1, will cycle all DVD subs or embedded subs @@ -423,7 +423,7 @@ switch_vsync [value] teletext_add_digit Enter/leave teletext page number editing mode and append given digit to previously entered one. - 0..9 - Append apropriate digit. (Enables editing mode if called from normal + 0..9 - Append appropriate digit. (Enables editing mode if called from normal mode, and switches to normal mode when third digit is entered.) - - Delete last digit from page number. (Backspace emulation, works only in page number editing mode.) @@ -522,7 +522,7 @@ osdlevel int 0 3 speed float 0.01 100 X X X as -speed loop int -1 X X X as -loop pause flag 0 1 X 1 if paused, use with pausing_keep_force -filename string X file playing wo path +filename string X file playing w/o path path string X file playing demuxer string X demuxer used stream_pos pos 0 X X position in stream @@ -573,11 +573,11 @@ height int fps float X aspect float X switch_video int -2 255 X X X select video stream -switch_program int -1 65535 X X X (see TAB default keybind) +switch_program int -1 65535 X X X (see TAB default keybinding) sub int -1 X X X select subtitle stream sub_source int -1 2 X X X select subtitle source sub_file int -1 X X X select file subtitles -sub_vob int -1 X X X select vobsubs +sub_vob int -1 X X X select VOBsubs sub_demux int -1 X X X select subs from demux sub_delay float X X X sub_pos int 0 100 X X X subtitle position @@ -595,6 +595,6 @@ teletext_mode flag 0 1 teletext_format int 0 3 X X X 0 - opaque, 1 - transparent, 2 - opaque inverted, - 3 - transp. inv. + 3 - transparency inverted, teletext_half_page int 0 2 X X X 0 - off, 1 - top half, 2- bottom half From subversion at mplayerhq.hu Sun Feb 12 20:50:23 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 12 Feb 2012 20:50:23 +0100 (CET) Subject: [MPlayer-cvslog] r34705 - trunk/libvo/vo_sdl.c Message-ID: <20120212195023.EDFE91BDEE@avserver.banki.hu> Author: reimar Date: Sun Feb 12 20:50:23 2012 New Revision: 34705 Log: Switch to using VOCTRL_UPDATE_SCREENINFO, which allows getting rid of some aspect code and give -geometry support "for free". Modified: trunk/libvo/vo_sdl.c Modified: trunk/libvo/vo_sdl.c ============================================================================== --- trunk/libvo/vo_sdl.c Sun Feb 12 20:39:54 2012 (r34704) +++ trunk/libvo/vo_sdl.c Sun Feb 12 20:50:23 2012 (r34705) @@ -169,9 +169,6 @@ static struct sdl_priv_s { /* is X running (0/1) */ int X; - /* X11 Resolution */ - int XWidth, XHeight; - /* original image dimensions */ int width, height; @@ -529,8 +526,8 @@ static void set_fullmode (int mode) { /* if we haven't set a fullmode yet, default to the lowest res fullmode first */ /* But select a mode where the full video enter */ if(priv->X && priv->fulltype & VOFLAG_FULLSCREEN) { - screen_surface_w = priv->XWidth; - screen_surface_h = priv->XHeight; + screen_surface_w = vo_screenwidth; + screen_surface_h = vo_screenheight; } else if (mode < 0) { int i,j,imax; @@ -561,8 +558,6 @@ static void set_fullmode (int mode) { /* calculate new video size/aspect */ if(priv->mode == YUV) { if(priv->fulltype&VOFLAG_FULLSCREEN) - aspect_save_screenres(priv->XWidth, priv->XHeight); - aspect(&priv->dstwidth, &priv->dstheight, A_ZOOM); } @@ -667,14 +662,12 @@ config(uint32_t width, uint32_t height, d_height = height; } - aspect_save_orig(width,height); - aspect_save_prescale(d_width ? d_width : width, d_height ? d_height : height); - /* Save the original Image size */ priv->width = width; priv->height = height; - priv->dstwidth = d_width ? d_width : width; - priv->dstheight = d_height ? d_height : height; + priv->dstwidth = vo_dwidth; + priv->dstheight = vo_dheight; +printf("w/h: %i %i\n", vo_dwidth, vo_dheight); priv->format = format; @@ -687,11 +680,6 @@ config(uint32_t width, uint32_t height, //SDL_WM_SetCaption (title, title); } - if(priv->X) { - aspect_save_screenres(priv->XWidth,priv->XHeight); - aspect(&priv->dstwidth,&priv->dstheight,A_NOZOOM); - } - priv->windowsize.w = priv->dstwidth; priv->windowsize.h = priv->dstheight; @@ -1377,10 +1365,8 @@ static int preinit(const char *arg) #ifdef CONFIG_X11 if(vo_init()) { mp_msg(MSGT_VO,MSGL_V, "SDL: deactivating XScreensaver/DPMS\n"); - priv->XWidth = vo_screenwidth; - priv->XHeight = vo_screenheight; priv->X = 1; - mp_msg(MSGT_VO,MSGL_V, "SDL: X11 Resolution %ix%i\n", priv->XWidth, priv->XHeight); + mp_msg(MSGT_VO,MSGL_V, "SDL: X11 Resolution %ix%i\n", vo_screenwidth, vo_screenheight); } #endif @@ -1451,6 +1437,13 @@ static int control(uint32_t request, voi mp_msg(MSGT_VO,MSGL_DBG2, "SDL: Set fullscreen mode\n"); } return VO_TRUE; + case VOCTRL_UPDATE_SCREENINFO: + if (!vo_screenwidth || !vo_screenheight) { + vo_screenwidth = 1024; + vo_screenheight = 768; + } + aspect_save_screenres(vo_screenwidth, vo_screenheight); + return VO_TRUE; } return VO_NOTIMPL; From subversion at mplayerhq.hu Mon Feb 13 11:22:02 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 13 Feb 2012 11:22:02 +0100 (CET) Subject: [MPlayer-cvslog] r34709 - trunk/gui/cfg.c Message-ID: <20120213102202.854E513D20A@avserver.banki.hu> Author: ib Date: Mon Feb 13 11:22:02 2012 New Revision: 34709 Log: Replace for loop with index by while loop with pointer. Modified: trunk/gui/cfg.c Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Mon Feb 13 10:09:02 2012 (r34708) +++ trunk/gui/cfg.c Mon Feb 13 11:22:02 2012 (r34709) @@ -353,7 +353,6 @@ void cfg_write(void) { char *fname; FILE *file; - unsigned int i; // configuration @@ -361,11 +360,13 @@ void cfg_write(void) file = fopen(fname, "wt+"); if (file) { - for (i = 0; gui_opts[i].name; i++) { - char *val = m_option_print(&gui_opts[i], gui_opts[i].p); + const m_option_t *opts = gui_opts; + + while (opts->name) { + char *val = m_option_print(opts, opts->p); if (val == (char *)-1) { - gmp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_UnableToSaveOption, gui_opts[i].name); + gmp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_UnableToSaveOption, opts->name); val = NULL; } @@ -375,9 +376,11 @@ void cfg_write(void) if (!strchr(val, ' ')) *delim = 0; - fprintf(file, "%s=%s%s%s\n", gui_opts[i].name, delim, val, delim); + fprintf(file, "%s=%s%s%s\n", opts->name, delim, val, delim); free(val); } + + opts++; } fclose(file); @@ -433,6 +436,8 @@ void cfg_write(void) file = fopen(fname, "wt+"); if (file) { + unsigned int i; + for (i = 0; i < FF_ARRAY_ELEMS(fsHistory); i++) if (fsHistory[i]) fprintf(file, "%s\n", fsHistory[i]); From subversion at mplayerhq.hu Mon Feb 13 13:18:03 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 13 Feb 2012 13:18:03 +0100 (CET) Subject: [MPlayer-cvslog] r34710 - trunk/gui/util/list.c Message-ID: <20120213121803.596B413D309@avserver.banki.hu> Author: ib Date: Mon Feb 13 13:18:03 2012 New Revision: 34710 Log: Revise listSet(). Improve doxygen comments, replace for loop with index by while loop with pointer, fix bug with wrong allocation size, and check whether allocation succeeded. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Mon Feb 13 11:22:02 2012 (r34709) +++ trunk/gui/util/list.c Mon Feb 13 13:18:03 2012 (r34710) @@ -190,22 +190,32 @@ void *listMgr(int cmd, void *data) } /** - * \brief This actually creates a new list containing only one element... + * @brief Set list to @a entry. + * + * @param list pointer to the char pointer list + * @param entry the new (and only) element of the list + * + * @note Actually, a new list will be created and the old list will be freed. */ void listSet(char ***list, const char *entry) { - int i; - if (*list) { - for (i = 0; (*list)[i]; i++) - free((*list)[i]); + char **l = *list; + + while (*l) { + free(*l); + l++; + } free(*list); } - *list = malloc(2 * sizeof(char **)); + *list = malloc(2 * sizeof(char *)); + + if (*list) { (*list)[0] = gstrdup(entry); (*list)[1] = NULL; + } } /** From subversion at mplayerhq.hu Mon Feb 13 13:19:13 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 13 Feb 2012 13:19:13 +0100 (CET) Subject: [MPlayer-cvslog] r34711 - trunk/gui/util/list.c Message-ID: <20120213121913.A5A7A13D30B@avserver.banki.hu> Author: ib Date: Mon Feb 13 13:19:13 2012 New Revision: 34711 Log: Cosmetic: Adjust indent. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Mon Feb 13 13:18:03 2012 (r34710) +++ trunk/gui/util/list.c Mon Feb 13 13:19:13 2012 (r34711) @@ -210,11 +210,11 @@ void listSet(char ***list, const char *e free(*list); } - *list = malloc(2 * sizeof(char *)); + *list = malloc(2 * sizeof(char *)); if (*list) { - (*list)[0] = gstrdup(entry); - (*list)[1] = NULL; + (*list)[0] = gstrdup(entry); + (*list)[1] = NULL; } } From subversion at mplayerhq.hu Mon Feb 13 15:10:43 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 13 Feb 2012 15:10:43 +0100 (CET) Subject: [MPlayer-cvslog] r34712 - trunk/gui/interface.c Message-ID: <20120213141043.893C413D30F@avserver.banki.hu> Author: ib Date: Mon Feb 13 15:10:43 2012 New Revision: 34712 Log: Don't unnecessarily destroy audio_driver_list. Only change the list when there is a device or driver in the GUI configuration file. Modified: trunk/gui/interface.c Modified: trunk/gui/interface.c ============================================================================== --- trunk/gui/interface.c Mon Feb 13 13:19:13 2012 (r34711) +++ trunk/gui/interface.c Mon Feb 13 15:10:43 2012 (r34712) @@ -503,61 +503,53 @@ int gui(int what, void *data) } if (audio_driver_list && !gstrncmp(audio_driver_list[0], "oss", 3)) { - char *tmp; - mixer_device = gtkAOOSSMixer; mixer_channel = gtkAOOSSMixerChannel; if (gtkAOOSSDevice) { + char *tmp; + tmp = calloc(1, strlen(gtkAOOSSDevice) + 7); sprintf(tmp, "oss:%s", gtkAOOSSDevice); - } else - tmp = strdup("oss"); - listSet(&audio_driver_list, tmp); free(tmp); + } } if (audio_driver_list && !gstrncmp(audio_driver_list[0], "alsa", 4)) { - char *tmp; - mixer_device = gtkAOALSAMixer; mixer_channel = gtkAOALSAMixerChannel; if (gtkAOALSADevice) { + char *tmp; + tmp = calloc(1, strlen(gtkAOALSADevice) + 14); sprintf(tmp, "alsa:device=%s", gtkAOALSADevice); - } else - tmp = strdup("alsa"); - listSet(&audio_driver_list, tmp); free(tmp); + } } if (audio_driver_list && !gstrncmp(audio_driver_list[0], "sdl", 3)) { + if (gtkAOSDLDriver) { char *tmp; - if (gtkAOSDLDriver) { tmp = calloc(1, strlen(gtkAOSDLDriver) + 10); sprintf(tmp, "sdl:%s", gtkAOSDLDriver); - } else - tmp = strdup("sdl"); - listSet(&audio_driver_list, tmp); free(tmp); + } } if (audio_driver_list && !gstrncmp(audio_driver_list[0], "esd", 3)) { + if (gtkAOESDDevice) { char *tmp; - if (gtkAOESDDevice) { tmp = calloc(1, strlen(gtkAOESDDevice) + 10); sprintf(tmp, "esd:%s", gtkAOESDDevice); - } else - tmp = strdup("esd"); - listSet(&audio_driver_list, tmp); free(tmp); + } } // subtitle From subversion at mplayerhq.hu Mon Feb 13 15:12:54 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 13 Feb 2012 15:12:54 +0100 (CET) Subject: [MPlayer-cvslog] r34713 - trunk/gui/interface.c Message-ID: <20120213141254.86CFE13D388@avserver.banki.hu> Author: ib Date: Mon Feb 13 15:12:54 2012 New Revision: 34713 Log: Cosmetic: Adjust indent. Modified: trunk/gui/interface.c Modified: trunk/gui/interface.c ============================================================================== --- trunk/gui/interface.c Mon Feb 13 15:10:43 2012 (r34712) +++ trunk/gui/interface.c Mon Feb 13 15:12:54 2012 (r34713) @@ -507,12 +507,12 @@ int gui(int what, void *data) mixer_channel = gtkAOOSSMixerChannel; if (gtkAOOSSDevice) { - char *tmp; + char *tmp; tmp = calloc(1, strlen(gtkAOOSSDevice) + 7); sprintf(tmp, "oss:%s", gtkAOOSSDevice); - listSet(&audio_driver_list, tmp); - free(tmp); + listSet(&audio_driver_list, tmp); + free(tmp); } } @@ -521,34 +521,34 @@ int gui(int what, void *data) mixer_channel = gtkAOALSAMixerChannel; if (gtkAOALSADevice) { - char *tmp; + char *tmp; tmp = calloc(1, strlen(gtkAOALSADevice) + 14); sprintf(tmp, "alsa:device=%s", gtkAOALSADevice); - listSet(&audio_driver_list, tmp); - free(tmp); + listSet(&audio_driver_list, tmp); + free(tmp); } } if (audio_driver_list && !gstrncmp(audio_driver_list[0], "sdl", 3)) { if (gtkAOSDLDriver) { - char *tmp; + char *tmp; tmp = calloc(1, strlen(gtkAOSDLDriver) + 10); sprintf(tmp, "sdl:%s", gtkAOSDLDriver); - listSet(&audio_driver_list, tmp); - free(tmp); + listSet(&audio_driver_list, tmp); + free(tmp); } } if (audio_driver_list && !gstrncmp(audio_driver_list[0], "esd", 3)) { if (gtkAOESDDevice) { - char *tmp; + char *tmp; tmp = calloc(1, strlen(gtkAOESDDevice) + 10); sprintf(tmp, "esd:%s", gtkAOESDDevice); - listSet(&audio_driver_list, tmp); - free(tmp); + listSet(&audio_driver_list, tmp); + free(tmp); } } From subversion at mplayerhq.hu Mon Feb 13 16:48:12 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 13 Feb 2012 16:48:12 +0100 (CET) Subject: [MPlayer-cvslog] r34714 - trunk/gui/win32/wincfg.c Message-ID: <20120213154812.BBE2C13D4D9@avserver.banki.hu> Author: ib Date: Mon Feb 13 16:48:12 2012 New Revision: 34714 Log: Fix two copy-and-paste errors in the Win32 GUI. Reported by Stephen Sheldon, sfsheldo gmail com. Modified: trunk/gui/win32/wincfg.c Modified: trunk/gui/win32/wincfg.c ============================================================================== --- trunk/gui/win32/wincfg.c Mon Feb 13 15:12:54 2012 (r34713) +++ trunk/gui/win32/wincfg.c Mon Feb 13 16:48:12 2012 (r34714) @@ -130,9 +130,9 @@ void cfg_write(void) { char delim[] = "\""; - if (!strchr(val, ' ')) *delim = 0; + if (!strchr(v, ' ')) *delim = 0; - fprintf(f, "%s=%s%s%s\n", gui_opts[i].name, v); + fprintf(f, "%s=%s%s%s\n", gui_opts[i].name, delim, v, delim); free(v); } } From subversion at mplayerhq.hu Mon Feb 13 17:01:55 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 13 Feb 2012 17:01:55 +0100 (CET) Subject: [MPlayer-cvslog] r34715 - trunk/gui/util/list.c Message-ID: <20120213160155.D51EA13D4E7@avserver.banki.hu> Author: ib Date: Mon Feb 13 17:01:55 2012 New Revision: 34715 Log: Revise listRepl(). Improve doxygen comments, move len definition where variable is used and use correct data type, check for NULL replacement, replace strncmp() by gstrncmp() which can handle NULL, replace gstrdup() by strdup() because argument won't be NULL and check whether (re)allocation succeeded. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Mon Feb 13 16:48:12 2012 (r34714) +++ trunk/gui/util/list.c Mon Feb 13 17:01:55 2012 (r34715) @@ -219,19 +219,29 @@ void listSet(char ***list, const char *e } /** - * \brief This replaces a string starting with search by replace. - * If not found, replace is appended. + * @brief Replace the first element in list that starts with @a search. + * + * @note If no such element is found, @a replace will be appended. + * + * @param list pointer to the char pointer list + * @param search element to search + * @param replace replacement element */ void listRepl(char ***list, const char *search, const char *replace) { - int i = 0; - int len = (search ? strlen(search) : 0); + int i = 0; + char **org = *list; + + if (!replace) + return; if (*list) { + size_t len = (search ? strlen(search) : 0); + for (i = 0; (*list)[i]; i++) { - if (search && (strncmp((*list)[i], search, len) == 0)) { + if (gstrncmp((*list)[i], search, len) == 0) { free((*list)[i]); - (*list)[i] = gstrdup(replace); + (*list)[i] = strdup(replace); return; } } @@ -240,6 +250,11 @@ void listRepl(char ***list, const char * } else *list = malloc(2 * sizeof(char *)); - (*list)[i] = gstrdup(replace); + if (!*list) { + *list = org; + return; + } + + (*list)[i] = strdup(replace); (*list)[i + 1] = NULL; } From subversion at mplayerhq.hu Mon Feb 13 17:10:39 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 13 Feb 2012 17:10:39 +0100 (CET) Subject: [MPlayer-cvslog] r34716 - in trunk/gui/util: string.c string.h Message-ID: <20120213161039.ED5FB13D502@avserver.banki.hu> Author: ib Date: Mon Feb 13 17:10:39 2012 New Revision: 34716 Log: Add doxgen comment to gstrncmp(). Additionally, use correct data type for n. Modified: trunk/gui/util/string.c trunk/gui/util/string.h Modified: trunk/gui/util/string.c ============================================================================== --- trunk/gui/util/string.c Mon Feb 13 17:01:55 2012 (r34715) +++ trunk/gui/util/string.c Mon Feb 13 17:10:39 2012 (r34716) @@ -173,7 +173,16 @@ int gstrcasecmp(const char *a, const cha return strcasecmp(a, b); } -int gstrncmp(const char *a, const char *b, int n) +/** + * @brief A strncmp() that can handle NULL pointers. + * + * @param a string to be compared + * @param b string which is compared + * @param n number of characters compared at the most + * + * @return return value of strncmp() or -1, if a or b are NULL + */ +int gstrncmp(const char *a, const char *b, size_t n) { if (!a && !b) return 0; Modified: trunk/gui/util/string.h ============================================================================== --- trunk/gui/util/string.h Mon Feb 13 17:01:55 2012 (r34715) +++ trunk/gui/util/string.h Mon Feb 13 17:10:39 2012 (r34716) @@ -27,7 +27,7 @@ int gstrcasecmp(const char *a, const cha char *gstrchr(const char *str, int c); int gstrcmp(const char *a, const char *b); char *gstrdup(const char *str); -int gstrncmp(const char *a, const char *b, int n); +int gstrncmp(const char *a, const char *b, size_t n); void setddup(char **old, const char *dir, const char *name); void setdup(char **old, const char *str); char *strlower(char *in); From subversion at mplayerhq.hu Mon Feb 13 17:11:37 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 13 Feb 2012 17:11:37 +0100 (CET) Subject: [MPlayer-cvslog] r34717 - trunk/gui/util/string.c Message-ID: <20120213161137.8BBB513D501@avserver.banki.hu> Author: ib Date: Mon Feb 13 17:11:37 2012 New Revision: 34717 Log: Cosmetic: Change comment. Modified: trunk/gui/util/string.c Modified: trunk/gui/util/string.c ============================================================================== --- trunk/gui/util/string.c Mon Feb 13 17:10:39 2012 (r34716) +++ trunk/gui/util/string.c Mon Feb 13 17:11:37 2012 (r34717) @@ -333,7 +333,7 @@ char *TranslateFilename(int how, char *f /** * @brief Read characters from @a file. * - * @note Reading stops with '\\r', '\\n' or EOF. + * @note Reading stops with an end-of-line character or at end of file. * * @param str pointer to a buffer to receive the read characters * @param size number of characters read at the most (including a terminating null-character) From subversion at mplayerhq.hu Mon Feb 13 20:33:48 2012 From: subversion at mplayerhq.hu (reimar) Date: Mon, 13 Feb 2012 20:33:48 +0100 (CET) Subject: [MPlayer-cvslog] r34718 - trunk/libmpdemux/demux_audio.c Message-ID: <20120213193348.B3D5E13D69A@avserver.banki.hu> Author: reimar Date: Mon Feb 13 20:33:48 2012 New Revision: 34718 Log: Minor simplification. Part of patch by Beno?t Th?baudeau [benoit thebaudeau () advansee com]. Modified: trunk/libmpdemux/demux_audio.c Modified: trunk/libmpdemux/demux_audio.c ============================================================================== --- trunk/libmpdemux/demux_audio.c Mon Feb 13 17:11:37 2012 (r34717) +++ trunk/libmpdemux/demux_audio.c Mon Feb 13 20:33:48 2012 (r34718) @@ -415,11 +415,9 @@ static int demux_audio_open(demuxer_t* d free(mp3_found); mp3_found = NULL; if(s->end_pos && (s->flags & MP_STREAM_SEEK) == MP_STREAM_SEEK) { - char tag[4]; stream_seek(s,s->end_pos-128); - stream_read(s,tag,3); - tag[3] = '\0'; - if(!strcmp(tag,"TAG")) { + stream_read(s,hdr,3); + if(!memcmp(hdr,"TAG",3)) { char buf[31]; uint8_t g; demuxer->movi_end = stream_tell(s)-3; From subversion at mplayerhq.hu Mon Feb 13 20:36:01 2012 From: subversion at mplayerhq.hu (reimar) Date: Mon, 13 Feb 2012 20:36:01 +0100 (CET) Subject: [MPlayer-cvslog] r34719 - in trunk: help/help_mp-en.h libmpdemux/demux_audio.c Message-ID: <20120213193601.D6E7013D698@avserver.banki.hu> Author: reimar Date: Mon Feb 13 20:36:01 2012 New Revision: 34719 Log: Detect ID3v2 tag at the end of the file and stop demuxing before its start. Avoids trying to decode its data as MP3. Patch by Beno?t Th?baudeau [benoit thebaudeau {} advansee com]. Modified: trunk/libmpdemux/demux_audio.c Changes in other areas also in this revision: Modified: trunk/help/help_mp-en.h Modified: trunk/libmpdemux/demux_audio.c ============================================================================== --- trunk/libmpdemux/demux_audio.c Mon Feb 13 20:33:48 2012 (r34718) +++ trunk/libmpdemux/demux_audio.c Mon Feb 13 20:36:01 2012 (r34719) @@ -323,6 +323,34 @@ static unsigned int mp3_vbr_frames(strea return 0; } +/** + * @brief Determine the total size of an ID3v2 tag. + * + * @param maj_ver major version of the ID3v2 tag + * @param s stream to be read, assumed to be positioned at revision byte + * + * @return 0 (error or malformed tag) or tag size + */ +static unsigned int id3v2_tag_size(uint8_t maj_ver, stream_t *s) { + unsigned int header_footer_size; + unsigned int size; + int i; + + if(stream_read_char(s) == 0xff) + return 0; + header_footer_size = ((stream_read_char(s) & 0x10) && maj_ver >= 4) ? 20 : 10; + + size = 0; + for(i = 0; i < 4; i++) { + uint8_t data = stream_read_char(s); + if (data & 0x80) + return 0; + size = size << 7 | data; + } + + return header_footer_size + size; +} + static int demux_audio_open(demuxer_t* demuxer) { stream_t *s; sh_audio_t* sh_audio; @@ -356,12 +384,10 @@ static int demux_audio_open(demuxer_t* d // We found wav header. Now we can have 'fmt ' or a mp3 header // empty the buffer step = 4; - } else if( hdr[0] == 'I' && hdr[1] == 'D' && hdr[2] == '3' && (hdr[3] >= 2)) { - int len; - stream_skip(s,2); - stream_read(s,hdr,4); - len = (hdr[0]<<21) | (hdr[1]<<14) | (hdr[2]<<7) | hdr[3]; - stream_skip(s,len); + } else if( hdr[0] == 'I' && hdr[1] == 'D' && hdr[2] == '3' && hdr[3] >= 2 && hdr[3] != 0xff) { + unsigned int len = id3v2_tag_size(hdr[3], s); + if(len > 0) + stream_skip(s,len-10); step = 4; } else if( found_WAVE && hdr[0] == 'f' && hdr[1] == 'm' && hdr[2] == 't' && hdr[3] == ' ' ) { frmt = WAV; @@ -444,6 +470,25 @@ static int demux_audio_open(demuxer_t* d g = stream_read_char(s); demux_info_add(demuxer,"Genre",genres[g]); } + stream_seek(s,demuxer->movi_end-10); + stream_read(s,hdr,4); + if(!memcmp(hdr,"3DI",3) && hdr[3] >= 4 && hdr[3] != 0xff) { + unsigned int len = id3v2_tag_size(hdr[3], s); + if(len > 0) { + if(len > demuxer->movi_end - demuxer->movi_start) { + mp_msg(MSGT_DEMUX,MSGL_WARN,MSGTR_MPDEMUX_AUDIO_BadID3v2TagSize,len); + len = FFMIN(10,demuxer->movi_end-demuxer->movi_start); + } else { + stream_seek(s,demuxer->movi_end-len); + stream_read(s,hdr,4); + if(memcmp(hdr,"ID3",3) || hdr[3] < 4 || hdr[3] == 0xff || id3v2_tag_size(hdr[3], s) != len) { + mp_msg(MSGT_DEMUX,MSGL_WARN,MSGTR_MPDEMUX_AUDIO_DamagedAppendedID3v2Tag); + len = FFMIN(10,demuxer->movi_end-demuxer->movi_start); + } + } + demuxer->movi_end -= len; + } + } } if (duration && demuxer->movi_end && demuxer->movi_end > demuxer->movi_start) sh_audio->wf->nAvgBytesPerSec = (demuxer->movi_end - demuxer->movi_start) / duration; sh_audio->i_bps = sh_audio->wf->nAvgBytesPerSec; From subversion at mplayerhq.hu Mon Feb 13 21:52:59 2012 From: subversion at mplayerhq.hu (reimar) Date: Mon, 13 Feb 2012 21:52:59 +0100 (CET) Subject: [MPlayer-cvslog] r34720 - trunk/libmpdemux/mpeg_hdr.c Message-ID: <20120213205259.ACF0813D754@avserver.banki.hu> Author: reimar Date: Mon Feb 13 21:52:59 2012 New Revision: 34720 Log: Do not parse the extended aspect info into the fields used for video size. This resulted in -identify showing the aspect settings as video width/height. Since aspect is ignored in general (i.e. also when a preset aspect is encoded) this should not break anything. Modified: trunk/libmpdemux/mpeg_hdr.c Modified: trunk/libmpdemux/mpeg_hdr.c ============================================================================== --- trunk/libmpdemux/mpeg_hdr.c Mon Feb 13 20:36:01 2012 (r34719) +++ trunk/libmpdemux/mpeg_hdr.c Mon Feb 13 21:52:59 2012 (r34720) @@ -325,10 +325,8 @@ static int h264_parse_vui(mp_mpeg_header n += 8; if(picture->aspect_ratio_information == 255) { - picture->display_picture_width = (getbits(buf, n, 8) << 8) | getbits(buf, n + 8, 8); + // aspect numerator and denominator n += 16; - - picture->display_picture_height = (getbits(buf, n, 8) << 8) | getbits(buf, n + 8, 8); n += 16; } } From subversion at mplayerhq.hu Tue Feb 14 12:45:56 2012 From: subversion at mplayerhq.hu (ib) Date: Tue, 14 Feb 2012 12:45:56 +0100 (CET) Subject: [MPlayer-cvslog] r34721 - trunk/etc/mplayer.ico Message-ID: <20120214114556.E893D13DA3A@avserver.banki.hu> Author: ib Date: Tue Feb 14 12:45:56 2012 New Revision: 34721 Log: Update mplayer.ico. It is the same content, but created with a different icon editor now, because at least Wine's resource compiler didn't like the old format. Modified: trunk/etc/mplayer.ico Modified: trunk/etc/mplayer.ico ============================================================================== Binary file (source and/or target). No diff available. From subversion at mplayerhq.hu Tue Feb 14 17:50:43 2012 From: subversion at mplayerhq.hu (iive) Date: Tue, 14 Feb 2012 17:50:43 +0100 (CET) Subject: [MPlayer-cvslog] r34722 - trunk/configure Message-ID: <20120214165043.5BA6F13DAEE@avserver.banki.hu> Author: iive Date: Tue Feb 14 17:50:42 2012 New Revision: 34722 Log: Fix linking after FFmpeg merge. Protocols that are available only when librtmp is present are no longer disabled in the code, so we have to remove them in our configure. Modified: trunk/configure Modified: trunk/configure ============================================================================== --- trunk/configure Tue Feb 14 12:45:56 2012 (r34721) +++ trunk/configure Tue Feb 14 17:50:42 2012 (r34722) @@ -6702,6 +6702,7 @@ else _librtmp=no def_librtmp='#define CONFIG_LIBRTMP 0' noinputmodules="librtmp $noinputmodules" + libavprotocols=$(echo $libavprotocols | sed -e s/RTMPE_PROTOCOL// -e s/RTMPS_PROTOCOL// -e s/RTMPT_PROTOCOL// -e s/RTMPTE_PROTOCOL// ) fi echores "$_librtmp" From subversion at mplayerhq.hu Tue Feb 14 18:06:09 2012 From: subversion at mplayerhq.hu (iive) Date: Tue, 14 Feb 2012 18:06:09 +0100 (CET) Subject: [MPlayer-cvslog] r34723 - trunk/libvo/vo_png.c Message-ID: <20120214170609.8CD0C13DB38@avserver.banki.hu> Author: iive Date: Tue Feb 14 18:06:09 2012 New Revision: 34723 Log: Fix vo_png after FFmpeg merge. Now avcodec_open2() function wants a valid avctx->pix_fmt to be set, but the current vo_png opens the encoder in preinit() function, long before the exact pixel format is know. The fix moves the avcodec_open2() function to vo_png::config() and adds a check for changed pixel format in case there are more config() calls. Modified: trunk/libvo/vo_png.c Modified: trunk/libvo/vo_png.c ============================================================================== --- trunk/libvo/vo_png.c Tue Feb 14 17:50:42 2012 (r34722) +++ trunk/libvo/vo_png.c Tue Feb 14 18:06:09 2012 (r34723) @@ -55,6 +55,7 @@ const LIBVO_EXTERN (png) static int z_compression; static char *png_outdir; static char *png_outfile_prefix; +static uint32_t png_format; static int framenum; static int use_alpha; static AVCodecContext *avctx; @@ -122,6 +123,22 @@ config(uint32_t width, uint32_t height, png_mkdir(buf, 1); mp_msg(MSGT_VO,MSGL_DBG2, "PNG Compression level %i\n", z_compression); + + if (avctx && png_format != format) { + avcodec_close(avctx); + av_freep(&avctx); + } + + if (!avctx) { + avctx = avcodec_alloc_context3(NULL); + avctx->compression_level = z_compression; + avctx->pix_fmt = imgfmt2pixfmt(format); + if (avcodec_open2(avctx, avcodec_find_encoder(CODEC_ID_PNG), NULL) < 0) { + uninit(); + return -1; + } + png_format = format; + } return 0; } @@ -145,7 +162,6 @@ static uint32_t draw_image(mp_image_t* m avctx->width = mpi->w; avctx->height = mpi->h; - avctx->pix_fmt = imgfmt2pixfmt(mpi->imgfmt); pic.data[0] = mpi->planes[0]; pic.linesize[0] = mpi->stride[0]; buffersize = mpi->w * mpi->h * 8; @@ -232,12 +248,6 @@ static int preinit(const char *arg) return -1; } avcodec_register_all(); - avctx = avcodec_alloc_context3(NULL); - if (avcodec_open2(avctx, avcodec_find_encoder(CODEC_ID_PNG), NULL) < 0) { - uninit(); - return -1; - } - avctx->compression_level = z_compression; return 0; } From subversion at mplayerhq.hu Tue Feb 14 20:22:22 2012 From: subversion at mplayerhq.hu (reimar) Date: Tue, 14 Feb 2012 20:22:22 +0100 (CET) Subject: [MPlayer-cvslog] r34724 - in trunk: configure libmpdemux/mp_taglists.c Message-ID: <20120214192222.8750E2EA63@avserver.banki.hu> Author: reimar Date: Tue Feb 14 20:22:22 2012 New Revision: 34724 Log: Simplify codec id <-> tag mapping using avformat_get_riff_*_tags. This also ensures that again only audio mappings will be used for audio and video mappings for video. This fixes bug #2038. Based on patch by Andrew Wason [rectalogic rectalogic com]. Modified: trunk/configure trunk/libmpdemux/mp_taglists.c Modified: trunk/configure ============================================================================== --- trunk/configure Tue Feb 14 18:06:09 2012 (r34723) +++ trunk/configure Tue Feb 14 20:22:22 2012 (r34724) @@ -7068,8 +7068,6 @@ echocheck "mencoder" if test "$_mencoder" = no ; then # mpeg1video for vf_lavc, snow for vf_uspp / vf_mcdeint, libavencoders="$mplayer_encoders MPEG1VIDEO_ENCODER SNOW_ENCODER" - # needed for codec id -> tag conversion - libavmuxers="AVI_MUXER" fi echores "$_mencoder" Modified: trunk/libmpdemux/mp_taglists.c ============================================================================== --- trunk/libmpdemux/mp_taglists.c Tue Feb 14 18:06:09 2012 (r34723) +++ trunk/libmpdemux/mp_taglists.c Tue Feb 14 20:22:22 2012 (r34724) @@ -72,8 +72,6 @@ static const struct AVCodecTag mp_wav_ta { 0, 0 }, }; -static const struct AVCodecTag * const mp_wav_taglists[] = {mp_wav_tags, 0}; - static const struct AVCodecTag mp_codecid_override_tags[] = { { CODEC_ID_8SVX_EXP, MKTAG('8', 'e', 'x', 'p')}, { CODEC_ID_8SVX_FIB, MKTAG('8', 'f', 'i', 'b')}, @@ -157,25 +155,23 @@ static const struct AVCodecTag mp_bmp_ta { 0, 0 }, }; -static const struct AVCodecTag * const mp_bmp_taglists[] = {mp_bmp_tags, 0}; +static void get_taglists(const struct AVCodecTag *dst[3], int audio) +{ + dst[0] = audio ? mp_wav_tags : mp_bmp_tags; + dst[1] = audio ? avformat_get_riff_audio_tags() : avformat_get_riff_video_tags(); + dst[2] = NULL; +} enum CodecID mp_tag2codec_id(uint32_t tag, int audio) { - AVOutputFormat *avi_format; - enum CodecID id = av_codec_get_id(audio ? mp_wav_taglists : mp_bmp_taglists, tag); - if (id != CODEC_ID_NONE) - return id; - avi_format = av_guess_format("avi", NULL, NULL); - if (!avi_format) { - mp_msg(MSGT_DEMUXER, MSGL_FATAL, "MPlayer cannot work properly without AVI muxer in libavformat!\n"); - return 0; - } - return av_codec_get_id(avi_format->codec_tag, tag); + const struct AVCodecTag *taglists[3]; + get_taglists(taglists, audio); + return av_codec_get_id(taglists, tag); } uint32_t mp_codec_id2tag(enum CodecID codec_id, uint32_t old_tag, int audio) { - AVOutputFormat *avi_format; + const struct AVCodecTag *taglists[3]; // For some formats (like PCM) always trust CODEC_ID_* more than codec_tag uint32_t tag = av_codec_get_tag(mp_codecid_override_taglists, codec_id); if (tag) @@ -189,14 +185,6 @@ uint32_t mp_codec_id2tag(enum CodecID co if (tag) return tag; - tag = av_codec_get_tag(audio ? mp_wav_taglists : mp_bmp_taglists, codec_id); - if (tag) - return tag; - - avi_format = av_guess_format("avi", NULL, NULL); - if (!avi_format) { - mp_msg(MSGT_DEMUXER, MSGL_FATAL, "MPlayer cannot work properly without AVI muxer in libavformat!\n"); - return 0; - } - return av_codec_get_tag(avi_format->codec_tag, codec_id); + get_taglists(taglists, audio); + return av_codec_get_tag(taglists, codec_id); } From subversion at mplayerhq.hu Tue Feb 14 20:24:26 2012 From: subversion at mplayerhq.hu (ib) Date: Tue, 14 Feb 2012 20:24:26 +0100 (CET) Subject: [MPlayer-cvslog] r34725 - trunk/gui/util/list.h Message-ID: <20120214192426.6908D13DA09@avserver.banki.hu> Author: ib Date: Tue Feb 14 20:24:26 2012 New Revision: 34725 Log: Change doxygen comments. The old ones gave strange results. Modified: trunk/gui/util/list.h Modified: trunk/gui/util/list.h ============================================================================== --- trunk/gui/util/list.h Tue Feb 14 20:22:22 2012 (r34724) +++ trunk/gui/util/list.h Tue Feb 14 20:24:26 2012 (r34725) @@ -47,11 +47,11 @@ extern plItem *plLastPlayed; extern urlItem *urlList; -/// list manager (playlist, URL list) +/// @name list manager (playlist, URL list) void *listMgr(int cmd, void *data); +/// @name char pointer list operations //@{ -/// char pointer list operations void listRepl(char ***list, const char *search, const char *replace); void listSet(char ***list, const char *entry); //@} From subversion at mplayerhq.hu Tue Feb 14 21:06:43 2012 From: subversion at mplayerhq.hu (reimar) Date: Tue, 14 Feb 2012 21:06:43 +0100 (CET) Subject: [MPlayer-cvslog] r34726 - trunk/libao2/ao_pulse.c Message-ID: <20120214200644.049BE13DA09@avserver.banki.hu> Author: reimar Date: Tue Feb 14 21:06:43 2012 New Revision: 34726 Log: pulse: set outburst size. Avoids incorrectly detecting the device as stuck. Modified: trunk/libao2/ao_pulse.c Modified: trunk/libao2/ao_pulse.c ============================================================================== --- trunk/libao2/ao_pulse.c Tue Feb 14 20:24:26 2012 (r34725) +++ trunk/libao2/ao_pulse.c Tue Feb 14 21:06:43 2012 (r34726) @@ -166,6 +166,7 @@ static int init(int rate_hz, int channel ao_data.samplerate = rate_hz; ao_data.channels = channels; + ao_data.outburst = 8 * channels * (rate_hz / 64); fmt_map = format_maps; while (fmt_map->mp_format != format) { From subversion at mplayerhq.hu Tue Feb 14 21:23:02 2012 From: subversion at mplayerhq.hu (reimar) Date: Tue, 14 Feb 2012 21:23:02 +0100 (CET) Subject: [MPlayer-cvslog] r34727 - trunk/libvo/x11_common.c Message-ID: <20120214202302.67DB913DB59@avserver.banki.hu> Author: reimar Date: Tue Feb 14 21:23:02 2012 New Revision: 34727 Log: Mark window title as UTF-8. Makes setting a -title with UTF-8 characters work. Patch by Vladimir Mosgalin [mosgalin {} VM10124 spb edu], updated by me to latest SVN. Modified: trunk/libvo/x11_common.c Modified: trunk/libvo/x11_common.c ============================================================================== --- trunk/libvo/x11_common.c Tue Feb 14 21:06:43 2012 (r34726) +++ trunk/libvo/x11_common.c Tue Feb 14 21:23:02 2012 (r34727) @@ -115,11 +115,13 @@ static Atom XA_NET_WM_STATE_ABOVE; static Atom XA_NET_WM_STATE_STAYS_ON_TOP; static Atom XA_NET_WM_STATE_BELOW; static Atom XA_NET_WM_PID; +static Atom XA_NET_WM_NAME; static Atom XA_WIN_PROTOCOLS; static Atom XA_WIN_LAYER; static Atom XA_WIN_HINTS; static Atom XAWM_PROTOCOLS; static Atom XAWM_DELETE_WINDOW; +static Atom XAUTF8_STRING; #define XA_INIT(x) XA##x = XInternAtom(mDisplay, #x, False) @@ -357,11 +359,13 @@ static void init_atoms(void) XA_INIT(_NET_WM_STATE_STAYS_ON_TOP); XA_INIT(_NET_WM_STATE_BELOW); XA_INIT(_NET_WM_PID); + XA_INIT(_NET_WM_NAME); XA_INIT(_WIN_PROTOCOLS); XA_INIT(_WIN_LAYER); XA_INIT(_WIN_HINTS); XA_INIT(WM_PROTOCOLS); XA_INIT(WM_DELETE_WINDOW); + XA_INIT(UTF8_STRING); } void update_xinerama_info(void) { @@ -1132,6 +1136,8 @@ void vo_x11_create_vo_window(XVisualInfo if (flags & VOFLAG_HIDDEN) goto final; XStoreName(mDisplay, vo_window, title); + XChangeProperty(mDisplay, vo_window, XA_NET_WM_NAME, XAUTF8_STRING, + 8, PropModeReplace, title, strlen(title)); if (window_state & VOFLAG_HIDDEN) { XSizeHints hint; XEvent xev; From subversion at mplayerhq.hu Wed Feb 15 15:20:46 2012 From: subversion at mplayerhq.hu (iive) Date: Wed, 15 Feb 2012 15:20:46 +0100 (CET) Subject: [MPlayer-cvslog] r34728 - trunk/configure Message-ID: <20120215142046.5C7CD13E0EA@avserver.banki.hu> Author: iive Date: Wed Feb 15 15:20:45 2012 New Revision: 34728 Log: Fix linking after FFmpeg merge. This time the rtmp protocols that are available only when librtmp, were renamed to librtmp* so we have to update the code that removes them in our configure. Added and the basic LIBRTMP one too. Modified: trunk/configure Modified: trunk/configure ============================================================================== --- trunk/configure Tue Feb 14 21:23:02 2012 (r34727) +++ trunk/configure Wed Feb 15 15:20:45 2012 (r34728) @@ -6702,7 +6702,7 @@ else _librtmp=no def_librtmp='#define CONFIG_LIBRTMP 0' noinputmodules="librtmp $noinputmodules" - libavprotocols=$(echo $libavprotocols | sed -e s/RTMPE_PROTOCOL// -e s/RTMPS_PROTOCOL// -e s/RTMPT_PROTOCOL// -e s/RTMPTE_PROTOCOL// ) + libavprotocols=$(echo $libavprotocols | sed -e s/LIBRTMP_PROTOCOL// -e s/LIBRTMPE_PROTOCOL// -e s/LIBRTMPS_PROTOCOL// -e s/LIBRTMPT_PROTOCOL// -e s/LIBRTMPTE_PROTOCOL// ) fi echores "$_librtmp" From subversion at mplayerhq.hu Wed Feb 15 15:26:06 2012 From: subversion at mplayerhq.hu (iive) Date: Wed, 15 Feb 2012 15:26:06 +0100 (CET) Subject: [MPlayer-cvslog] [propchange]: r34728 - svn:log Message-ID: <20120215142606.B1AF013E0FB@avserver.banki.hu> Author: iive Revision: 34728 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1,5 +1,5 @@ Fix linking after FFmpeg merge. -This time the rtmp protocols that are available only when librtmp, +This time the rtmp protocols that are available only with librtmp were renamed to librtmp* so we have to update the code that removes them in our configure. Added and the basic LIBRTMP one too. From subversion at mplayerhq.hu Fri Feb 17 21:07:22 2012 From: subversion at mplayerhq.hu (cehoyos) Date: Fri, 17 Feb 2012 21:07:22 +0100 (CET) Subject: [MPlayer-cvslog] r34732 - in trunk: etc/codecs.conf libmpdemux/mp_taglists.c Message-ID: <20120217200722.1653113F462@avserver.banki.hu> Author: cehoyos Date: Fri Feb 17 21:07:21 2012 New Revision: 34732 Log: Support playback of CDXL files with -demuxer lavf. Modified: trunk/etc/codecs.conf trunk/libmpdemux/mp_taglists.c Modified: trunk/etc/codecs.conf ============================================================================== --- trunk/etc/codecs.conf Fri Feb 17 03:04:41 2012 (r34731) +++ trunk/etc/codecs.conf Fri Feb 17 21:07:21 2012 (r34732) @@ -118,6 +118,14 @@ videocodec ffzmbv dll "zmbv" out RGB24 +videocodec ffcdxl + info "FFmpeg CDXL" + status working + fourcc CDXL ; internal MPlayer FourCC + driver ffmpeg + dll cdxl + out BGR24,BGR8 + videocodec geov info "GeoCodec" comment "crashes without -nosound, hangs on exit" Modified: trunk/libmpdemux/mp_taglists.c ============================================================================== --- trunk/libmpdemux/mp_taglists.c Fri Feb 17 03:04:41 2012 (r34731) +++ trunk/libmpdemux/mp_taglists.c Fri Feb 17 21:07:21 2012 (r34732) @@ -121,6 +121,7 @@ static const struct AVCodecTag mp_bmp_ta { CODEC_ID_BMV_VIDEO, MKTAG('B', 'M', 'V', 'V')}, { CODEC_ID_C93, MKTAG('C', '9', '3', 'V')}, { CODEC_ID_CDGRAPHICS, MKTAG('C', 'D', 'G', 'R')}, + { CODEC_ID_CDXL, MKTAG('C', 'D', 'X', 'L')}, { CODEC_ID_CMV, MKTAG('M', 'V', 'I', 'f')}, { CODEC_ID_DFA, MKTAG('C', 'D', 'F', 'A')}, { CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n')}, From subversion at mplayerhq.hu Sat Feb 18 01:08:30 2012 From: subversion at mplayerhq.hu (al) Date: Sat, 18 Feb 2012 01:08:30 +0100 (CET) Subject: [MPlayer-cvslog] r34733 - in trunk: libao2/ao_sdl.c libvo/sdl_common.c libvo/vo_sdl.c osdep/setenv.c osdep/setenv.h Message-ID: <20120218000830.D688D13F53D@avserver.banki.hu> Author: al Date: Sat Feb 18 01:08:30 2012 New Revision: 34733 Log: Fix compiling with osdep setenv Since we have -Werror-implicit-function-declaration in CFLAGS, we need a prototype for the osdep setenv() implementation. Reported-by: redxii (in #mplayer IRC channel) Added: trunk/osdep/setenv.h Modified: trunk/libao2/ao_sdl.c trunk/libvo/sdl_common.c trunk/libvo/vo_sdl.c trunk/osdep/setenv.c Modified: trunk/libao2/ao_sdl.c ============================================================================== --- trunk/libao2/ao_sdl.c Fri Feb 17 21:07:21 2012 (r34732) +++ trunk/libao2/ao_sdl.c Sat Feb 18 01:08:30 2012 (r34733) @@ -37,6 +37,7 @@ #include #endif #include "osdep/timer.h" +#include "osdep/setenv.h" #include "libavutil/fifo.h" Modified: trunk/libvo/sdl_common.c ============================================================================== --- trunk/libvo/sdl_common.c Fri Feb 17 21:07:21 2012 (r34732) +++ trunk/libvo/sdl_common.c Sat Feb 18 01:08:30 2012 (r34733) @@ -22,6 +22,7 @@ #include "mp_msg.h" #include "mp_fifo.h" #include "osdep/keycodes.h" +#include "osdep/setenv.h" #include "input/input.h" #include "input/mouse.h" #include "video_out.h" Modified: trunk/libvo/vo_sdl.c ============================================================================== --- trunk/libvo/vo_sdl.c Fri Feb 17 21:07:21 2012 (r34732) +++ trunk/libvo/vo_sdl.c Sat Feb 18 01:08:30 2012 (r34733) @@ -67,6 +67,7 @@ #include "sub/sub.h" #include "aspect.h" #include "libmpcodecs/vfcap.h" +#include "osdep/setenv.h" #ifdef CONFIG_X11 #include Modified: trunk/osdep/setenv.c ============================================================================== --- trunk/osdep/setenv.c Fri Feb 17 21:07:21 2012 (r34732) +++ trunk/osdep/setenv.c Sat Feb 18 01:08:30 2012 (r34733) @@ -27,6 +27,8 @@ #endif #include +#include "setenv.h" + int setenv(const char *name, const char *val, int overwrite) { int len = strlen(name) + strlen(val) + 2; Added: trunk/osdep/setenv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/osdep/setenv.h Sat Feb 18 01:08:30 2012 (r34733) @@ -0,0 +1,28 @@ +/* + * 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_SETENV_H +#define MPLAYER_SETENV_H + +#include "config.h" + +#if !HAVE_SETENV +int setenv(const char *name, const char *val, int overwrite); +#endif + +#endif /* MPLAYER_SETENV_H */ From subversion at mplayerhq.hu Sat Feb 18 17:22:38 2012 From: subversion at mplayerhq.hu (reimar) Date: Sat, 18 Feb 2012 17:22:38 +0100 (CET) Subject: [MPlayer-cvslog] r34734 - trunk/libvo/jpeg_enc.c Message-ID: <20120218162238.3952613FBF2@avserver.banki.hu> Author: reimar Date: Sat Feb 18 17:22:37 2012 New Revision: 34734 Log: Attempt to make --enable-zr compile again. Modified: trunk/libvo/jpeg_enc.c Modified: trunk/libvo/jpeg_enc.c ============================================================================== --- trunk/libvo/jpeg_enc.c Sat Feb 18 01:08:30 2012 (r34733) +++ trunk/libvo/jpeg_enc.c Sat Feb 18 17:22:37 2012 (r34734) @@ -81,7 +81,7 @@ static void convert_matrix(MpegEncContex qmat[qscale][i] = (int)((UINT64_C(1) << (QMAT_SHIFT-3))/ (qscale * quant_matrix[j])); } - } else if (s->dsp.fdct == fdct_ifast) { + } else if (s->dsp.fdct == ff_fdct_ifast) { for(i=0;i<64;i++) { const int j = s->dsp.idct_permutation[i]; /* 16 <= qscale * quant_matrix[i] <= 7905 */ @@ -304,7 +304,7 @@ jpeg_enc_t *jpeg_enc_init(int w, int h, j->s->out_format = FMT_MJPEG; j->s->intra_only = 1; j->s->encoding = 1; - j->s->pict_type = FF_I_TYPE; + j->s->pict_type = AV_PICTURE_TYPE_I; j->s->y_dc_scale = 8; j->s->c_dc_scale = 8; @@ -335,7 +335,7 @@ jpeg_enc_t *jpeg_enc_init(int w, int h, /* make MPV_common_init allocate important buffers, like s->block */ j->s->avctx->thread_count = 1; - if (MPV_common_init(j->s) < 0) { + if (ff_MPV_common_init(j->s) < 0) { av_free(j->s); av_free(j); return NULL; From subversion at mplayerhq.hu Sat Feb 18 20:33:48 2012 From: subversion at mplayerhq.hu (reimar) Date: Sat, 18 Feb 2012 20:33:48 +0100 (CET) Subject: [MPlayer-cvslog] r34735 - trunk/libmpcodecs/vf_zrmjpeg.c Message-ID: <20120218193348.17F3A13FD82@avserver.banki.hu> Author: reimar Date: Sat Feb 18 20:33:47 2012 New Revision: 34735 Log: One more fix for --enable-zr. This code is almost a duplicate of the one in libvo, but unfortunately it has slightly different features. Would be good to fix but unlikely that anyone will consider it worth the effort. Modified: trunk/libmpcodecs/vf_zrmjpeg.c Modified: trunk/libmpcodecs/vf_zrmjpeg.c ============================================================================== --- trunk/libmpcodecs/vf_zrmjpeg.c Sat Feb 18 17:22:37 2012 (r34734) +++ trunk/libmpcodecs/vf_zrmjpeg.c Sat Feb 18 20:33:47 2012 (r34735) @@ -123,7 +123,7 @@ static void convert_matrix(MpegEncContex (QMAT_SHIFT-3))/ (qscale*quant_matrix[j])); } - } else if (s->dsp.fdct == fdct_ifast) { + } else if (s->dsp.fdct == ff_fdct_ifast) { for (i = 0; i < 64; i++) { const int j = s->dsp.idct_permutation[i]; /* 16 <= qscale * quant_matrix[i] <= 7905 @@ -447,7 +447,7 @@ static jpeg_enc_t *jpeg_enc_init(int w, j->s->out_format = FMT_MJPEG; j->s->intra_only = 1; // Generate only intra pictures for jpeg j->s->encoding = 1; // Set mode to encode - j->s->pict_type = FF_I_TYPE; + j->s->pict_type = AV_PICTURE_TYPE_I; j->s->y_dc_scale = 8; j->s->c_dc_scale = 8; @@ -500,7 +500,7 @@ static jpeg_enc_t *jpeg_enc_init(int w, /* make MPV_common_init allocate important buffers, like s->block * Also initializes dsputil */ - if (MPV_common_init(j->s) < 0) { + if (ff_MPV_common_init(j->s) < 0) { av_free(j->s); av_free(j); return NULL; From subversion at mplayerhq.hu Sun Feb 19 14:15:41 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 19 Feb 2012 14:15:41 +0100 (CET) Subject: [MPlayer-cvslog] r34736 - in trunk: command.c libmpdemux/demuxer.c libmpdemux/demuxer.h stream/cache2.c stream/stream.h stream/stream_bd.c stream/stream_dvd.c stream/stream_dvdnav.c Message-ID: <20120219131542.0A33A1404D8@avserver.banki.hu> Author: reimar Date: Sun Feb 19 14:15:41 2012 New Revision: 34736 Log: Code cleanup: Use a stream_control instead of global functions to get the language associate with a audio or subtitle stream from the streaming layer. Modified: trunk/command.c trunk/libmpdemux/demuxer.c trunk/libmpdemux/demuxer.h trunk/stream/cache2.c trunk/stream/stream.h trunk/stream/stream_bd.c trunk/stream/stream_dvd.c trunk/stream/stream_dvdnav.c Modified: trunk/command.c ============================================================================== --- trunk/command.c Sat Feb 18 20:33:47 2012 (r34735) +++ trunk/command.c Sun Feb 19 14:15:41 2012 (r34736) @@ -910,30 +910,7 @@ static int mp_property_audio(m_option_t *(char **) arg = strdup(MSGTR_Disabled); else { char lang[40] = MSGTR_Unknown; - sh_audio_t* sh = mpctx->sh_audio; - if (sh && sh->lang) - av_strlcpy(lang, sh->lang, 40); - // TODO: use a proper STREAM_CTRL instead of this mess - else if (sh && mpctx->stream->type == STREAMTYPE_BD) { - const char *l = bd_lang_from_id(mpctx->stream, audio_id); - if (l) - av_strlcpy(lang, l, sizeof(lang)); - } -#ifdef CONFIG_DVDREAD - else if (mpctx->stream->type == STREAMTYPE_DVD) { - int code = dvd_lang_from_aid(mpctx->stream, current_id); - if (code) { - lang[0] = code >> 8; - lang[1] = code; - lang[2] = 0; - } - } -#endif - -#ifdef CONFIG_DVDNAV - else if (mpctx->stream->type == STREAMTYPE_DVDNAV) - mp_dvdnav_lang_from_aid(mpctx->stream, current_id, lang); -#endif + demuxer_audio_lang(mpctx->demuxer, current_id, lang, sizeof(lang)); *(char **) arg = malloc(64); snprintf(*(char **) arg, 64, "(%d) %s", audio_id, lang); } @@ -1497,36 +1474,6 @@ static int mp_property_sub(m_option_t *p strlen(tmp) < 20 ? tmp : tmp + strlen(tmp) - 19); return M_PROPERTY_OK; } -#ifdef CONFIG_DVDNAV - if (mpctx->stream->type == STREAMTYPE_DVDNAV) { - if (vo_spudec && dvdsub_id >= 0) { - unsigned char lang[3]; - if (mp_dvdnav_lang_from_sid(mpctx->stream, dvdsub_id, lang)) { - snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); - return M_PROPERTY_OK; - } - } - } -#endif - - if (mpctx->stream->type == STREAMTYPE_BD - && d_sub && d_sub->sh && dvdsub_id >= 0) { - const char *lang = bd_lang_from_id(mpctx->stream, ((sh_sub_t*)d_sub->sh)->sid); - if (!lang) lang = MSGTR_Unknown; - snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); - return M_PROPERTY_OK; - } - - if ((mpctx->demuxer->type == DEMUXER_TYPE_MATROSKA - || mpctx->demuxer->type == DEMUXER_TYPE_LAVF - || mpctx->demuxer->type == DEMUXER_TYPE_LAVF_PREFERRED - || mpctx->demuxer->type == DEMUXER_TYPE_OGG) - && d_sub && d_sub->sh && dvdsub_id >= 0) { - const char* lang = ((sh_sub_t*)d_sub->sh)->lang; - if (!lang) lang = MSGTR_Unknown; - snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); - return M_PROPERTY_OK; - } if (vo_vobsub && vobsub_id >= 0) { const char *language = MSGTR_Unknown; @@ -1535,20 +1482,10 @@ static int mp_property_sub(m_option_t *p vobsub_id, language ? language : MSGTR_Unknown); return M_PROPERTY_OK; } -#ifdef CONFIG_DVDREAD - if (vo_spudec && mpctx->stream->type == STREAMTYPE_DVD - && dvdsub_id >= 0) { - char lang[3]; - int code = dvd_lang_from_sid(mpctx->stream, dvdsub_id); - lang[0] = code >> 8; - lang[1] = code; - lang[2] = 0; - snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); - return M_PROPERTY_OK; - } -#endif if (dvdsub_id >= 0) { - snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, MSGTR_Unknown); + char lang[40] = MSGTR_Unknown; + demuxer_sub_lang(mpctx->demuxer, dvdsub_id, lang, sizeof(lang)); + snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); return M_PROPERTY_OK; } snprintf(*(char **) arg, 63, MSGTR_Disabled); Modified: trunk/libmpdemux/demuxer.c ============================================================================== --- trunk/libmpdemux/demuxer.c Sat Feb 18 20:33:47 2012 (r34735) +++ trunk/libmpdemux/demuxer.c Sun Feb 19 14:15:41 2012 (r34736) @@ -53,6 +53,7 @@ #endif #include "av_helpers.h" #endif +#include "libavutil/avstring.h" // This is quite experimental, in particular it will mess up the pts values // in the queue - on the other hand it might fix some issues like generating @@ -1785,6 +1786,50 @@ int demuxer_set_angle(demuxer_t *demuxer return angle; } +int demuxer_audio_lang(demuxer_t *d, int id, char *buf, int buf_len) +{ + struct stream_lang_req req; + sh_audio_t *sh; + if (id < 0 || id >= MAX_A_STREAMS) + return -1; + sh = d->a_streams[id]; + if (!sh) + return -1; + if (sh->lang) { + av_strlcpy(buf, sh->lang, buf_len); + return 0; + } + req.type = stream_ctrl_audio; + req.id = sh->aid; + if (stream_control(d->stream, STREAM_CTRL_GET_LANG, &req) == STREAM_OK) { + av_strlcpy(buf, req.buf, buf_len); + return 0; + } + return -1; +} + +int demuxer_sub_lang(demuxer_t *d, int id, char *buf, int buf_len) +{ + struct stream_lang_req req; + sh_sub_t *sh; + if (id < 0 || id >= MAX_S_STREAMS) + return -1; + sh = d->s_streams[id]; + if (!sh) + return -1; + if (sh->lang) { + av_strlcpy(buf, sh->lang, buf_len); + return 0; + } + req.type = stream_ctrl_sub; + req.id = sh->sid; + if (stream_control(d->stream, STREAM_CTRL_GET_LANG, &req) == STREAM_OK) { + av_strlcpy(buf, req.buf, buf_len); + return 0; + } + return -1; +} + int demuxer_audio_track_by_lang(demuxer_t *d, char *lang) { int i, len; Modified: trunk/libmpdemux/demuxer.h ============================================================================== --- trunk/libmpdemux/demuxer.h Sat Feb 18 20:33:47 2012 (r34735) +++ trunk/libmpdemux/demuxer.h Sun Feb 19 14:15:41 2012 (r34736) @@ -473,6 +473,9 @@ int demuxer_set_angle(demuxer_t *demuxer /// Get number of angles. int demuxer_angles_count(demuxer_t *demuxer); +int demuxer_audio_lang(demuxer_t *d, int id, char *buf, int buf_len); +int demuxer_sub_lang(demuxer_t *d, int id, char *buf, int buf_len); + // get the index of a track // lang is a comma-separated list int demuxer_audio_track_by_lang(demuxer_t* demuxer, char* lang); Modified: trunk/stream/cache2.c ============================================================================== --- trunk/stream/cache2.c Sat Feb 18 20:33:47 2012 (r34735) +++ trunk/stream/cache2.c Sun Feb 19 14:15:41 2012 (r34736) @@ -93,6 +93,7 @@ typedef struct { volatile int control; volatile unsigned control_uint_arg; volatile double control_double_arg; + volatile struct stream_lang_req control_lang_arg; volatile int control_res; volatile double stream_time_length; volatile double stream_time_pos; @@ -318,6 +319,9 @@ static int cache_execute_control(cache_v s->control_res = s->stream->control(s->stream, s->control, &uint_res); s->control_uint_arg = uint_res; break; + case STREAM_CTRL_GET_LANG: + s->control_res = s->stream->control(s->stream, s->control, (void *)&s->control_lang_arg); + break; default: s->control_res = STREAM_UNSUPPORTED; break; @@ -628,6 +632,8 @@ int cache_do_control(stream_t *stream, i case STREAM_CTRL_GET_CURRENT_TIME: *(double *)arg = s->stream_time_pos; return s->stream_time_pos != MP_NOPTS_VALUE ? STREAM_OK : STREAM_UNSUPPORTED; + case STREAM_CTRL_GET_LANG: + s->control_lang_arg = *(struct stream_lang_req *)arg; case STREAM_CTRL_GET_NUM_CHAPTERS: case STREAM_CTRL_GET_CURRENT_CHAPTER: case STREAM_CTRL_GET_ASPECT_RATIO: @@ -673,6 +679,9 @@ int cache_do_control(stream_t *stream, i case STREAM_CTRL_GET_ANGLE: *(unsigned *)arg = s->control_uint_arg; break; + case STREAM_CTRL_GET_LANG: + *(struct stream_lang_req *)arg = s->control_lang_arg; + break; } return s->control_res; } Modified: trunk/stream/stream.h ============================================================================== --- trunk/stream/stream.h Sat Feb 18 20:33:47 2012 (r34735) +++ trunk/stream/stream.h Sun Feb 19 14:15:41 2012 (r34736) @@ -99,7 +99,18 @@ #define STREAM_CTRL_GET_ANGLE 10 #define STREAM_CTRL_SET_ANGLE 11 #define STREAM_CTRL_GET_NUM_TITLES 12 +#define STREAM_CTRL_GET_LANG 13 + +enum stream_ctrl_type { + stream_ctrl_audio, + stream_ctrl_sub, +}; +struct stream_lang_req { + enum stream_ctrl_type type; + int id; + char buf[40]; +}; typedef enum { streaming_stopped_e, Modified: trunk/stream/stream_bd.c ============================================================================== --- trunk/stream/stream_bd.c Sat Feb 18 20:33:47 2012 (r34735) +++ trunk/stream/stream_bd.c Sun Feb 19 14:15:41 2012 (r34736) @@ -25,6 +25,7 @@ #include "libavutil/common.h" #include "libavutil/aes.h" #include "libavutil/sha.h" +#include "libavutil/avstring.h" #include "libmpdemux/demuxer.h" #include "libavutil/intreadwrite.h" #include "m_struct.h" @@ -372,7 +373,7 @@ static int is_sub_type(int type) return 0; } -const char *bd_lang_from_id(stream_t *s, int id) +static const char *bd_lang_from_id(stream_t *s, int id) { struct bd_priv *bd = s->priv; int i; @@ -451,6 +452,22 @@ static void get_clipinf(struct bd_priv * free_stream(file); } +static int bd_stream_control(stream_t *s, int cmd, void *arg) +{ + switch (cmd) { + case STREAM_CTRL_GET_LANG: + { + struct stream_lang_req *req = arg; + const char *lang = bd_lang_from_id(s, req->id); + if (!lang) + return STREAM_ERROR; + av_strlcpy(req->buf, lang, sizeof(req->buf)); + return STREAM_OK; + } + } + return STREAM_UNSUPPORTED; +} + static int bd_stream_open(stream_t *s, int mode, void* opts, int* file_format) { char filename[PATH_MAX]; @@ -470,6 +487,7 @@ static int bd_stream_open(stream_t *s, i s->flags = STREAM_READ | MP_STREAM_SEEK; s->fill_buffer = bd_stream_fill_buffer; s->seek = bd_stream_seek; + s->control = bd_stream_control; s->close = bd_stream_close; s->start_pos = 0; s->priv = bd; Modified: trunk/stream/stream_dvd.c ============================================================================== --- trunk/stream/stream_dvd.c Sat Feb 18 20:33:47 2012 (r34735) +++ trunk/stream/stream_dvd.c Sun Feb 19 14:15:41 2012 (r34736) @@ -149,7 +149,7 @@ int dvd_chapter_from_cell(dvd_priv_t* dv return chapter; } -int dvd_lang_from_aid(stream_t *stream, int id) { +static int dvd_lang_from_aid(stream_t *stream, int id) { dvd_priv_t *d; int i; if (!stream) return 0; @@ -195,7 +195,7 @@ int dvd_number_of_subs(stream_t *stream) return maxid + 1; } -int dvd_lang_from_sid(stream_t *stream, int id) { +static int dvd_lang_from_sid(stream_t *stream, int id) { int i; dvd_priv_t *d; if (!stream) return 0; @@ -731,6 +731,25 @@ static int control(stream_t *stream,int d->angle_seek = 1; return 1; } + case STREAM_CTRL_GET_LANG: + { + struct stream_lang_req *req = arg; + int lang = 0; + switch(req->type) { + case stream_ctrl_audio: + lang = dvd_lang_from_aid(stream, req->id); + break; + case stream_ctrl_sub: + lang = dvd_lang_from_sid(stream, req->id); + break; + } + if (!lang) + break; + req->buf[0] = lang >> 8; + req->buf[1] = lang; + req->buf[2] = 0; + return STREAM_OK; + } } return STREAM_UNSUPPORTED; } Modified: trunk/stream/stream_dvdnav.c ============================================================================== --- trunk/stream/stream_dvdnav.c Sat Feb 18 20:33:47 2012 (r34735) +++ trunk/stream/stream_dvdnav.c Sun Feb 19 14:15:41 2012 (r34736) @@ -402,6 +402,9 @@ static int fill_buffer(stream_t *s, char return len; } +static int mp_dvdnav_lang_from_sid(stream_t *stream, int sid); +static int mp_dvdnav_lang_from_aid(stream_t *stream, int sid); + static int control(stream_t *stream, int cmd, void* arg) { dvdnav_priv_t* priv=stream->priv; int tit, part; @@ -496,6 +499,25 @@ static int control(stream_t *stream, int if(dvdnav_angle_change(priv->dvdnav, new_angle) != DVDNAV_STATUS_OK) return 1; } + case STREAM_CTRL_GET_LANG: + { + struct stream_lang_req *req = arg; + int lang = 0; + switch(req->type) { + case stream_ctrl_audio: + lang = mp_dvdnav_lang_from_aid(stream, req->id); + break; + case stream_ctrl_sub: + lang = mp_dvdnav_lang_from_sid(stream, req->id); + break; + } + if (!lang) + break; + req->buf[0] = lang >> 8; + req->buf[1] = lang; + req->buf[2] = 0; + return STREAM_OK; + } } return STREAM_UNSUPPORTED; @@ -758,13 +780,12 @@ int mp_dvdnav_aid_from_lang(stream_t *st } /** - * \brief mp_dvdnav_lang_from_aid() assigns to buf the language corresponding to audio id 'aid' + * \brief mp_dvdnav_lang_from_aid() returns the language corresponding to audio id 'aid' * \param stream: - stream pointer * \param sid: physical subtitle id - * \param buf: buffer to contain the 2-chars language string - * \return 0 on error, 1 if successful + * \return 0 on error, otherwise language id */ -int mp_dvdnav_lang_from_aid(stream_t *stream, int aid, unsigned char *buf) { +static int mp_dvdnav_lang_from_aid(stream_t *stream, int aid) { uint8_t lg; uint16_t lang; dvdnav_priv_t * priv = stream->priv; @@ -775,10 +796,7 @@ int mp_dvdnav_lang_from_aid(stream_t *st if(lg == 0xff) return 0; lang = dvdnav_audio_stream_to_lang(priv->dvdnav, lg); if(lang == 0xffff) return 0; - buf[0] = lang >> 8; - buf[1] = lang & 0xFF; - buf[2] = 0; - return 1; + return lang; } @@ -810,13 +828,12 @@ int mp_dvdnav_sid_from_lang(stream_t *st } /** - * \brief mp_dvdnav_lang_from_sid() assigns to buf the language corresponding to subtitle id 'sid' + * \brief mp_dvdnav_lang_from_sid() returns the language corresponding to subtitle id 'sid' * \param stream: - stream pointer * \param sid: physical subtitle id - * \param buf: buffer to contain the 2-chars language string - * \return 0 on error, 1 if successful + * \return 0 on error, otherwise language id */ -int mp_dvdnav_lang_from_sid(stream_t *stream, int sid, unsigned char *buf) { +static int mp_dvdnav_lang_from_sid(stream_t *stream, int sid) { uint8_t k; uint16_t lang; dvdnav_priv_t *priv = stream->priv; @@ -828,10 +845,7 @@ int mp_dvdnav_lang_from_sid(stream_t *st return 0; lang = dvdnav_spu_stream_to_lang(priv->dvdnav, k); if(lang == 0xffff) return 0; - buf[0] = lang >> 8; - buf[1] = lang & 0xFF; - buf[2] = 0; - return 1; + return lang; } /** From subversion at mplayerhq.hu Sun Feb 19 14:39:16 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 19 Feb 2012 14:39:16 +0100 (CET) Subject: [MPlayer-cvslog] r34737 - trunk/stream/stream_bluray.c Message-ID: <20120219133916.7EA1A14053D@avserver.banki.hu> Author: reimar Date: Sun Feb 19 14:39:16 2012 New Revision: 34737 Log: Support showing the stream language with br:// playback. Modified: trunk/stream/stream_bluray.c Modified: trunk/stream/stream_bluray.c ============================================================================== --- trunk/stream/stream_bluray.c Sun Feb 19 14:15:41 2012 (r34736) +++ trunk/stream/stream_bluray.c Sun Feb 19 14:39:16 2012 (r34737) @@ -191,6 +191,36 @@ static int bluray_stream_control(stream_ return 1; } + case STREAM_CTRL_GET_LANG: { + struct stream_lang_req *req = arg; + BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, b->current_title, b->current_angle); + if (ti->clip_count) { + BLURAY_STREAM_INFO *si = NULL; + int count = 0; + switch (req->type) { + case stream_ctrl_audio: + count = ti->clips[0].audio_stream_count; + si = ti->clips[0].audio_streams; + break; + case stream_ctrl_sub: + count = ti->clips[0].pg_stream_count; + si = ti->clips[0].pg_streams; + break; + } + while (count-- > 0) { + if (si->pid == req->id) { + memcpy(req->buf, si->lang, 4); + req->buf[4] = 0; + bd_free_title_info(ti); + return STREAM_OK; + } + si++; + } + } + bd_free_title_info(ti); + return STREAM_ERROR; + } + default: break; } From subversion at mplayerhq.hu Sun Feb 19 14:49:04 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 19 Feb 2012 14:49:04 +0100 (CET) Subject: [MPlayer-cvslog] r34738 - trunk/libmpcodecs/dec_audio.c Message-ID: <20120219134904.9569E14055A@avserver.banki.hu> Author: reimar Date: Sun Feb 19 14:49:04 2012 New Revision: 34738 Log: Add a safeguard to avoid crash if the decoder e.g. claims 0 channels. That would be a decoder bug, but an extra check can still help. Modified: trunk/libmpcodecs/dec_audio.c Modified: trunk/libmpcodecs/dec_audio.c ============================================================================== --- trunk/libmpcodecs/dec_audio.c Sun Feb 19 14:39:16 2012 (r34737) +++ trunk/libmpcodecs/dec_audio.c Sun Feb 19 14:49:04 2012 (r34738) @@ -449,6 +449,8 @@ int mp_decode_audio(sh_audio_t *sh_audio * more space in the output buffer than the minimum length we try to * decode. */ int max_decode_len = sh_audio->a_buffer_size - sh_audio->audio_out_minsize; + if (!unitsize) + return -1; max_decode_len -= max_decode_len % unitsize; while (sh_audio->a_out_buffer_len < minlen) { From tempn at twmi.rr.com Sun Feb 19 16:01:52 2012 From: tempn at twmi.rr.com (compn) Date: Sun, 19 Feb 2012 10:01:52 -0500 Subject: [MPlayer-cvslog] r34738 - trunk/libmpcodecs/dec_audio.c In-Reply-To: <20120219134904.9569E14055A@avserver.banki.hu> References: <20120219134904.9569E14055A@avserver.banki.hu> Message-ID: <20120219100152.1aec9ef5.tempn@twmi.rr.com> On Sun, 19 Feb 2012 14:49:04 +0100 (CET), reimar wrote: >Author: reimar >Date: Sun Feb 19 14:49:04 2012 >New Revision: 34738 > >Log: >Add a safeguard to avoid crash if the decoder e.g. claims 0 channels. >That would be a decoder bug, but an extra check can still help. cant we just fake channels=2 if there is a bug? or would you rather fix whatever decoder bug? -compn From subversion at mplayerhq.hu Sun Feb 19 15:58:53 2012 From: subversion at mplayerhq.hu (cehoyos) Date: Sun, 19 Feb 2012 15:58:53 +0100 (CET) Subject: [MPlayer-cvslog] r34739 - in trunk/stream: stream_bd.h stream_dvd.h stream_dvdnav.h Message-ID: <20120219145853.E0FCB1405FA@avserver.banki.hu> Author: cehoyos Date: Sun Feb 19 15:58:53 2012 New Revision: 34739 Log: Fix compilation after r34736. Modified: trunk/stream/stream_bd.h trunk/stream/stream_dvd.h trunk/stream/stream_dvdnav.h Modified: trunk/stream/stream_bd.h ============================================================================== --- trunk/stream/stream_bd.h Sun Feb 19 14:49:04 2012 (r34738) +++ trunk/stream/stream_bd.h Sun Feb 19 15:58:53 2012 (r34739) @@ -21,7 +21,6 @@ #include "stream.h" -const char *bd_lang_from_id(stream_t *s, int id); int bd_aid_from_lang(stream_t *s, const char *lang); int bd_sid_from_lang(stream_t *s, const char *lang); Modified: trunk/stream/stream_dvd.h ============================================================================== --- trunk/stream/stream_dvd.h Sun Feb 19 14:49:04 2012 (r34738) +++ trunk/stream/stream_dvd.h Sun Feb 19 15:58:53 2012 (r34739) @@ -57,8 +57,6 @@ typedef struct { } dvd_priv_t; int dvd_number_of_subs(stream_t *stream); -int dvd_lang_from_aid(stream_t *stream, int id); -int dvd_lang_from_sid(stream_t *stream, int id); int dvd_aid_from_lang(stream_t *stream, const unsigned char* lang); int dvd_sid_from_lang(stream_t *stream, const unsigned char* lang); int dvd_chapter_from_cell(dvd_priv_t *dvd,int title,int cell); Modified: trunk/stream/stream_dvdnav.h ============================================================================== --- trunk/stream/stream_dvdnav.h Sun Feb 19 14:49:04 2012 (r34738) +++ trunk/stream/stream_dvdnav.h Sun Feb 19 15:58:53 2012 (r34739) @@ -31,9 +31,7 @@ typedef struct { int mp_dvdnav_number_of_subs(stream_t *stream); int mp_dvdnav_aid_from_audio_num(stream_t *stream, int audio_num); int mp_dvdnav_aid_from_lang(stream_t *stream, const unsigned char *language); -int mp_dvdnav_lang_from_aid(stream_t *stream, int id, unsigned char *buf); int mp_dvdnav_sid_from_lang(stream_t *stream, const unsigned char *language); -int mp_dvdnav_lang_from_sid(stream_t *stream, int sid, unsigned char *buf); void mp_dvdnav_handle_input(stream_t *stream, int cmd, int *button); void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* button); void mp_dvdnav_get_highlight (stream_t *stream, nav_highlight_t *hl); From subversion at mplayerhq.hu Sun Feb 19 16:21:23 2012 From: subversion at mplayerhq.hu (diego) Date: Sun, 19 Feb 2012 16:21:23 +0100 (CET) Subject: [MPlayer-cvslog] r34740 - in trunk: Makefile libaf/af.c libaf/af_lavcac3enc.c Message-ID: <20120219152123.604B2140629@avserver.banki.hu> Author: diego Date: Sun Feb 19 16:21:23 2012 New Revision: 34740 Log: lavcac3enc: make the filter buildable with shared FFmpeg Add some local definitions and a bitrate array to make FFmpeg private headers and symbols unneeded, allowing lavcac3enc to be built with shared FFmpeg. This also fixes the issue that the filter code expects the FFmpeg private definition AC3_MAX_CHANNELS to be the maximum number of "logical" channels to be encoded into AC-3, while it actually specifies the maximum channel count in the bitstream, which may include a coupling channel which is not an actual full audio channel. The issue is fixed by making the local AC3_MAX_CHANNELS have the value 6, which the FFmpeg private header also had before the addition of coupling support in 2011. patch by Anssi Hannula, anssi.hannula iki fi Modified: trunk/Makefile trunk/libaf/af.c trunk/libaf/af_lavcac3enc.c Modified: trunk/Makefile ============================================================================== --- trunk/Makefile Sun Feb 19 15:58:53 2012 (r34739) +++ trunk/Makefile Sun Feb 19 16:21:23 2012 (r34740) @@ -70,6 +70,7 @@ SRCS_COMMON-$(FAAD) += SRCS_COMMON-$(FASTMEMCPY) += libvo/aclib.c SRCS_COMMON-$(FFMPEG) += av_helpers.c \ av_opts.c \ + libaf/af_lavcac3enc.c \ libaf/af_lavcresample.c \ libmpcodecs/ad_ffmpeg.c \ libmpcodecs/ad_spdif.c \ @@ -86,8 +87,7 @@ SRCS_COMMON-$(FFMPEG) += SRCS_COMMON-$(CONFIG_VF_LAVFI) += libmpcodecs/vf_lavfi.c # These filters use private headers and do not work with shared FFmpeg. -SRCS_COMMON-$(FFMPEG_A) += libaf/af_lavcac3enc.c \ - libmpcodecs/vf_fspp.c \ +SRCS_COMMON-$(FFMPEG_A) += libmpcodecs/vf_fspp.c \ libmpcodecs/vf_mcdeint.c \ libmpcodecs/vf_qp.c \ libmpcodecs/vf_spp.c \ Modified: trunk/libaf/af.c ============================================================================== --- trunk/libaf/af.c Sun Feb 19 15:58:53 2012 (r34739) +++ trunk/libaf/af.c Sun Feb 19 16:21:23 2012 (r34740) @@ -72,10 +72,8 @@ static const af_info_t * const filter_li #endif &af_info_volnorm, &af_info_extrastereo, -#ifdef CONFIG_FFMPEG_A - &af_info_lavcac3enc, -#endif #ifdef CONFIG_FFMPEG + &af_info_lavcac3enc, &af_info_lavcresample, #endif &af_info_sweep, Modified: trunk/libaf/af_lavcac3enc.c ============================================================================== --- trunk/libaf/af_lavcac3enc.c Sun Feb 19 15:58:53 2012 (r34739) +++ trunk/libaf/af_lavcac3enc.c Sun Feb 19 16:21:23 2012 (r34740) @@ -33,9 +33,18 @@ #include "av_helpers.h" #include "libavcodec/avcodec.h" -#include "libavcodec/ac3.h" #include "libavutil/intreadwrite.h" +#define AC3_MAX_CHANNELS 6 +#define AC3_FRAME_SIZE 1536 +#define AC3_MAX_CODED_FRAME_SIZE 3840 +//#define AC3_BIT_RATES_COUNT 19 + +static const int ac3_bit_rates[] = { + 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, + 192000, 224000, 256000, 320000, 384000, 448000, 512000, 576000, 640000 +}; + // Data for specific instances of this filter typedef struct af_ac3enc_s { struct AVCodec *lavc_acodec; @@ -117,10 +126,10 @@ static int control(struct af_instance_s if (s->bit_rate < 1000) s->bit_rate *= 1000; if (s->bit_rate) { - for (i = 0; i < 19; ++i) - if (ff_ac3_bitrate_tab[i] * 1000 == s->bit_rate) + for (i = 0; i < FF_ARRAY_ELEMS(ac3_bit_rates); ++i) + if (ac3_bit_rates[i] == s->bit_rate) break; - if (i >= 19) { + if (i >= FF_ARRAY_ELEMS(ac3_bit_rates)) { mp_msg(MSGT_AFILTER, MSGL_WARN, "af_lavcac3enc unable set unsupported " "bitrate %d, use default bitrate (check manpage to see " "supported bitrates).\n", s->bit_rate); From subversion at mplayerhq.hu Sun Feb 19 16:21:28 2012 From: subversion at mplayerhq.hu (diego) Date: Sun, 19 Feb 2012 16:21:28 +0100 (CET) Subject: [MPlayer-cvslog] r34741 - in trunk: drivers/radeon_vid.c libmpdemux/demux_avs.c vidix/mach64_vid.c vidix/pci.c vidix/radeon_vid.c vidix/sysdep/AsmMacros_arm32.h vidix/sysdep/AsmMacros_powerpc.h vidix/sysdep/AsmMacr... Message-ID: <20120219152128.B7CDE140629@avserver.banki.hu> Author: diego Date: Sun Feb 19 16:21:28 2012 New Revision: 34741 Log: Make inline keyword handling consistent. Replace __inline__ and __inline by inline and move it after the static keyword. Modified: trunk/drivers/radeon_vid.c trunk/libmpdemux/demux_avs.c trunk/vidix/mach64_vid.c trunk/vidix/pci.c trunk/vidix/radeon_vid.c trunk/vidix/sysdep/AsmMacros_arm32.h trunk/vidix/sysdep/AsmMacros_powerpc.h trunk/vidix/sysdep/AsmMacros_sparc.h trunk/vidix/sysdep/AsmMacros_x86.h trunk/vidix/sysdep/pci_386bsd.c trunk/vidix/sysdep/pci_bsdi.c trunk/vidix/sysdep/pci_freebsd.c trunk/vidix/sysdep/pci_isc.c trunk/vidix/sysdep/pci_linux.c trunk/vidix/sysdep/pci_lynx.c trunk/vidix/sysdep/pci_mach386.c trunk/vidix/sysdep/pci_netbsd.c trunk/vidix/sysdep/pci_openbsd.c trunk/vidix/sysdep/pci_os2.c trunk/vidix/sysdep/pci_sco.c trunk/vidix/sysdep/pci_svr4.c trunk/vidix/sysdep/pci_win32.c Modified: trunk/drivers/radeon_vid.c ============================================================================== --- trunk/drivers/radeon_vid.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/drivers/radeon_vid.c Sun Feb 19 16:21:28 2012 (r34741) @@ -421,7 +421,7 @@ static int radeon_is_interlace( void ) return (INREG(CRTC_GEN_CNTL))&CRTC_INTERLACE_EN; } -static __inline__ void radeon_engine_flush ( void ) +static inline void radeon_engine_flush(void) { int i; @@ -436,7 +436,7 @@ static __inline__ void radeon_engine_flu } -static __inline__ void radeon_fifo_wait (int entries) +static inline void radeon_fifo_wait(int entries) { int i; @@ -446,7 +446,7 @@ static __inline__ void radeon_fifo_wait } -static __inline__ void radeon_engine_idle ( void ) +static inline void radeon_engine_idle(void) { int i; Modified: trunk/libmpdemux/demux_avs.c ============================================================================== --- trunk/libmpdemux/demux_avs.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/libmpdemux/demux_avs.c Sun Feb 19 16:21:28 2012 (r34741) @@ -146,7 +146,7 @@ avs_err: /* Implement RGB MODES ?? */ #if 0 -static __inline int get_mmioFOURCC(const AVS_VideoInfo *v) +static inline int get_mmioFOURCC(const AVS_VideoInfo *v) { if (avs_is_rgb(v)) return mmioFOURCC(8, 'R', 'G', 'B'); if (avs_is_rgb24(v)) return mmioFOURCC(24, 'R', 'G', 'B'); Modified: trunk/vidix/mach64_vid.c ============================================================================== --- trunk/vidix/mach64_vid.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/mach64_vid.c Sun Feb 19 16:21:28 2012 (r34741) @@ -160,13 +160,13 @@ static inline uint32_t INREG (uint32_t a OUTREG(addr, _tmp); \ } while (0) -static __inline__ int ATIGetMach64LCDReg(int _Index) +static inline int ATIGetMach64LCDReg(int _Index) { OUTREG8(LCD_INDEX, _Index); return INREG(LCD_DATA); } -static __inline__ uint32_t INPLL(uint32_t addr) +static inline uint32_t INPLL(uint32_t addr) { uint32_t res; uint32_t in; @@ -180,7 +180,7 @@ static __inline__ uint32_t INPLL(uint32_ return res; } -static __inline__ void OUTPLL(uint32_t addr,uint32_t val) +static inline void OUTPLL(uint32_t addr, uint32_t val) { //FIXME buggy but its not used /* write addr byte */ Modified: trunk/vidix/pci.c ============================================================================== --- trunk/vidix/pci.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/pci.c Sun Feb 19 16:21:28 2012 (r34741) @@ -104,7 +104,7 @@ static unsigned char *pciConfBase; -static __inline__ unsigned long +static inline unsigned long static swapl(unsigned long val) { unsigned char *p = (unsigned char *)&val; Modified: trunk/vidix/radeon_vid.c ============================================================================== --- trunk/vidix/radeon_vid.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/radeon_vid.c Sun Feb 19 16:21:28 2012 (r34741) @@ -547,7 +547,7 @@ static inline uint32_t INREG (uint32_t a OUTREG(addr, _tmp); \ } while (0) -static __inline__ uint32_t INPLL(uint32_t addr) +static inline uint32_t INPLL(uint32_t addr) { OUTREG8(CLOCK_CNTL_INDEX, addr & 0x0000001f); return INREG(CLOCK_CNTL_DATA); @@ -712,7 +712,7 @@ static void _radeon_fifo_wait(unsigned); #define radeon_engine_idle() _radeon_engine_idle() #define radeon_fifo_wait(entries) _radeon_fifo_wait(entries) /* Flush all dirty data in the Pixel Cache to memory. */ -static __inline__ void radeon_engine_flush ( void ) +static inline void radeon_engine_flush(void) { unsigned i; @@ -750,7 +750,7 @@ static void radeon_engine_reset( void ) } #else -static __inline__ void radeon_engine_flush ( void ) +static inline void radeon_engine_flush(void) { int i; @@ -1434,7 +1434,7 @@ static const fourcc_desc_t supported_fou { IMGFMT_BGR32, 775 } }; -__inline__ static int is_supported_fourcc(uint32_t fourcc) +static inline int is_supported_fourcc(uint32_t fourcc) { unsigned i; for(i=0;i= 0x400) return; *(volatile unsigned char*)(((unsigned short)(port))+IOPortBase) = val; } -static __inline__ void outw(short port,short val) +static inline void outw(short port, short val) { if ((unsigned short)port >= 0x400) return; *(volatile unsigned short*)(((unsigned short)(port))+IOPortBase) = val; } -static __inline__ void outl(short port,int val) +static inline void outl(short port, int val) { if ((unsigned short)port >= 0x400) return; *(volatile unsigned long*)(((unsigned short)(port))+IOPortBase) = val; } -static __inline__ unsigned int inb(short port) +static inline unsigned int inb(short port) { if ((unsigned short)port >= 0x400) return (unsigned int)-1; return *(volatile unsigned char*)(((unsigned short)(port))+IOPortBase); } -static __inline__ unsigned int inw(short port) +static inline unsigned int inw(short port) { if ((unsigned short)port >= 0x400) return (unsigned int)-1; return *(volatile unsigned short*)(((unsigned short)(port))+IOPortBase); } -static __inline__ unsigned int inl(short port) +static inline unsigned int inl(short port) { if ((unsigned short)port >= 0x400) return (unsigned int)-1; return *(volatile unsigned long*)(((unsigned short)(port))+IOPortBase); Modified: trunk/vidix/sysdep/AsmMacros_powerpc.h ============================================================================== --- trunk/vidix/sysdep/AsmMacros_powerpc.h Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/AsmMacros_powerpc.h Sun Feb 19 16:21:28 2012 (r34741) @@ -66,41 +66,41 @@ extern unsigned char *ioBase; -static __inline__ volatile void eieio(void) +static inline volatile void eieio(void) { __asm__ volatile ("eieio"); } -static __inline__ void outb(short port, unsigned char value) +static inline void outb(short port, unsigned char value) { *(unsigned char *)(ioBase + port) = value; eieio(); } -static __inline__ void outw(short port, unsigned short value) +static inline void outw(short port, unsigned short value) { *(unsigned short *)(ioBase + port) = value; eieio(); } -static __inline__ void outl(short port, unsigned short value) +static inline void outl(short port, unsigned short value) { *(unsigned long *)(ioBase + port) = value; eieio(); } -static __inline__ unsigned char inb(short port) +static inline unsigned char inb(short port) { unsigned char val; val = *((unsigned char *)(ioBase + port)); eieio(); return val; } -static __inline__ unsigned short inw(short port) +static inline unsigned short inw(short port) { unsigned short val; val = *((unsigned short *)(ioBase + port)); eieio(); return val; } -static __inline__ unsigned long inl(short port) +static inline unsigned long inl(short port) { unsigned long val; val = *((unsigned long *)(ioBase + port)); eieio(); Modified: trunk/vidix/sysdep/AsmMacros_sparc.h ============================================================================== --- trunk/vidix/sysdep/AsmMacros_sparc.h Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/AsmMacros_sparc.h Sun Feb 19 16:21:28 2012 (r34741) @@ -66,36 +66,36 @@ #define ASI_PL 0x88 #endif -static __inline__ void outb(unsigned long port, char val) +static inline void outb(unsigned long port, char val) { __asm__ volatile("stba %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL)); } -static __inline__ void outw(unsigned long port, char val) +static inline void outw(unsigned long port, char val) { __asm__ volatile("stha %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL)); } -static __inline__ void outl(unsigned long port, char val) +static inline void outl(unsigned long port, char val) { __asm__ volatile("sta %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL)); } -static __inline__ unsigned int inb(unsigned long port) +static inline unsigned int inb(unsigned long port) { unsigned char ret; __asm__ volatile("lduba [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); return ret; } -static __inline__ unsigned int inw(unsigned long port) +static inline unsigned int inw(unsigned long port) { unsigned char ret; __asm__ volatile("lduha [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); return ret; } -static __inline__ unsigned int inl(unsigned long port) +static inline unsigned int inl(unsigned long port) { unsigned char ret; __asm__ volatile("lda [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); Modified: trunk/vidix/sysdep/AsmMacros_x86.h ============================================================================== --- trunk/vidix/sysdep/AsmMacros_x86.h Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/AsmMacros_x86.h Sun Feb 19 16:21:28 2012 (r34741) @@ -89,7 +89,7 @@ extern int dhahelper_initialized; extern int svgahelper_fd; extern int svgahelper_initialized; -static __inline__ void svga_outb(short port, char value) +static inline void svga_outb(short port, char value) { io_t iov; @@ -98,7 +98,7 @@ static __inline__ void svga_outb(short p ioctl(svgahelper_fd, SVGALIB_HELPER_IOCSOUTB, &iov); } -static __inline__ void svga_outw(short port, char value) +static inline void svga_outw(short port, char value) { io_t iov; @@ -107,7 +107,7 @@ static __inline__ void svga_outw(short p ioctl(svgahelper_fd, SVGALIB_HELPER_IOCSOUTW, &iov); } -static __inline__ void svga_outl(short port, unsigned int value) +static inline void svga_outl(short port, unsigned int value) { io_t iov; @@ -116,7 +116,7 @@ static __inline__ void svga_outl(short p ioctl(svgahelper_fd, SVGALIB_HELPER_IOCSOUTL, &iov); } -static __inline__ unsigned int svga_inb(short port) +static inline unsigned int svga_inb(short port) { io_t iov; @@ -126,7 +126,7 @@ static __inline__ unsigned int svga_inb( return iov.val; } -static __inline__ unsigned int svga_inw(short port) +static inline unsigned int svga_inw(short port) { io_t iov; @@ -136,7 +136,7 @@ static __inline__ unsigned int svga_inw( return iov.val; } -static __inline__ unsigned int svga_inl(short port) +static inline unsigned int svga_inl(short port) { io_t iov; @@ -147,7 +147,7 @@ static __inline__ unsigned int svga_inl( } #endif /* CONIFG_SVGAHELPER */ -static __inline__ void outb(short port,char val) +static inline void outb(short port, char val) { #ifdef CONFIG_SVGAHELPER if (svgahelper_initialized == 1) @@ -175,7 +175,7 @@ static __inline__ void outb(short port,c return; } -static __inline__ void outw(short port,short val) +static inline void outw(short port, short val) { #ifdef CONFIG_SVGAHELPER if (svgahelper_initialized == 1) @@ -203,7 +203,7 @@ static __inline__ void outw(short port,s return; } -static __inline__ void outl(short port,unsigned int val) +static inline void outl(short port, unsigned int val) { #ifdef CONFIG_SVGAHELPER if (svgahelper_initialized == 1) @@ -231,7 +231,7 @@ static __inline__ void outl(short port,u return; } -static __inline__ unsigned int inb(short port) +static inline unsigned int inb(short port) { unsigned char ret = 0; @@ -261,7 +261,7 @@ static __inline__ unsigned int inb(short return ret; } -static __inline__ unsigned int inw(short port) +static inline unsigned int inw(short port) { unsigned short ret = 0; @@ -291,7 +291,7 @@ static __inline__ unsigned int inw(short return ret; } -static __inline__ unsigned int inl(short port) +static inline unsigned int inl(short port) { unsigned int ret = 0; @@ -321,7 +321,7 @@ static __inline__ unsigned int inl(short return ret; } -static __inline__ void intr_disable(void) +static inline void intr_disable(void) { #ifdef CONFIG_SVGAHELPER if (svgahelper_initialized == 1) @@ -330,7 +330,7 @@ static __inline__ void intr_disable(void __asm__ volatile("cli"); } -static __inline__ void intr_enable(void) +static inline void intr_enable(void) { #ifdef CONFIG_SVGAHELPER if (svgahelper_initialized == 1) Modified: trunk/vidix/sysdep/pci_386bsd.c ============================================================================== --- trunk/vidix/sysdep/pci_386bsd.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_386bsd.c Sun Feb 19 16:21:28 2012 (r34741) @@ -35,7 +35,7 @@ static int io_fd; -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { io_fd = -1 ; if ((io_fd = open("/dev/console", O_RDWR, 0)) < 0) { @@ -49,7 +49,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { if (ioctl(io_fd, KDDISABIO, 0) < 0) { perror("ioctl(KDDISABIO)"); Modified: trunk/vidix/sysdep/pci_bsdi.c ============================================================================== --- trunk/vidix/sysdep/pci_bsdi.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_bsdi.c Sun Feb 19 16:21:28 2012 (r34741) @@ -13,7 +13,7 @@ static int io_fd; -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { io_fd = -1 ; if ((io_fd = open("/dev/console", O_RDWR, 0)) < 0) { @@ -27,7 +27,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { if (ioctl(io_fd, PCCONDISABIOPL, 0) < 0) { perror("ioctl(PCCONDISABIOPL)"); Modified: trunk/vidix/sysdep/pci_freebsd.c ============================================================================== --- trunk/vidix/sysdep/pci_freebsd.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_freebsd.c Sun Feb 19 16:21:28 2012 (r34741) @@ -35,7 +35,7 @@ static int io_fd; -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { io_fd = -1 ; if ((io_fd = open("/dev/console", O_RDWR, 0)) < 0) { @@ -49,7 +49,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { if (ioctl(io_fd, KDDISABIO, 0) < 0) { perror("ioctl(KDDISABIO)"); Modified: trunk/vidix/sysdep/pci_isc.c ============================================================================== --- trunk/vidix/sysdep/pci_isc.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_isc.c Sun Feb 19 16:21:28 2012 (r34741) @@ -34,7 +34,7 @@ #include #include -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 3); @@ -44,7 +44,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 0); Modified: trunk/vidix/sysdep/pci_linux.c ============================================================================== --- trunk/vidix/sysdep/pci_linux.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_linux.c Sun Feb 19 16:21:28 2012 (r34741) @@ -88,7 +88,7 @@ static int pci_get_vendor( } #endif /* CONFIG_SVGAHELPER */ -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { #ifdef CONFIG_SVGAHELPER svgahelper_fd = open(DEV_SVGA, O_RDWR); @@ -119,7 +119,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { #ifdef CONFIG_SVGAHELPER if (svgahelper_initialized == 1) Modified: trunk/vidix/sysdep/pci_lynx.c ============================================================================== --- trunk/vidix/sysdep/pci_lynx.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_lynx.c Sun Feb 19 16:21:28 2012 (r34741) @@ -38,7 +38,7 @@ static unsigned char *pciConfBase; -static __inline__ void enable_os_io(void) +static inline void enable_os_io(void) { pciConfBase = (unsigned char *) smem_create("PCI-CONF", (char *)0x80800000, 64*1024, SM_READ|SM_WRITE); @@ -46,7 +46,7 @@ static __inline__ void enable_os_io(void exit(1); } -static __inline__ void disable_os_io(void) +static inline void disable_os_io(void) { smem_create(NULL, (char *) pciConfBase, 0, SM_DETACH); smem_remove("PCI-CONF"); @@ -57,7 +57,7 @@ static __inline__ void disable_os_io(voi static unsigned char *pciConfBase; -static __inline__ unsigned long +static inline unsigned long static swapl(unsigned long val) { unsigned char *p = (unsigned char *)&val; Modified: trunk/vidix/sysdep/pci_mach386.c ============================================================================== --- trunk/vidix/sysdep/pci_mach386.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_mach386.c Sun Feb 19 16:21:28 2012 (r34741) @@ -30,7 +30,7 @@ static int io_fd; -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { io_fd = -1 ; if ((io_fd = open("/dev/iopl", O_RDWR, 0)) < 0) { @@ -40,7 +40,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { close(io_fd); return 0; Modified: trunk/vidix/sysdep/pci_netbsd.c ============================================================================== --- trunk/vidix/sysdep/pci_netbsd.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_netbsd.c Sun Feb 19 16:21:28 2012 (r34741) @@ -36,7 +36,7 @@ static int io_fd; -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { io_fd = -1 ; #if !defined(USE_I386_IOPL) @@ -53,7 +53,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { #if !defined(USE_I386_IOPL) close(io_fd); Modified: trunk/vidix/sysdep/pci_openbsd.c ============================================================================== --- trunk/vidix/sysdep/pci_openbsd.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_openbsd.c Sun Feb 19 16:21:28 2012 (r34741) @@ -32,7 +32,7 @@ #include #include -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { if (i386_iopl(1) < 0) { perror("i386_iopl"); @@ -41,7 +41,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { /* Nothing to do */ return 0; Modified: trunk/vidix/sysdep/pci_os2.c ============================================================================== --- trunk/vidix/sysdep/pci_os2.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_os2.c Sun Feb 19 16:21:28 2012 (r34741) @@ -31,7 +31,7 @@ static USHORT callgate[3] = {0,0,0}; -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { HFILE hfd; ULONG dlen,action; @@ -71,7 +71,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { /* Nothing to do */ return 0; Modified: trunk/vidix/sysdep/pci_sco.c ============================================================================== --- trunk/vidix/sysdep/pci_sco.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_sco.c Sun Feb 19 16:21:28 2012 (r34741) @@ -35,7 +35,7 @@ #include #include -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 3); @@ -45,7 +45,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 0); Modified: trunk/vidix/sysdep/pci_svr4.c ============================================================================== --- trunk/vidix/sysdep/pci_svr4.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_svr4.c Sun Feb 19 16:21:28 2012 (r34741) @@ -44,7 +44,7 @@ # include #endif -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 3); @@ -54,7 +54,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { #if defined(SI86IOPL) sysi86(SI86IOPL, 0); Modified: trunk/vidix/sysdep/pci_win32.c ============================================================================== --- trunk/vidix/sysdep/pci_win32.c Sun Feb 19 16:21:23 2012 (r34740) +++ trunk/vidix/sysdep/pci_win32.c Sun Feb 19 16:21:28 2012 (r34741) @@ -33,7 +33,7 @@ static HANDLE hDriver; -static __inline__ int enable_os_io(void) +static inline int enable_os_io(void) { if(IsWinNT()){ DWORD dwBytesReturned; @@ -46,7 +46,7 @@ static __inline__ int enable_os_io(void) return 0; } -static __inline__ int disable_os_io(void) +static inline int disable_os_io(void) { if(IsWinNT()){ DWORD dwBytesReturned; From subversion at mplayerhq.hu Sun Feb 19 16:21:31 2012 From: subversion at mplayerhq.hu (diego) Date: Sun, 19 Feb 2012 16:21:31 +0100 (CET) Subject: [MPlayer-cvslog] r34742 - trunk/configure Message-ID: <20120219152131.D3625140629@avserver.banki.hu> Author: diego Date: Sun Feb 19 16:21:31 2012 New Revision: 34742 Log: configure: Derive system name from 3rd and 2nd component passed to --target. This fixes common system name triplets used with MinGW. based on a patch from Diogo Franco, diogomfranco gmail com Modified: trunk/configure Modified: trunk/configure ============================================================================== --- trunk/configure Sun Feb 19 16:21:28 2012 (r34741) +++ trunk/configure Sun Feb 19 16:21:31 2012 (r34742) @@ -1514,22 +1514,24 @@ if test -z "$_target" ; then *) host_arch=UNKNOWN ;; 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 ;; - wine) system_name=Wine ;; - esac + for component in 3 2; do + system_name=$(echo $_target | cut -d '-' -f $component) + 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 ;; + wine) system_name=Wine ;; + esac + 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 From subversion at mplayerhq.hu Sun Feb 19 16:58:25 2012 From: subversion at mplayerhq.hu (diego) Date: Sun, 19 Feb 2012 16:58:25 +0100 (CET) Subject: [MPlayer-cvslog] r34743 - trunk/Makefile Message-ID: <20120219155825.9E01D14065C@avserver.banki.hu> Author: diego Date: Sun Feb 19 16:58:25 2012 New Revision: 34743 Log: build: Remove generated documentation on 'make clean'. Modified: trunk/Makefile Modified: trunk/Makefile ============================================================================== --- trunk/Makefile Sun Feb 19 16:21:31 2012 (r34742) +++ trunk/Makefile Sun Feb 19 16:58:25 2012 (r34743) @@ -970,10 +970,10 @@ clean: -rm -rf tests/res -rm -f $(call ADD_ALL_DIRS,/*.o /*.a /*.ho /*~) -rm -f $(call ADD_ALL_EXESUFS,mplayer mencoder) + -rm -rf DOCS/tech/doxygen DOCS/HTML distclean: clean testsclean toolsclean driversclean dhahelperclean -$(MAKE) -C ffmpeg $@ - -rm -rf DOCS/tech/doxygen DOCS/HTML -rm -f DOCS/xml/html-chunk.xsl DOCS/xml/html-single.xsl -rm -f $(call ADD_ALL_DIRS,/*.d) -rm -f config.* codecs.conf.h help_mp.h version.h TAGS tags From subversion at mplayerhq.hu Sun Feb 19 17:07:35 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 19 Feb 2012 17:07:35 +0100 (CET) Subject: [MPlayer-cvslog] r34744 - trunk/libmpdemux/demux_ogg.c Message-ID: <20120219160735.44262140659@avserver.banki.hu> Author: reimar Date: Sun Feb 19 17:07:35 2012 New Revision: 34744 Log: Fix -aid/-vid selection with -demuxer ogg. The demuxer code conflicted with the generic code in new_sh_*, so remove everything except the -1 (default) handling. Modified: trunk/libmpdemux/demux_ogg.c Modified: trunk/libmpdemux/demux_ogg.c ============================================================================== --- trunk/libmpdemux/demux_ogg.c Sun Feb 19 16:58:25 2012 (r34743) +++ trunk/libmpdemux/demux_ogg.c Sun Feb 19 17:07:35 2012 (r34744) @@ -513,6 +513,7 @@ static int demux_ogg_add_packet(demux_st // We jump nothing for FLAC. Ain't this great? Packet contents have to be // handled differently for each and every stream type. The joy! The joy! if (!os->flac && (*pack->packet & PACKET_TYPE_HEADER) && + ds->sh && (ds != d->audio || ((sh_audio_t*)ds->sh)->format != FOURCC_VORBIS || os->hdr_packets >= NUM_VORBIS_HDR_PACKETS ) && (ds != d->video || (((sh_video_t*)ds->sh)->format != FOURCC_THEORA))) return 0; @@ -780,7 +781,6 @@ int demux_ogg_open(demuxer_t *demuxer) stream_t *s; char *buf; int np, s_no, n_audio = 0, n_video = 0; - int audio_id = -1, video_id = -1, text_id = -1; ogg_sync_state *sync; ogg_page *page; ogg_packet pack; @@ -1101,8 +1101,6 @@ int demux_ogg_open(demuxer_t *demuxer) ogg_d->subs[ogg_d->num_sub].samplerate = AV_RL64(&st->time_unit) / 10; ogg_d->subs[ogg_d->num_sub].text = 1; ogg_d->subs[ogg_d->num_sub].id = ogg_d->n_text; - if (demuxer->sub->id == ogg_d->n_text) - text_id = ogg_d->num_sub; new_sh_sub(demuxer, ogg_d->n_text, NULL); ogg_d->n_text++; ogg_d->text_ids = realloc_struct(ogg_d->text_ids, ogg_d->n_text, sizeof(*ogg_d->text_ids)); @@ -1125,28 +1123,24 @@ int demux_ogg_open(demuxer_t *demuxer) if (sh_a) { // If the audio stream is not defined we took the first one if (demuxer->audio->id == -1) { - demuxer->audio->id = n_audio - 1; + demuxer->audio->id = ogg_d->num_sub; + demuxer->audio->sh = sh_a; //if (sh_a->wf) print_wave_header(sh_a->wf, MSGL_INFO); } /// Is it the stream we want - if (demuxer->audio->id == n_audio - 1) { - demuxer->audio->sh = sh_a; - sh_a->ds = demuxer->audio; + if (demuxer->audio->sh == sh_a) { ds = demuxer->audio; - audio_id = ogg_d->num_sub; } } if (sh_v) { /// Also for video if (demuxer->video->id == -1) { - demuxer->video->id = n_video - 1; + demuxer->video->id = ogg_d->num_sub; + demuxer->video->sh = sh_v; //if (sh_v->bih) print_video_header(sh_v->bih, MSGL_INFO); } - if (demuxer->video->id == n_video - 1) { - demuxer->video->sh = sh_v; - sh_v->ds = demuxer->video; + if (demuxer->video->sh == sh_v) { ds = demuxer->video; - video_id = ogg_d->num_sub; } } /// Add the header packets if the stream isn't seekable @@ -1165,24 +1159,12 @@ int demux_ogg_open(demuxer_t *demuxer) goto err_out; } - if (!n_video || video_id < 0) + if (!demuxer->video->sh) demuxer->video->id = -2; - else - demuxer->video->id = video_id; - if (!n_audio || audio_id < 0) + if (!demuxer->audio->sh) demuxer->audio->id = -2; - else - demuxer->audio->id = audio_id; - /* Disable the subs only if there are no text streams at all. - Otherwise the stream to display might be chosen later when the comment - packet is encountered and the user used -slang instead of -sid. */ - if (!ogg_d->n_text) + if (!demuxer->sub->sh) demuxer->sub->id = -2; - else if (text_id >= 0) { - demuxer->sub->id = text_id; - mp_msg(MSGT_DEMUX, MSGL_V, - "Ogg demuxer: Displaying subtitle stream id %d\n", text_id); - } ogg_d->final_granulepos = 0; ogg_d->initial_granulepos = MP_NOPTS_VALUE; From subversion at mplayerhq.hu Sun Feb 19 21:01:18 2012 From: subversion at mplayerhq.hu (cehoyos) Date: Sun, 19 Feb 2012 21:01:18 +0100 (CET) Subject: [MPlayer-cvslog] r34745 - trunk/libmpdemux/demux_lavf.c Message-ID: <20120219200118.0750A140844@avserver.banki.hu> Author: cehoyos Date: Sun Feb 19 21:01:17 2012 New Revision: 34745 Log: Use -demuxer lavf for cdxl files. Modified: trunk/libmpdemux/demux_lavf.c Modified: trunk/libmpdemux/demux_lavf.c ============================================================================== --- trunk/libmpdemux/demux_lavf.c Sun Feb 19 17:07:35 2012 (r34744) +++ trunk/libmpdemux/demux_lavf.c Sun Feb 19 21:01:17 2012 (r34745) @@ -208,6 +208,7 @@ static int lavf_check_file(demuxer_t *de } static const char * const preferred_list[] = { + "cdxl", "dxa", "flv", "gxf", From subversion at mplayerhq.hu Sun Feb 19 21:33:32 2012 From: subversion at mplayerhq.hu (reimar) Date: Sun, 19 Feb 2012 21:33:32 +0100 (CET) Subject: [MPlayer-cvslog] r34746 - trunk/libmpdemux/demux_lavf.c Message-ID: <20120219203332.F2F1814088C@avserver.banki.hu> Author: reimar Date: Sun Feb 19 21:33:32 2012 New Revision: 34746 Log: demux_lavf: Explain under which conditions to add demuxers to preferred_list. Modified: trunk/libmpdemux/demux_lavf.c Modified: trunk/libmpdemux/demux_lavf.c ============================================================================== --- trunk/libmpdemux/demux_lavf.c Sun Feb 19 21:01:17 2012 (r34745) +++ trunk/libmpdemux/demux_lavf.c Sun Feb 19 21:33:32 2012 (r34746) @@ -207,6 +207,14 @@ static int lavf_check_file(demuxer_t *de return DEMUXER_TYPE_LAVF; } +/* Before adding anything to this list please stop and consider why. + * There are two good reasons + * 1) to reduce startup time when streaming these file types + * 2) workarounds around bugs in our native demuxers that are not reasonable to + * fix + * For the case 2) that means the issue should be understood well + * enough to be able to decide that a fix is not reasonable. + */ static const char * const preferred_list[] = { "cdxl", "dxa", From subversion at mplayerhq.hu Sun Feb 19 23:09:30 2012 From: subversion at mplayerhq.hu (al) Date: Sun, 19 Feb 2012 23:09:30 +0100 (CET) Subject: [MPlayer-cvslog] r34747 - trunk/libmpcodecs/vf_screenshot.c Message-ID: <20120219220930.744AC140938@avserver.banki.hu> Author: al Date: Sun Feb 19 23:09:30 2012 New Revision: 34747 Log: vf screenshot: Fix breakage after lavc API changes The avcodec_open2() function wants a valid avctx->pix_fmt to be set in the AVCodecContext prior to its invocation. Thanks to Ivan for working this out for vo png already. Modified: trunk/libmpcodecs/vf_screenshot.c Modified: trunk/libmpcodecs/vf_screenshot.c ============================================================================== --- trunk/libmpcodecs/vf_screenshot.c Sun Feb 19 21:33:32 2012 (r34746) +++ trunk/libmpcodecs/vf_screenshot.c Sun Feb 19 23:09:30 2012 (r34747) @@ -69,7 +69,6 @@ static int config(struct vf_instance *vf vf->priv->outbuffer = realloc(vf->priv->outbuffer, vf->priv->outbuffer_size); vf->priv->avctx->width = d_width; vf->priv->avctx->height = d_height; - vf->priv->avctx->pix_fmt = PIX_FMT_RGB24; vf->priv->avctx->compression_level = 0; vf->priv->dw = d_width; vf->priv->dh = d_height; @@ -301,6 +300,7 @@ static int vf_open(vf_instance_t *vf, ch vf->priv->outbuffer=0; vf->priv->ctx=0; vf->priv->avctx = avcodec_alloc_context3(NULL); + vf->priv->avctx->pix_fmt = PIX_FMT_RGB24; avcodec_register_all(); if (avcodec_open2(vf->priv->avctx, avcodec_find_encoder(CODEC_ID_PNG), NULL)) { mp_msg(MSGT_VFILTER, MSGL_FATAL, "Could not open libavcodec PNG encoder\n"); From subversion at mplayerhq.hu Mon Feb 20 16:29:37 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 20 Feb 2012 16:29:37 +0100 (CET) Subject: [MPlayer-cvslog] r34748 - trunk/configure Message-ID: <20120220152937.C73DD141021@avserver.banki.hu> Author: ib Date: Mon Feb 20 16:29:37 2012 New Revision: 34748 Log: configure: Simplify the definitions of xsltcommand and XMLLINT_COMMAND. There is no need for positional parameters. Modified: trunk/configure Modified: trunk/configure ============================================================================== --- trunk/configure Sun Feb 19 23:09:30 2012 (r34747) +++ trunk/configure Mon Feb 20 16:29:37 2012 (r34748) @@ -7891,7 +7891,7 @@ echocheck "valid XSLT processor" if xsltproc --version > /dev/null 2>&1; then if test -z "$fake_chunk_xsl"; then echores "xsltproc" - xsltcommand="xsltproc $catalog_opts -o \$\$1 \$\$2 \$\$3" + xsltcommand="xsltproc $catalog_opts -o" else echores "Found xsltproc but no stylesheets on your system." echores "xsltproc is unusable without stylesheets." @@ -7930,7 +7930,7 @@ MAN_LANGS = $language_man MAN_LANG_ALL = $man_lang_all CATALOG = $catalog -XMLLINT_COMMAND = xmllint --noout --noent --postvalid $catalog_opts \$* +XMLLINT_COMMAND = xmllint --noout --noent --postvalid $catalog_opts XSLT_COMMAND = $xsltcommand prefix = \$(DESTDIR)$_prefix From subversion at mplayerhq.hu Tue Feb 21 19:55:14 2012 From: subversion at mplayerhq.hu (ib) Date: Tue, 21 Feb 2012 19:55:14 +0100 (CET) Subject: [MPlayer-cvslog] r34751 - in trunk/gui: cfg.c interface.c ui/actions.c ui/gtk/playlist.c ui/gtk/url.c ui/main.c util/list.c util/list.h Message-ID: <20120221185514.C3994141BA2@avserver.banki.hu> Author: ib Date: Tue Feb 21 19:55:14 2012 New Revision: 34751 Log: Replace symbolic constants by enums. There is no relation to gtk whatsoever, use self-explanatory names instead and add a doxygen comment. For optical reasons, change parameter data from NULL to 0 where it isn't used to pass anything. Modified: trunk/gui/cfg.c trunk/gui/interface.c trunk/gui/ui/actions.c trunk/gui/ui/gtk/playlist.c trunk/gui/ui/gtk/url.c trunk/gui/ui/main.c trunk/gui/util/list.c trunk/gui/util/list.h Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Mon Feb 20 18:41:47 2012 (r34750) +++ trunk/gui/cfg.c Tue Feb 21 19:55:14 2012 (r34751) @@ -291,7 +291,7 @@ void cfg_read(void) if (fgetstr(line, sizeof(line), file) && *line) { item->name = strdup(line); - listMgr(gtkAddPlItem, item); + listMgr(PLAYLIST_ITEM_ADD, item); } else { free(item->path); free(item); @@ -323,7 +323,7 @@ void cfg_read(void) } item->url = strdup(line); - listMgr(gtkAddURLItem, item); + listMgr(URLLIST_ITEM_ADD, item); } fclose(file); Modified: trunk/gui/interface.c ============================================================================== --- trunk/gui/interface.c Mon Feb 20 18:41:47 2012 (r34750) +++ trunk/gui/interface.c Tue Feb 21 19:55:14 2012 (r34751) @@ -268,8 +268,8 @@ void guiDone(void) } appFreeStruct(); - listMgr(gtkDelPl, NULL); - listMgr(gtkDelURL, NULL); + listMgr(PLAYLIST_DELETE, 0); + listMgr(URLLIST_DELETE, 0); free(guiIcon.collection); if (gui_conf) { @@ -769,7 +769,7 @@ int gui(int what, void *data) break; } - if (guiInfo.Playing && (next = listMgr(gtkGetNextPlItem, NULL)) && (plLastPlayed != next)) { + if (guiInfo.Playing && (next = listMgr(PLAYLIST_ITEM_GET_NEXT, 0)) && (plLastPlayed != next)) { plLastPlayed = next; uiSetFileName(next->path, next->name, STREAMTYPE_FILE); guiInfo.NewPlay = GUI_FILE_NEW; @@ -850,9 +850,9 @@ static int import_file_into_gui(char *te item->path = pathname; if (insert) - listMgr(gtkInsertPlItem, item); // inserts the item after current, and makes current=item + listMgr(PLAYLIST_ITEM_INSERT, item); // inserts the item after current, and makes current=item else - listMgr(gtkAddPlItem, item); + listMgr(PLAYLIST_ITEM_ADD, item); return 1; } @@ -867,7 +867,7 @@ int guiPlaylistInitialize(play_tree_t *m int result = 0; if (!enqueue) - listMgr(gtkDelPl, NULL); // delete playlist before "appending" + listMgr(PLAYLIST_DELETE, 0); // delete playlist before "appending" if ((my_pt_iter = pt_iter_create(&my_playtree, config))) { while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL) @@ -896,7 +896,7 @@ int guiPlaylistAdd(play_tree_t *my_playt int result = 0; plItem *save; - save = (plItem *)listMgr(gtkGetCurrPlItem, NULL); // save current item + save = (plItem *)listMgr(PLAYLIST_ITEM_GET_CURR, 0); // save current item if ((my_pt_iter = pt_iter_create(&my_playtree, config))) { while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL) @@ -908,12 +908,12 @@ int guiPlaylistAdd(play_tree_t *my_playt } if (save) - listMgr(gtkSetCurrPlItem, save); + listMgr(PLAYLIST_ITEM_SET_CURR, save); else - listMgr(gtkSetCurrPlItem, plList); // go to head, if plList was empty before + listMgr(PLAYLIST_ITEM_SET_CURR, plList); // go to head, if plList was empty before if (save && result) - listMgr(gtkDelCurrPlItem, NULL); + listMgr(PLAYLIST_ITEM_DEL_CURR, 0); uiCurr(); // update filename Modified: trunk/gui/ui/actions.c ============================================================================== --- trunk/gui/ui/actions.c Mon Feb 20 18:41:47 2012 (r34750) +++ trunk/gui/ui/actions.c Tue Feb 21 19:55:14 2012 (r34751) @@ -254,7 +254,7 @@ void uiCurr(void) default: - curr = listMgr(gtkGetCurrPlItem, NULL); + curr = listMgr(PLAYLIST_ITEM_GET_CURR, 0); if (curr) { uiSetFileName(curr->path, curr->name, STREAMTYPE_FILE); @@ -310,7 +310,7 @@ void uiPrev(void) default: - prev = listMgr(gtkGetPrevPlItem, NULL); + prev = listMgr(PLAYLIST_ITEM_GET_PREV, 0); if (prev) { uiSetFileName(prev->path, prev->name, STREAMTYPE_FILE); @@ -371,7 +371,7 @@ void uiNext(void) default: - next = listMgr(gtkGetNextPlItem, NULL); + next = listMgr(PLAYLIST_ITEM_GET_NEXT, 0); if (next) { uiSetFileName(next->path, next->name, STREAMTYPE_FILE); Modified: trunk/gui/ui/gtk/playlist.c ============================================================================== --- trunk/gui/ui/gtk/playlist.c Mon Feb 20 18:41:47 2012 (r34750) +++ trunk/gui/ui/gtk/playlist.c Tue Feb 21 19:55:14 2012 (r34751) @@ -191,7 +191,7 @@ static void plButtonReleased( GtkButton case 1: // ok { int i; - if ( plList ) listMgr( gtkDelPl,NULL ); + if ( plList ) listMgr( PLAYLIST_DELETE,0 ); for ( i=0;iname ) item->name = strdup( text[0] ); item->path=g_filename_from_utf8( text[1], -1, NULL, NULL, NULL ); if ( !item->path ) item->path = strdup( text[1] ); - listMgr( gtkAddPlItem,item ); + listMgr( PLAYLIST_ITEM_ADD,item ); } if ( plCurrent ) { Modified: trunk/gui/ui/gtk/url.c ============================================================================== --- trunk/gui/ui/gtk/url.c Mon Feb 20 18:41:47 2012 (r34750) +++ trunk/gui/ui/gtk/url.c Tue Feb 21 19:55:14 2012 (r34751) @@ -101,7 +101,7 @@ static void on_Button_pressed( GtkButton item=calloc( 1,sizeof( urlItem ) ); item->url=gstrdup( str ); - listMgr( gtkAddURLItem,item ); + listMgr( URLLIST_ITEM_ADD,item ); uiSetFileName( NULL,str,STREAMTYPE_STREAM ); guiInfo.NewPlay=GUI_FILE_NEW; uiEventHandling( evPlay,0 ); Modified: trunk/gui/ui/main.c ============================================================================== --- trunk/gui/ui/main.c Mon Feb 20 18:41:47 2012 (r34750) +++ trunk/gui/ui/main.c Tue Feb 21 19:55:14 2012 (r34751) @@ -111,7 +111,7 @@ static void guiInfoMediumClear (int what nfree(guiInfo.Filename); nfree(guiInfo.SubtitleFilename); nfree(guiInfo.AudioFilename); - listMgr(gtkDelPl, NULL); + listMgr(PLAYLIST_DELETE, 0); } if (what & CLEAR_VCD) guiInfo.Tracks = 0; @@ -208,9 +208,9 @@ play: if ( ( msg == evPlaySwitchToPause )&&( guiInfo.Playing == GUI_PAUSE ) ) goto NoPause; - if ( listMgr( gtkGetCurrPlItem,NULL ) &&( guiInfo.StreamType == STREAMTYPE_FILE ) ) + if ( listMgr( PLAYLIST_ITEM_GET_CURR,0 ) &&( guiInfo.StreamType == STREAMTYPE_FILE ) ) { - plItem * next = listMgr( gtkGetCurrPlItem,NULL ); + plItem * next = listMgr( PLAYLIST_ITEM_GET_CURR,0 ); plLastPlayed=next; uiSetFileName( next->path,next->name,SAME_STREAMTYPE ); } @@ -271,7 +271,7 @@ NoPause: uiMainAutoPlay=1; // guiInfo.StreamType=STREAMTYPE_FILE; case evLoad: - listMgr( gtkDelPl,NULL ); + listMgr( PLAYLIST_DELETE,0 ); gtkShow( evLoad,NULL ); break; case evLoadSubtitle: gtkShow( evLoadSubtitle,NULL ); break; @@ -643,7 +643,7 @@ void uiDandDHandler(int num,char** files /* clear playlist */ if (filename == NULL) { filename = files[f]; - listMgr(gtkDelPl,NULL); + listMgr(PLAYLIST_DELETE,0); } item = calloc(1,sizeof(plItem)); @@ -658,7 +658,7 @@ void uiDandDHandler(int num,char** files item->name = strdup(str); item->path = strdup(""); } - listMgr(gtkAddPlItem,item); + listMgr(PLAYLIST_ITEM_ADD,item); } else { mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_NotAFile,str ); } Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Mon Feb 20 18:41:47 2012 (r34750) +++ trunk/gui/util/list.c Tue Feb 21 19:55:14 2012 (r34751) @@ -38,7 +38,7 @@ void *listMgr(int cmd, void *data) // handle playlist // add item to playlist - case gtkAddPlItem: + case PLAYLIST_ITEM_ADD: if (plList) { plItem *next = plList; @@ -58,7 +58,7 @@ void *listMgr(int cmd, void *data) return NULL; // add item into playlist after current - case gtkInsertPlItem: + case PLAYLIST_ITEM_INSERT: if (plCurrent) { plItem *curr = plCurrent; item->next = curr->next; @@ -72,10 +72,10 @@ void *listMgr(int cmd, void *data) return plCurrent; } else - return listMgr(gtkAddPlItem, item); + return listMgr(PLAYLIST_ITEM_ADD, item); // get next item from playlist - case gtkGetNextPlItem: + case PLAYLIST_ITEM_GET_NEXT: if (plCurrent && plCurrent->next) { plCurrent = plCurrent->next; // if (!plCurrent && plList) @@ -95,7 +95,7 @@ void *listMgr(int cmd, void *data) return NULL; // get previous item from playlist - case gtkGetPrevPlItem: + case PLAYLIST_ITEM_GET_PREV: if (plCurrent && plCurrent->prev) { plCurrent = plCurrent->prev; // if ( !plCurrent && plList ) plCurrent=plList; @@ -104,16 +104,16 @@ void *listMgr(int cmd, void *data) return NULL; // set current item - case gtkSetCurrPlItem: + case PLAYLIST_ITEM_SET_CURR: plCurrent = item; return plCurrent; // get current item - case gtkGetCurrPlItem: + case PLAYLIST_ITEM_GET_CURR: return plCurrent; // delete current item - case gtkDelCurrPlItem: + case PLAYLIST_ITEM_DEL_CURR: { plItem *curr = plCurrent; @@ -138,7 +138,7 @@ void *listMgr(int cmd, void *data) return plCurrent; // delete list - case gtkDelPl: + case PLAYLIST_DELETE: while (plList) { plItem *next = plList->next; @@ -152,7 +152,7 @@ void *listMgr(int cmd, void *data) return NULL; // handle url - case gtkAddURLItem: + case URLLIST_ITEM_ADD: if (urlList) { urlItem *next_url = urlList; is_added = 0; @@ -174,7 +174,7 @@ void *listMgr(int cmd, void *data) } return NULL; - case gtkDelURL: + case URLLIST_DELETE: while (urlList) { urlItem *next = urlList->next; Modified: trunk/gui/util/list.h ============================================================================== --- trunk/gui/util/list.h Mon Feb 20 18:41:47 2012 (r34750) +++ trunk/gui/util/list.h Tue Feb 21 19:55:14 2012 (r34751) @@ -19,16 +19,19 @@ #ifndef MPLAYER_GUI_LIST_H #define MPLAYER_GUI_LIST_H -#define gtkAddPlItem 5 -#define gtkGetNextPlItem 6 -#define gtkGetPrevPlItem 7 -#define gtkGetCurrPlItem 8 -#define gtkDelPl 9 -#define gtkDelURL 10 -#define gtkDelCurrPlItem 23 -#define gtkInsertPlItem 24 -#define gtkSetCurrPlItem 25 -#define gtkAddURLItem 15 +/// listMgr() commands +enum { + PLAYLIST_ITEM_ADD, + PLAYLIST_ITEM_INSERT, + PLAYLIST_ITEM_SET_CURR, + PLAYLIST_ITEM_GET_CURR, + PLAYLIST_ITEM_GET_PREV, + PLAYLIST_ITEM_GET_NEXT, + PLAYLIST_ITEM_DEL_CURR, + PLAYLIST_DELETE, + URLLIST_ITEM_ADD, + URLLIST_DELETE +}; typedef struct plItem { char *path; From subversion at mplayerhq.hu Tue Feb 21 20:44:22 2012 From: subversion at mplayerhq.hu (ib) Date: Tue, 21 Feb 2012 20:44:22 +0100 (CET) Subject: [MPlayer-cvslog] r34752 - in trunk/gui: interface.c ui/gtk/playlist.c util/list.c util/list.h Message-ID: <20120221194422.7A026142034@avserver.banki.hu> Author: ib Date: Tue Feb 21 20:44:21 2012 New Revision: 34752 Log: Remove global variable pointing to current playlist item. Instead, use the listMgr command to get it. Modified: trunk/gui/interface.c trunk/gui/ui/gtk/playlist.c trunk/gui/util/list.c trunk/gui/util/list.h Modified: trunk/gui/interface.c ============================================================================== --- trunk/gui/interface.c Tue Feb 21 19:55:14 2012 (r34751) +++ trunk/gui/interface.c Tue Feb 21 20:44:21 2012 (r34752) @@ -68,6 +68,7 @@ static int initialized; void guiInit(void) { int i; + plItem *playlist; mp_msg(MSGT_GPLAYER, MSGL_V, "GUI init.\n"); @@ -233,8 +234,10 @@ void guiInit(void) uiSubRender = 1; - if (plCurrent && !filename) { - uiSetFileName(plCurrent->path, plCurrent->name, STREAMTYPE_FILE); + playlist = listMgr(PLAYLIST_ITEM_GET_CURR, 0); + + if (playlist && !filename) { + uiSetFileName(playlist->path, playlist->name, STREAMTYPE_FILE); filename = NULL; // don't start playing } Modified: trunk/gui/ui/gtk/playlist.c ============================================================================== --- trunk/gui/ui/gtk/playlist.c Tue Feb 21 19:55:14 2012 (r34751) +++ trunk/gui/ui/gtk/playlist.c Tue Feb 21 20:44:21 2012 (r34752) @@ -191,10 +191,10 @@ static void plButtonReleased( GtkButton case 1: // ok { int i; + plItem * item; if ( plList ) listMgr( PLAYLIST_DELETE,0 ); for ( i=0;ipath ) item->path = strdup( text[1] ); listMgr( PLAYLIST_ITEM_ADD,item ); } - if ( plCurrent ) + item = listMgr( PLAYLIST_ITEM_GET_CURR,0 ); + if ( item ) { - uiSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE ); -// setddup( &guiInfo.Filename,plCurrent->path,plCurrent->name ); + uiSetFileName( item->path,item->name,STREAMTYPE_FILE ); +// setddup( &guiInfo.Filename,item->path,item->name ); // guiInfo.NewPlay=GUI_FILE_NEW; // guiInfo.StreamType=STREAMTYPE_FILE; } Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Tue Feb 21 19:55:14 2012 (r34751) +++ trunk/gui/util/list.c Tue Feb 21 20:44:21 2012 (r34752) @@ -23,7 +23,7 @@ #include "string.h" plItem *plList; -plItem *plCurrent; +static plItem *plCurrent; plItem *plLastPlayed; urlItem *urlList; Modified: trunk/gui/util/list.h ============================================================================== --- trunk/gui/util/list.h Tue Feb 21 19:55:14 2012 (r34751) +++ trunk/gui/util/list.h Tue Feb 21 20:44:21 2012 (r34752) @@ -45,7 +45,6 @@ typedef struct urlItem { } urlItem; extern plItem *plList; -extern plItem *plCurrent; extern plItem *plLastPlayed; extern urlItem *urlList; From subversion at mplayerhq.hu Tue Feb 21 21:40:59 2012 From: subversion at mplayerhq.hu (reimar) Date: Tue, 21 Feb 2012 21:40:59 +0100 (CET) Subject: [MPlayer-cvslog] r34753 - trunk/libmpcodecs/vf.c Message-ID: <20120221204059.B59191420F1@avserver.banki.hu> Author: reimar Date: Tue Feb 21 21:40:59 2012 New Revision: 34753 Log: Adjust MPlayer default alignment values to match FFmpeg's. Fixes "stride changed" errors when using e.g. MPEG-2 decoder with -vf unsharp. Modified: trunk/libmpcodecs/vf.c Modified: trunk/libmpcodecs/vf.c ============================================================================== --- trunk/libmpcodecs/vf.c Tue Feb 21 20:44:21 2012 (r34752) +++ trunk/libmpcodecs/vf.c Tue Feb 21 21:40:59 2012 (r34753) @@ -290,7 +290,7 @@ mp_image_t* vf_get_image(vf_instance_t* if (w == -1) w = vf->w; if (h == -1) h = vf->h; - w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?((w+15)&(~15)):w; + w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?FFALIGN(w, 32):w; if(vf->put_image==vf_next_put_image){ // passthru mode, if the filter uses the fallback/default put_image() code @@ -382,8 +382,8 @@ mp_image_t* vf_get_image(vf_instance_t* if(mp_imgflag&MP_IMGFLAG_PREFER_ALIGNED_STRIDE){ int align=(mpi->flags&MP_IMGFLAG_PLANAR && mpi->flags&MP_IMGFLAG_YUV) ? - (8<chroma_x_shift)-1 : 15; // -- maybe FIXME - w2=((w+align)&(~align)); + (16<chroma_x_shift) : 32; // -- maybe FIXME + w2=FFALIGN(w, align); if(mpi->width!=w2){ // we have to change width... check if we CAN co it: int flags=vf->query_format(vf,outfmt); // should not fail From subversion at mplayerhq.hu Wed Feb 22 02:07:11 2012 From: subversion at mplayerhq.hu (ib) Date: Wed, 22 Feb 2012 02:07:11 +0100 (CET) Subject: [MPlayer-cvslog] r34754 - trunk/gui/ui/gtk/playlist.c Message-ID: <20120222010711.256F7142393@avserver.banki.hu> Author: ib Date: Wed Feb 22 02:07:10 2012 New Revision: 34754 Log: Remove unnecessary condition. The listMgr can handle empty lists. Modified: trunk/gui/ui/gtk/playlist.c Modified: trunk/gui/ui/gtk/playlist.c ============================================================================== --- trunk/gui/ui/gtk/playlist.c Tue Feb 21 21:40:59 2012 (r34753) +++ trunk/gui/ui/gtk/playlist.c Wed Feb 22 02:07:10 2012 (r34754) @@ -192,7 +192,7 @@ static void plButtonReleased( GtkButton { int i; plItem * item; - if ( plList ) listMgr( PLAYLIST_DELETE,0 ); + listMgr( PLAYLIST_DELETE,0 ); for ( i=0;i Author: ib Date: Wed Feb 22 11:39:05 2012 New Revision: 34755 Log: Remove global variable pointing to top of playlist. Add a corresponding listMgr command and use it instead. Modified: trunk/gui/cfg.c trunk/gui/interface.c trunk/gui/ui/gtk/playlist.c trunk/gui/util/list.c trunk/gui/util/list.h Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Wed Feb 22 02:07:10 2012 (r34754) +++ trunk/gui/cfg.c Wed Feb 22 11:39:05 2012 (r34755) @@ -394,7 +394,7 @@ void cfg_write(void) file = fopen(fname, "wt+"); if (file) { - plItem *item = plList; + plItem *item = listMgr(PLAYLIST_GET, 0); while (item) { if (item->path && item->name) { Modified: trunk/gui/interface.c ============================================================================== --- trunk/gui/interface.c Wed Feb 22 02:07:10 2012 (r34754) +++ trunk/gui/interface.c Wed Feb 22 11:39:05 2012 (r34755) @@ -913,7 +913,7 @@ int guiPlaylistAdd(play_tree_t *my_playt if (save) listMgr(PLAYLIST_ITEM_SET_CURR, save); else - listMgr(PLAYLIST_ITEM_SET_CURR, plList); // go to head, if plList was empty before + listMgr(PLAYLIST_ITEM_SET_CURR, listMgr(PLAYLIST_GET, 0)); // go to head, if plList was empty before if (save && result) listMgr(PLAYLIST_ITEM_DEL_CURR, 0); Modified: trunk/gui/ui/gtk/playlist.c ============================================================================== --- trunk/gui/ui/gtk/playlist.c Wed Feb 22 02:07:10 2012 (r34754) +++ trunk/gui/ui/gtk/playlist.c Wed Feb 22 11:39:05 2012 (r34755) @@ -89,6 +89,8 @@ static void scan_dir( char * path ); void ShowPlayList( void ) { + plItem * next; + if ( PlayList ) gtkActive( PlayList ); else PlayList=create_PlayList(); @@ -130,10 +132,10 @@ void ShowPlayList( void ) gtk_clist_freeze( GTK_CLIST( CLSelected ) ); gtk_clist_clear( GTK_CLIST( CLSelected ) ); - if ( plList ) + next = listMgr( PLAYLIST_GET,0 ); + if ( next ) { gchar * name, * path; - plItem * next = plList; while ( next || next->next ) { char * text[1][3]; text[0][2]=""; Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Wed Feb 22 02:07:10 2012 (r34754) +++ trunk/gui/util/list.c Wed Feb 22 11:39:05 2012 (r34755) @@ -22,7 +22,7 @@ #include "list.h" #include "string.h" -plItem *plList; +static plItem *plList; static plItem *plCurrent; plItem *plLastPlayed; @@ -37,6 +37,10 @@ void *listMgr(int cmd, void *data) switch (cmd) { // handle playlist + case PLAYLIST_GET: + + return plList; + // add item to playlist case PLAYLIST_ITEM_ADD: if (plList) { Modified: trunk/gui/util/list.h ============================================================================== --- trunk/gui/util/list.h Wed Feb 22 02:07:10 2012 (r34754) +++ trunk/gui/util/list.h Wed Feb 22 11:39:05 2012 (r34755) @@ -21,6 +21,7 @@ /// listMgr() commands enum { + PLAYLIST_GET, PLAYLIST_ITEM_ADD, PLAYLIST_ITEM_INSERT, PLAYLIST_ITEM_SET_CURR, @@ -44,7 +45,6 @@ typedef struct urlItem { struct urlItem *next; } urlItem; -extern plItem *plList; extern plItem *plLastPlayed; extern urlItem *urlList; From subversion at mplayerhq.hu Wed Feb 22 11:53:00 2012 From: subversion at mplayerhq.hu (ib) Date: Wed, 22 Feb 2012 11:53:00 +0100 (CET) Subject: [MPlayer-cvslog] r34756 - in trunk/gui: cfg.c ui/gtk/url.c util/list.c util/list.h Message-ID: <20120222105300.62EC5142A42@avserver.banki.hu> Author: ib Date: Wed Feb 22 11:53:00 2012 New Revision: 34756 Log: Remove global variable pointing to top of URL list. Add a corresponding listMgr command and use it instead. Modified: trunk/gui/cfg.c trunk/gui/ui/gtk/url.c trunk/gui/util/list.c trunk/gui/util/list.h Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Wed Feb 22 11:39:05 2012 (r34755) +++ trunk/gui/cfg.c Wed Feb 22 11:53:00 2012 (r34756) @@ -416,7 +416,7 @@ void cfg_write(void) file = fopen(fname, "wt+"); if (file) { - urlItem *item = urlList; + urlItem *item = listMgr(URLLIST_GET, 0); while (item) { if (item->url) Modified: trunk/gui/ui/gtk/url.c ============================================================================== --- trunk/gui/ui/gtk/url.c Wed Feb 22 11:39:05 2012 (r34755) +++ trunk/gui/ui/gtk/url.c Wed Feb 22 11:53:00 2012 (r34756) @@ -44,12 +44,15 @@ static GList * URLComboEntrys = NULL void ShowURLDialogBox( void ) { + urlItem * item; + if ( URL ) gtkActive( URL ); else URL=create_URL(); - if ( urlList ) + item = listMgr( URLLIST_GET,0 ); + + if ( item ) { - urlItem * item = urlList; g_list_free( URLComboEntrys ); URLComboEntrys=NULL; while( item ) Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Wed Feb 22 11:39:05 2012 (r34755) +++ trunk/gui/util/list.c Wed Feb 22 11:53:00 2012 (r34756) @@ -26,7 +26,7 @@ static plItem *plList; static plItem *plCurrent; plItem *plLastPlayed; -urlItem *urlList; +static urlItem *urlList; void *listMgr(int cmd, void *data) { @@ -156,6 +156,11 @@ void *listMgr(int cmd, void *data) return NULL; // handle url + + case URLLIST_GET: + + return urlList; + case URLLIST_ITEM_ADD: if (urlList) { urlItem *next_url = urlList; Modified: trunk/gui/util/list.h ============================================================================== --- trunk/gui/util/list.h Wed Feb 22 11:39:05 2012 (r34755) +++ trunk/gui/util/list.h Wed Feb 22 11:53:00 2012 (r34756) @@ -30,6 +30,7 @@ enum { PLAYLIST_ITEM_GET_NEXT, PLAYLIST_ITEM_DEL_CURR, PLAYLIST_DELETE, + URLLIST_GET, URLLIST_ITEM_ADD, URLLIST_DELETE }; @@ -47,8 +48,6 @@ typedef struct urlItem { extern plItem *plLastPlayed; -extern urlItem *urlList; - /// @name list manager (playlist, URL list) void *listMgr(int cmd, void *data); From subversion at mplayerhq.hu Wed Feb 22 14:27:43 2012 From: subversion at mplayerhq.hu (ib) Date: Wed, 22 Feb 2012 14:27:43 +0100 (CET) Subject: [MPlayer-cvslog] r34757 - in trunk/gui: interface.c ui/main.c util/list.c util/list.h Message-ID: <20120222132743.E04A8142C45@avserver.banki.hu> Author: ib Date: Wed Feb 22 14:27:42 2012 New Revision: 34757 Log: Remove global variable pointing to playlist item last played. The variable and the condition it is used for are pointless, because it isn't possible to insert an playlist item before the current one without rebuilding the whole list which would invalidate this pointer. Modified: trunk/gui/interface.c trunk/gui/ui/main.c trunk/gui/util/list.c trunk/gui/util/list.h Modified: trunk/gui/interface.c ============================================================================== --- trunk/gui/interface.c Wed Feb 22 11:53:00 2012 (r34756) +++ trunk/gui/interface.c Wed Feb 22 14:27:42 2012 (r34757) @@ -772,8 +772,9 @@ int gui(int what, void *data) break; } - if (guiInfo.Playing && (next = listMgr(PLAYLIST_ITEM_GET_NEXT, 0)) && (plLastPlayed != next)) { - plLastPlayed = next; + next = listMgr(PLAYLIST_ITEM_GET_NEXT, 0); + + if (guiInfo.Playing && next) { uiSetFileName(next->path, next->name, STREAMTYPE_FILE); guiInfo.NewPlay = GUI_FILE_NEW; guiInfo.Track++; Modified: trunk/gui/ui/main.c ============================================================================== --- trunk/gui/ui/main.c Wed Feb 22 11:53:00 2012 (r34756) +++ trunk/gui/ui/main.c Wed Feb 22 14:27:42 2012 (r34757) @@ -211,7 +211,6 @@ play: if ( listMgr( PLAYLIST_ITEM_GET_CURR,0 ) &&( guiInfo.StreamType == STREAMTYPE_FILE ) ) { plItem * next = listMgr( PLAYLIST_ITEM_GET_CURR,0 ); - plLastPlayed=next; uiSetFileName( next->path,next->name,SAME_STREAMTYPE ); } Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Wed Feb 22 11:53:00 2012 (r34756) +++ trunk/gui/util/list.c Wed Feb 22 14:27:42 2012 (r34757) @@ -24,7 +24,6 @@ static plItem *plList; static plItem *plCurrent; -plItem *plLastPlayed; static urlItem *urlList; Modified: trunk/gui/util/list.h ============================================================================== --- trunk/gui/util/list.h Wed Feb 22 11:53:00 2012 (r34756) +++ trunk/gui/util/list.h Wed Feb 22 14:27:42 2012 (r34757) @@ -46,8 +46,6 @@ typedef struct urlItem { struct urlItem *next; } urlItem; -extern plItem *plLastPlayed; - /// @name list manager (playlist, URL list) void *listMgr(int cmd, void *data); From subversion at mplayerhq.hu Wed Feb 22 15:17:01 2012 From: subversion at mplayerhq.hu (ib) Date: Wed, 22 Feb 2012 15:17:01 +0100 (CET) Subject: [MPlayer-cvslog] r34758 - trunk/gui/util/list.c Message-ID: <20120222141701.0FC56142CE0@avserver.banki.hu> Author: ib Date: Wed Feb 22 15:17:00 2012 New Revision: 34758 Log: Cosmetic: Remove unnecessary comments and commented code. The case expressions are self-explanatory now. Additionally, change the remaining comments. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Wed Feb 22 14:27:42 2012 (r34757) +++ trunk/gui/util/list.c Wed Feb 22 15:17:00 2012 (r34758) @@ -34,22 +34,18 @@ void *listMgr(int cmd, void *data) int is_added = 1; switch (cmd) { - // handle playlist + // playlist case PLAYLIST_GET: return plList; - // add item to playlist case PLAYLIST_ITEM_ADD: if (plList) { plItem *next = plList; while (next->next) -// { -// printf( "%s\n",next->name ); next = next->next; -// } next->next = item; item->prev = next; @@ -60,7 +56,6 @@ void *listMgr(int cmd, void *data) } return NULL; - // add item into playlist after current case PLAYLIST_ITEM_INSERT: if (plCurrent) { plItem *curr = plCurrent; @@ -77,7 +72,6 @@ void *listMgr(int cmd, void *data) } else return listMgr(PLAYLIST_ITEM_ADD, item); - // get next item from playlist case PLAYLIST_ITEM_GET_NEXT: if (plCurrent && plCurrent->next) { plCurrent = plCurrent->next; @@ -97,7 +91,6 @@ void *listMgr(int cmd, void *data) } return NULL; - // get previous item from playlist case PLAYLIST_ITEM_GET_PREV: if (plCurrent && plCurrent->prev) { plCurrent = plCurrent->prev; @@ -106,16 +99,13 @@ void *listMgr(int cmd, void *data) } return NULL; - // set current item case PLAYLIST_ITEM_SET_CURR: plCurrent = item; return plCurrent; - // get current item case PLAYLIST_ITEM_GET_CURR: return plCurrent; - // delete current item case PLAYLIST_ITEM_DEL_CURR: { plItem *curr = plCurrent; @@ -132,7 +122,6 @@ void *listMgr(int cmd, void *data) plCurrent = curr->next; - // free it free(curr->path); free(curr->name); free(curr); @@ -140,7 +129,6 @@ void *listMgr(int cmd, void *data) //uiCurr(); // instead of using uiNext && uiPrev return plCurrent; - // delete list case PLAYLIST_DELETE: while (plList) { plItem *next = plList->next; @@ -154,7 +142,7 @@ void *listMgr(int cmd, void *data) plCurrent = NULL; return NULL; - // handle url + // url list case URLLIST_GET: From subversion at mplayerhq.hu Wed Feb 22 15:19:45 2012 From: subversion at mplayerhq.hu (diego) Date: Wed, 22 Feb 2012 15:19:45 +0100 (CET) Subject: [MPlayer-cvslog] r34759 - in trunk: Makefile cfg-common.h configure libmpcodecs/vf.c Message-ID: <20120222141945.E4B6F142CE0@avserver.banki.hu> Author: diego Date: Wed Feb 22 15:19:45 2012 New Revision: 34759 Log: build: Separate libpostproc check from FFmpeg check. Unless GPL has been enabled, libpostproc may not be available or it may not be available at all. Modified: trunk/Makefile trunk/cfg-common.h trunk/configure trunk/libmpcodecs/vf.c Modified: trunk/Makefile ============================================================================== --- trunk/Makefile Wed Feb 22 15:17:00 2012 (r34758) +++ trunk/Makefile Wed Feb 22 15:19:45 2012 (r34759) @@ -78,7 +78,6 @@ SRCS_COMMON-$(FFMPEG) += libmpcodecs/vf_geq.c \ libmpcodecs/vf_lavc.c \ libmpcodecs/vf_lavcdeint.c \ - libmpcodecs/vf_pp.c \ libmpcodecs/vf_screenshot.c \ libmpdemux/demux_lavf.c \ stream/stream_ffmpeg.c \ @@ -210,6 +209,7 @@ SRCS_COMMON-$(NETWORKING) += stream/realrtsp/xbuffer.c \ SRCS_COMMON-$(PNG) += libmpcodecs/vd_mpng.c +SRCS_COMMON-$(POSTPROC) += libmpcodecs/vf_pp.c SRCS_COMMON-$(PRIORITY) += osdep/priority.c SRCS_COMMON-$(PVR) += stream/stream_pvr.c SRCS_COMMON-$(QTX_CODECS) += libmpcodecs/ad_qtaudio.c \ Modified: trunk/cfg-common.h ============================================================================== --- trunk/cfg-common.h Wed Feb 22 15:17:00 2012 (r34758) +++ trunk/cfg-common.h Wed Feb 22 15:19:45 2012 (r34759) @@ -525,7 +525,7 @@ const m_option_t common_opts[] = { {"vc", &video_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, // postprocessing: -#ifdef CONFIG_FFMPEG +#ifdef CONFIG_POSTPROC {"pp", &divx_quality, CONF_TYPE_INT, 0, 0, 0, NULL}, {"pphelp", pp_help, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif Modified: trunk/configure ============================================================================== --- trunk/configure Wed Feb 22 15:17:00 2012 (r34758) +++ trunk/configure Wed Feb 22 15:19:45 2012 (r34759) @@ -416,6 +416,7 @@ Codecs: --disable-libnut disable libnut [autodetect] --disable-ffmpeg_a disable static FFmpeg [autodetect] --disable-ffmpeg_so disable shared FFmpeg [autodetect] + --disable-postproc disable libpostproc [autodetect] --enable-vf-lavfi enable libavfilter wrapper [disabled] --disable-libavcodec_mpegaudio_hp disable high precision audio decoding in libavcodec [enabled] @@ -650,6 +651,7 @@ _cross_compile=auto _prefix="/usr/local" ffmpeg_a=auto ffmpeg_so=auto +postproc=auto _vf_lavfi=no _libavcodec_mpegaudio_hp=yes _libopencore_amrnb=auto @@ -1284,6 +1286,8 @@ for ac_option do --disable-ffmpeg_a) ffmpeg_a=no ;; --enable-ffmpeg_so) ffmpeg_so=yes ;; --disable-ffmpeg_so) ffmpeg_so=no ;; + --enable-postproc) postproc=yes ;; + --disable-postproc) postproc=no ;; --enable-vf-lavfi) _vf_lavfi=yes ;; --disable-vf-lavfi) _vf_lavfi=no ;; --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;; @@ -6718,12 +6722,12 @@ if test "$ffmpeg_a" = auto ; then elif test "$ffmpeg_so" = auto ; then ffmpeg_so=no if $_pkg_config --exists libavutil ; then - inc_ffmpeg=$($_pkg_config --cflags libpostproc libswscale libavformat libavcodec libavutil) - ld_tmp=$($_pkg_config --libs libpostproc libswscale libavformat libavcodec libavutil) + inc_ffmpeg=$($_pkg_config --cflags libswscale libavformat libavcodec libavutil) + ld_tmp=$($_pkg_config --libs libswscale libavformat libavcodec libavutil) header_check libavutil/avutil.h $inc_ffmpeg $ld_tmp && extra_ldflags="$extra_ldflags $ld_tmp" && ffmpeg_so=yes && ffmpeg=yes - elif header_check libavutil/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil ; then - extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil" + elif header_check libavutil/avutil.h -lswscale -lavformat -lavcodec -lavutil ; then + extra_ldflags="$extra_ldflags -lswscale -lavformat -lavcodec -lavutil" ffmpeg_so=yes ffmpeg=yes fi @@ -6752,6 +6756,28 @@ test "$_libavcodec_mpegaudio_hp" = yes & echores "$ffmpeg" +echocheck "libpostproc" +if test "$postproc" = auto ; then + postproc=no + if test "$ffmpeg_a" = yes ; then + postproc=yes + elif $_pkg_config --exists libpostproc ; then + inc_postproc=$($_pkg_config --cflags libpostproc) + ld_tmp=$($_pkg_config --libs libpostproc) + header_check libpostproc/postprocess.h $inc_postproc $ld_tmp && + extra_ldflags="$extra_ldflags $ld_tmp" && postproc=yes + elif header_check libpostproc/postprocess.h -lpostproc ; then + extra_ldflags="$extra_ldflags -lpostproc" + postproc=yes + fi +fi +if test "$postproc" = yes; then + def_postproc='#define CONFIG_POSTPROC 1' +else + def_postproc='#undef CONFIG_POSTPROC' +fi +echores "$postproc" + echocheck "libopencore_amr narrowband" if test "$_libopencore_amrnb" = auto ; then @@ -8081,6 +8107,7 @@ OSS = $_ossaudio PE_EXECUTABLE = $_pe_executable PNG = $_png PNM = $_pnm +POSTPROC = $postproc PRIORITY = $_priority PULSE = $_pulse PVR = $_pvr @@ -8582,6 +8609,7 @@ $def_kva $def_md5sum $def_mga $def_mng +$def_postproc $def_png $def_pnm $def_quartz Modified: trunk/libmpcodecs/vf.c ============================================================================== --- trunk/libmpcodecs/vf.c Wed Feb 22 15:17:00 2012 (r34758) +++ trunk/libmpcodecs/vf.c Wed Feb 22 15:19:45 2012 (r34759) @@ -140,7 +140,6 @@ static const vf_info_t* const filter_lis &vf_info_palette, &vf_info_pp7, #ifdef CONFIG_FFMPEG - &vf_info_pp, &vf_info_lavc, &vf_info_lavcdeint, #ifdef CONFIG_VF_LAVFI @@ -149,6 +148,9 @@ static const vf_info_t* const filter_lis &vf_info_screenshot, &vf_info_geq, #endif +#ifdef CONFIG_POSTPROC + &vf_info_pp, +#endif #ifdef CONFIG_ZR &vf_info_zrmjpeg, #endif From subversion at mplayerhq.hu Thu Feb 23 05:25:54 2012 From: subversion at mplayerhq.hu (compn) Date: Thu, 23 Feb 2012 05:25:54 +0100 (CET) Subject: [MPlayer-cvslog] r34760 - trunk/etc/codecs.conf Message-ID: <20120223042555.03092142F14@avserver.banki.hu> Author: compn Date: Thu Feb 23 05:25:54 2012 New Revision: 34760 Log: add IPJ2 to ffj2k, samples created by mencoder -ovc vfw and jp2avi.dll Modified: trunk/etc/codecs.conf Modified: trunk/etc/codecs.conf ============================================================================== --- trunk/etc/codecs.conf Wed Feb 22 15:19:45 2012 (r34759) +++ trunk/etc/codecs.conf Thu Feb 23 05:25:54 2012 (r34760) @@ -1819,6 +1819,7 @@ videocodec ffj2k fourcc MJP2 fourcc mjp2 fourcc LJ2K,LJ2C + fourcc IPJ2 driver ffmpeg dll "j2k" out RGB24,Y800 From subversion at mplayerhq.hu Thu Feb 23 10:32:28 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 10:32:28 +0100 (CET) Subject: [MPlayer-cvslog] r34761 - trunk/gui/util/list.c Message-ID: <20120223093228.884C6143311@avserver.banki.hu> Author: ib Date: Thu Feb 23 10:32:28 2012 New Revision: 34761 Log: Cosmetic: Rename variables in listMgr(). Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 05:25:54 2012 (r34760) +++ trunk/gui/util/list.c Thu Feb 23 10:32:28 2012 (r34761) @@ -29,9 +29,9 @@ static urlItem *urlList; void *listMgr(int cmd, void *data) { - plItem *item = (plItem *)data; - urlItem *url_item = (urlItem *)data; - int is_added = 1; + plItem *pdat = (plItem *)data; + urlItem *udat = (urlItem *)data; + int is_added = 1; switch (cmd) { // playlist @@ -42,35 +42,35 @@ void *listMgr(int cmd, void *data) case PLAYLIST_ITEM_ADD: if (plList) { - plItem *next = plList; + plItem *item = plList; - while (next->next) - next = next->next; + while (item->next) + item = item->next; - next->next = item; - item->prev = next; - item->next = NULL; + item->next = pdat; + pdat->prev = item; + pdat->next = NULL; } else { - item->prev = item->next = NULL; - plCurrent = plList = item; + pdat->prev = pdat->next = NULL; + plCurrent = plList = pdat; } return NULL; case PLAYLIST_ITEM_INSERT: if (plCurrent) { plItem *curr = plCurrent; - item->next = curr->next; + pdat->next = curr->next; - if (item->next) - item->next->prev = item; + if (pdat->next) + pdat->next->prev = pdat; - item->prev = curr; - curr->next = item; + pdat->prev = curr; + curr->next = pdat; plCurrent = plCurrent->next; return plCurrent; } else - return listMgr(PLAYLIST_ITEM_ADD, item); + return listMgr(PLAYLIST_ITEM_ADD, pdat); case PLAYLIST_ITEM_GET_NEXT: if (plCurrent && plCurrent->next) { @@ -100,7 +100,7 @@ void *listMgr(int cmd, void *data) return NULL; case PLAYLIST_ITEM_SET_CURR: - plCurrent = item; + plCurrent = pdat; return plCurrent; case PLAYLIST_ITEM_GET_CURR: @@ -131,13 +131,13 @@ void *listMgr(int cmd, void *data) case PLAYLIST_DELETE: while (plList) { - plItem *next = plList->next; + plItem *item = plList->next; free(plList->path); free(plList->name); free(plList); - plList = next; + plList = item; } plCurrent = NULL; return NULL; @@ -150,34 +150,34 @@ void *listMgr(int cmd, void *data) case URLLIST_ITEM_ADD: if (urlList) { - urlItem *next_url = urlList; + urlItem *item = urlList; is_added = 0; - while (next_url->next) { - if (!gstrcmp(next_url->url, url_item->url)) { + while (item->next) { + if (!gstrcmp(item->url, udat->url)) { is_added = 1; break; } - next_url = next_url->next; + item = item->next; } - if (!is_added && gstrcmp(next_url->url, url_item->url)) - next_url->next = url_item; + if (!is_added && gstrcmp(item->url, udat->url)) + item->next = udat; } else { - url_item->next = NULL; - urlList = url_item; + udat->next = NULL; + urlList = udat; } return NULL; case URLLIST_DELETE: while (urlList) { - urlItem *next = urlList->next; + urlItem *item = urlList->next; free(urlList->url); free(urlList); - urlList = next; + urlList = item; } return NULL; } From subversion at mplayerhq.hu Thu Feb 23 12:44:50 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 12:44:50 +0100 (CET) Subject: [MPlayer-cvslog] r34762 - trunk/gui/util/list.c Message-ID: <20120223114450.192F31433F5@avserver.banki.hu> Author: ib Date: Thu Feb 23 12:44:49 2012 New Revision: 34762 Log: Revise listMgr() command PLAYLIST_ITEM_ADD. Change return value to pointer to current playlist item. Additionally, some cosmetic code and formatting changes. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 10:32:28 2012 (r34761) +++ trunk/gui/util/list.c Thu Feb 23 12:44:49 2012 (r34762) @@ -41,6 +41,7 @@ void *listMgr(int cmd, void *data) return plList; case PLAYLIST_ITEM_ADD: + if (plList) { plItem *item = plList; @@ -51,10 +52,11 @@ void *listMgr(int cmd, void *data) pdat->prev = item; pdat->next = NULL; } else { - pdat->prev = pdat->next = NULL; + pdat->next = pdat->prev = NULL; plCurrent = plList = pdat; } - return NULL; + + return plCurrent; case PLAYLIST_ITEM_INSERT: if (plCurrent) { From subversion at mplayerhq.hu Thu Feb 23 13:25:58 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 13:25:58 +0100 (CET) Subject: [MPlayer-cvslog] r34763 - trunk/gui/util/list.c Message-ID: <20120223122558.34DC114344D@avserver.banki.hu> Author: ib Date: Thu Feb 23 13:25:57 2012 New Revision: 34763 Log: Revise listMgr() command PLAYLIST_ITEM_INSERT. Remove unnecessary variable curr. Additionally, some cosmetic formatting changes. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 12:44:49 2012 (r34762) +++ trunk/gui/util/list.c Thu Feb 23 13:25:57 2012 (r34763) @@ -59,16 +59,17 @@ void *listMgr(int cmd, void *data) return plCurrent; case PLAYLIST_ITEM_INSERT: + if (plCurrent) { - plItem *curr = plCurrent; - pdat->next = curr->next; + pdat->next = plCurrent->next; if (pdat->next) pdat->next->prev = pdat; - pdat->prev = curr; - curr->next = pdat; - plCurrent = plCurrent->next; + pdat->prev = plCurrent; + plCurrent->next = pdat; + + plCurrent = pdat; return plCurrent; } else From subversion at mplayerhq.hu Thu Feb 23 13:39:29 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 13:39:29 +0100 (CET) Subject: [MPlayer-cvslog] r34764 - trunk/gui/util/list.c Message-ID: <20120223123929.79ECB14346A@avserver.banki.hu> Author: ib Date: Thu Feb 23 13:39:29 2012 New Revision: 34764 Log: Cosmetic: Insert some blank lines and remove commented code. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 13:25:57 2012 (r34763) +++ trunk/gui/util/list.c Thu Feb 23 13:39:29 2012 (r34764) @@ -76,37 +76,30 @@ void *listMgr(int cmd, void *data) return listMgr(PLAYLIST_ITEM_ADD, pdat); case PLAYLIST_ITEM_GET_NEXT: + if (plCurrent && plCurrent->next) { plCurrent = plCurrent->next; -// if (!plCurrent && plList) -// { -// plItem *next = plList; -// -// while (next->next) -// { -// if (!next->next) break; -// next = next->next; -// } -// -// plCurrent = next; -// } return plCurrent; } + return NULL; case PLAYLIST_ITEM_GET_PREV: + if (plCurrent && plCurrent->prev) { plCurrent = plCurrent->prev; -// if ( !plCurrent && plList ) plCurrent=plList; return plCurrent; } + return NULL; case PLAYLIST_ITEM_SET_CURR: + plCurrent = pdat; return plCurrent; case PLAYLIST_ITEM_GET_CURR: + return plCurrent; case PLAYLIST_ITEM_DEL_CURR: @@ -133,6 +126,7 @@ void *listMgr(int cmd, void *data) return plCurrent; case PLAYLIST_DELETE: + while (plList) { plItem *item = plList->next; @@ -142,6 +136,7 @@ void *listMgr(int cmd, void *data) plList = item; } + plCurrent = NULL; return NULL; @@ -174,6 +169,7 @@ void *listMgr(int cmd, void *data) return NULL; case URLLIST_DELETE: + while (urlList) { urlItem *item = urlList->next; @@ -182,6 +178,7 @@ void *listMgr(int cmd, void *data) urlList = item; } + return NULL; } From subversion at mplayerhq.hu Thu Feb 23 13:58:21 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 13:58:21 +0100 (CET) Subject: [MPlayer-cvslog] r34765 - trunk/gui/util/list.c Message-ID: <20120223125821.64D5F13EF1E@avserver.banki.hu> Author: ib Date: Thu Feb 23 13:58:21 2012 New Revision: 34765 Log: Revise listMgr() command PLAYLIST_ITEM_DEL_CURR. Additionally, insert some blank lines and remove commented code. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 13:39:29 2012 (r34764) +++ trunk/gui/util/list.c Thu Feb 23 13:58:21 2012 (r34765) @@ -103,26 +103,25 @@ void *listMgr(int cmd, void *data) return plCurrent; case PLAYLIST_ITEM_DEL_CURR: - { - plItem *curr = plCurrent; - if (!curr) - return NULL; + if (plCurrent) { + plItem *curr = plCurrent; if (curr->prev) curr->prev->next = curr->next; if (curr->next) curr->next->prev = curr->prev; - if (curr == plList) - plList = curr->next; plCurrent = curr->next; + if (curr == plList) + plList = plCurrent; + free(curr->path); free(curr->name); free(curr); } - //uiCurr(); // instead of using uiNext && uiPrev + return plCurrent; case PLAYLIST_DELETE: From subversion at mplayerhq.hu Thu Feb 23 13:59:28 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 13:59:28 +0100 (CET) Subject: [MPlayer-cvslog] r34766 - trunk/gui/util/list.c Message-ID: <20120223125928.9421114348E@avserver.banki.hu> Author: ib Date: Thu Feb 23 13:59:28 2012 New Revision: 34766 Log: Cosmetic: Adjust indent. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 13:58:21 2012 (r34765) +++ trunk/gui/util/list.c Thu Feb 23 13:59:28 2012 (r34766) @@ -105,22 +105,22 @@ void *listMgr(int cmd, void *data) case PLAYLIST_ITEM_DEL_CURR: if (plCurrent) { - plItem *curr = plCurrent; + plItem *curr = plCurrent; - if (curr->prev) - curr->prev->next = curr->next; - if (curr->next) - curr->next->prev = curr->prev; + if (curr->prev) + curr->prev->next = curr->next; + if (curr->next) + curr->next->prev = curr->prev; - plCurrent = curr->next; + plCurrent = curr->next; - if (curr == plList) - plList = plCurrent; + if (curr == plList) + plList = plCurrent; - free(curr->path); - free(curr->name); - free(curr); - } + free(curr->path); + free(curr->name); + free(curr); + } return plCurrent; From subversion at mplayerhq.hu Thu Feb 23 14:07:50 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 14:07:50 +0100 (CET) Subject: [MPlayer-cvslog] r34767 - trunk/gui/util/list.c Message-ID: <20120223130750.34F781431C0@avserver.banki.hu> Author: ib Date: Thu Feb 23 14:07:49 2012 New Revision: 34767 Log: Revise listMgr() command URLLIST_ITEM_ADD. Remove unnecessary variable is_added, replace gstrcmp() by strcmp(), fix memory leakage by freeing list item that won't be added and change return value to pointer to added item. Additionally, insert some blank lines. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 13:59:28 2012 (r34766) +++ trunk/gui/util/list.c Thu Feb 23 14:07:49 2012 (r34767) @@ -31,7 +31,6 @@ void *listMgr(int cmd, void *data) { plItem *pdat = (plItem *)data; urlItem *udat = (urlItem *)data; - int is_added = 1; switch (cmd) { // playlist @@ -146,26 +145,31 @@ void *listMgr(int cmd, void *data) return urlList; case URLLIST_ITEM_ADD: + if (urlList) { urlItem *item = urlList; - is_added = 0; - while (item->next) { - if (!gstrcmp(item->url, udat->url)) { - is_added = 1; - break; + while (item) { + if (strcmp(udat->url, item->url) == 0) { + free(udat->url); + free(udat); + return NULL; } - item = item->next; + if (item->next) + item = item->next; + else { + item->next = udat; + udat->next = NULL; + break; + } } - - if (!is_added && gstrcmp(item->url, udat->url)) - item->next = udat; } else { udat->next = NULL; urlList = udat; } - return NULL; + + return udat; case URLLIST_DELETE: From subversion at mplayerhq.hu Thu Feb 23 14:15:47 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 14:15:47 +0100 (CET) Subject: [MPlayer-cvslog] r34768 - trunk/gui/util/list.c Message-ID: <20120223131547.703E0143491@avserver.banki.hu> Author: ib Date: Thu Feb 23 14:15:47 2012 New Revision: 34768 Log: Add a default clause to listMgr()'s switch statement. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 14:07:49 2012 (r34767) +++ trunk/gui/util/list.c Thu Feb 23 14:15:47 2012 (r34768) @@ -183,9 +183,11 @@ void *listMgr(int cmd, void *data) } return NULL; - } - return NULL; + default: + + return NULL; + } } /** From subversion at mplayerhq.hu Thu Feb 23 14:23:54 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 14:23:54 +0100 (CET) Subject: [MPlayer-cvslog] r34769 - in trunk/gui: cfg.c interface.c ui/gtk/playlist.c ui/main.c util/list.c util/list.h Message-ID: <20120223132355.0B3861434A5@avserver.banki.hu> Author: ib Date: Thu Feb 23 14:23:54 2012 New Revision: 34769 Log: Rename PLAYLIST_ITEM_ADD PLAYLIST_ITEM_APPEND. It is different from URLLIST_ITEM_ADD, so choose a different name. Modified: trunk/gui/cfg.c trunk/gui/interface.c trunk/gui/ui/gtk/playlist.c trunk/gui/ui/main.c trunk/gui/util/list.c trunk/gui/util/list.h Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 23 14:15:47 2012 (r34768) +++ trunk/gui/cfg.c Thu Feb 23 14:23:54 2012 (r34769) @@ -291,7 +291,7 @@ void cfg_read(void) if (fgetstr(line, sizeof(line), file) && *line) { item->name = strdup(line); - listMgr(PLAYLIST_ITEM_ADD, item); + listMgr(PLAYLIST_ITEM_APPEND, item); } else { free(item->path); free(item); Modified: trunk/gui/interface.c ============================================================================== --- trunk/gui/interface.c Thu Feb 23 14:15:47 2012 (r34768) +++ trunk/gui/interface.c Thu Feb 23 14:23:54 2012 (r34769) @@ -856,7 +856,7 @@ static int import_file_into_gui(char *te if (insert) listMgr(PLAYLIST_ITEM_INSERT, item); // inserts the item after current, and makes current=item else - listMgr(PLAYLIST_ITEM_ADD, item); + listMgr(PLAYLIST_ITEM_APPEND, item); return 1; } Modified: trunk/gui/ui/gtk/playlist.c ============================================================================== --- trunk/gui/ui/gtk/playlist.c Thu Feb 23 14:15:47 2012 (r34768) +++ trunk/gui/ui/gtk/playlist.c Thu Feb 23 14:23:54 2012 (r34769) @@ -205,7 +205,7 @@ static void plButtonReleased( GtkButton if ( !item->name ) item->name = strdup( text[0] ); item->path=g_filename_from_utf8( text[1], -1, NULL, NULL, NULL ); if ( !item->path ) item->path = strdup( text[1] ); - listMgr( PLAYLIST_ITEM_ADD,item ); + listMgr( PLAYLIST_ITEM_APPEND,item ); } item = listMgr( PLAYLIST_ITEM_GET_CURR,0 ); if ( item ) Modified: trunk/gui/ui/main.c ============================================================================== --- trunk/gui/ui/main.c Thu Feb 23 14:15:47 2012 (r34768) +++ trunk/gui/ui/main.c Thu Feb 23 14:23:54 2012 (r34769) @@ -657,7 +657,7 @@ void uiDandDHandler(int num,char** files item->name = strdup(str); item->path = strdup(""); } - listMgr(PLAYLIST_ITEM_ADD,item); + listMgr(PLAYLIST_ITEM_APPEND,item); } else { mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_NotAFile,str ); } Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 14:15:47 2012 (r34768) +++ trunk/gui/util/list.c Thu Feb 23 14:23:54 2012 (r34769) @@ -39,7 +39,7 @@ void *listMgr(int cmd, void *data) return plList; - case PLAYLIST_ITEM_ADD: + case PLAYLIST_ITEM_APPEND: if (plList) { plItem *item = plList; @@ -72,7 +72,7 @@ void *listMgr(int cmd, void *data) return plCurrent; } else - return listMgr(PLAYLIST_ITEM_ADD, pdat); + return listMgr(PLAYLIST_ITEM_APPEND, pdat); case PLAYLIST_ITEM_GET_NEXT: Modified: trunk/gui/util/list.h ============================================================================== --- trunk/gui/util/list.h Thu Feb 23 14:15:47 2012 (r34768) +++ trunk/gui/util/list.h Thu Feb 23 14:23:54 2012 (r34769) @@ -22,7 +22,7 @@ /// listMgr() commands enum { PLAYLIST_GET, - PLAYLIST_ITEM_ADD, + PLAYLIST_ITEM_APPEND, PLAYLIST_ITEM_INSERT, PLAYLIST_ITEM_SET_CURR, PLAYLIST_ITEM_GET_CURR, From subversion at mplayerhq.hu Thu Feb 23 14:30:16 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 14:30:16 +0100 (CET) Subject: [MPlayer-cvslog] r34770 - trunk/gui/util/list.c Message-ID: <20120223133016.77F39143260@avserver.banki.hu> Author: ib Date: Thu Feb 23 14:30:16 2012 New Revision: 34770 Log: Cosmetic: Arrange listMgr() commands in switch statement. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 14:23:54 2012 (r34769) +++ trunk/gui/util/list.c Thu Feb 23 14:30:16 2012 (r34770) @@ -74,14 +74,14 @@ void *listMgr(int cmd, void *data) } else return listMgr(PLAYLIST_ITEM_APPEND, pdat); - case PLAYLIST_ITEM_GET_NEXT: + case PLAYLIST_ITEM_SET_CURR: - if (plCurrent && plCurrent->next) { - plCurrent = plCurrent->next; - return plCurrent; - } + plCurrent = pdat; + return plCurrent; - return NULL; + case PLAYLIST_ITEM_GET_CURR: + + return plCurrent; case PLAYLIST_ITEM_GET_PREV: @@ -92,14 +92,14 @@ void *listMgr(int cmd, void *data) return NULL; - case PLAYLIST_ITEM_SET_CURR: - - plCurrent = pdat; - return plCurrent; + case PLAYLIST_ITEM_GET_NEXT: - case PLAYLIST_ITEM_GET_CURR: + if (plCurrent && plCurrent->next) { + plCurrent = plCurrent->next; + return plCurrent; + } - return plCurrent; + return NULL; case PLAYLIST_ITEM_DEL_CURR: From subversion at mplayerhq.hu Thu Feb 23 14:48:58 2012 From: subversion at mplayerhq.hu (ib) Date: Thu, 23 Feb 2012 14:48:58 +0100 (CET) Subject: [MPlayer-cvslog] r34771 - trunk/gui/util/list.c Message-ID: <20120223134858.61ED01434B7@avserver.banki.hu> Author: ib Date: Thu Feb 23 14:48:58 2012 New Revision: 34771 Log: Add doxygen comments to list.c. Modified: trunk/gui/util/list.c Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 14:30:16 2012 (r34770) +++ trunk/gui/util/list.c Thu Feb 23 14:48:58 2012 (r34771) @@ -16,6 +16,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +/** + * @file + * @brief List management + */ + #include #include @@ -27,6 +32,17 @@ static plItem *plCurrent; static urlItem *urlList; +/** + * @brief Manage playlists and URL lists. + * + * @param cmd task to be performed + * @param data list item for the task + * + * @return pointer to top of list (GET command), + * pointer to current list item (ITEM command) or + * NULL (DELETE or unknown command) + * + */ void *listMgr(int cmd, void *data) { plItem *pdat = (plItem *)data; From subversion at mplayerhq.hu Fri Feb 24 18:16:54 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 24 Feb 2012 18:16:54 +0100 (CET) Subject: [MPlayer-cvslog] r34772 - in trunk/gui: app.h cfg.c interface.c ui/actions.c ui/gtk/equalizer.c ui/gtk/fileselect.c ui/gtk/preferences.c ui/main.c ui/menu.c ui/playbar.c ui/sub.c ui/widgets.c util/bitmap.c util/bit... Message-ID: <20120224171654.E9CD1143D62@avserver.banki.hu> Author: ib Date: Fri Feb 24 18:16:54 2012 New Revision: 34772 Log: Cosmetic: Prefer C style for single line comments. Additionally, slightly revise some of these comments. Modified: trunk/gui/app.h trunk/gui/cfg.c trunk/gui/interface.c trunk/gui/ui/actions.c trunk/gui/ui/gtk/equalizer.c trunk/gui/ui/gtk/fileselect.c trunk/gui/ui/gtk/preferences.c trunk/gui/ui/main.c trunk/gui/ui/menu.c trunk/gui/ui/playbar.c trunk/gui/ui/sub.c trunk/gui/ui/widgets.c trunk/gui/util/bitmap.c trunk/gui/util/bitmap.h trunk/gui/util/list.c trunk/gui/win32/gui.c trunk/gui/win32/skinload.h trunk/gui/wm/ws.c trunk/gui/wm/ws.h Modified: trunk/gui/app.h ============================================================================== --- trunk/gui/app.h Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/app.h Fri Feb 24 18:16:54 2012 (r34772) @@ -22,7 +22,7 @@ #include "util/bitmap.h" #include "wm/ws.h" -// User events +/* User events */ #define evNone 0 @@ -73,7 +73,7 @@ #define evIconify 11 #define evExit 1000 -// Internal events +/* Internal events */ #define ivSetAudio 45 #define ivSetVideo 46 @@ -96,7 +96,7 @@ typedef struct { const char *name; } evName; -// Skin items +/* Skin items */ #define itNone 0 #define itButton 101 @@ -111,13 +111,13 @@ typedef struct { #define itPLMButton (itNone - 1) #define itPRMButton (itNone - 2) -// Button states +/* Button states */ #define btnDisabled 0 #define btnReleased 1 #define btnPressed 2 -// Item definition +/* Item definition */ #define MAX_ITEMS 64 Modified: trunk/gui/cfg.c ============================================================================== --- trunk/gui/cfg.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/cfg.c Fri Feb 24 18:16:54 2012 (r34772) @@ -246,7 +246,7 @@ void cfg_read(void) player_idle_mode = 1; // GUI is in idle mode by default - // configuration + /* configuration */ fname = get_path(gui_configuration); @@ -268,7 +268,7 @@ void cfg_read(void) free(fname); - // playlist + /* playlist */ fname = get_path(gui_playlist); file = fopen(fname, "rt"); @@ -303,7 +303,7 @@ void cfg_read(void) free(fname); - // URL list + /* URL list */ fname = get_path(gui_urllist); file = fopen(fname, "rt"); @@ -331,7 +331,7 @@ void cfg_read(void) free(fname); - // directory history + /* directory history */ fname = get_path(gui_history); file = fopen(fname, "rt"); @@ -354,7 +354,7 @@ void cfg_write(void) char *fname; FILE *file; - // configuration + /* configuration */ fname = get_path(gui_configuration); file = fopen(fname, "wt+"); @@ -388,7 +388,7 @@ void cfg_write(void) free(fname); - // playlist + /* playlist */ fname = get_path(gui_playlist); file = fopen(fname, "wt+"); @@ -410,7 +410,7 @@ void cfg_write(void) free(fname); - // URL list + /* URL list */ fname = get_path(gui_urllist); file = fopen(fname, "wt+"); @@ -430,7 +430,7 @@ void cfg_write(void) free(fname); - // directory history + /* directory history */ fname = get_path(gui_history); file = fopen(fname, "wt+"); Modified: trunk/gui/interface.c ============================================================================== --- trunk/gui/interface.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/interface.c Fri Feb 24 18:16:54 2012 (r34772) @@ -97,10 +97,10 @@ void guiInit(void) gtkInit(); - // initialize X + /* initialize X */ wsXInit(mDisplay); - // load skin + /* load skin */ skinDirInHome = get_path("skins"); skinMPlayerDir = MPLAYER_DATADIR "/skins"; @@ -130,7 +130,7 @@ void guiInit(void) mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); } - // initialize windows + /* initialize windows */ mainDrawBuffer = malloc(guiApp.main.Bitmap.ImageSize); @@ -445,7 +445,7 @@ int gui(int what, void *data) break; } - // video opts + /* video opts */ if (!video_driver_list) { int i = 0; @@ -486,7 +486,7 @@ int gui(int what, void *data) if (gtkVfPP) add_vf("pp"); - // audio opts + /* audio opts */ // if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; } if (gtkAONorm) @@ -555,7 +555,7 @@ int gui(int what, void *data) } } - // subtitle + /* subtitle */ // subdata->filename=gstrdup( guiInfo.SubtitleFilename ); stream_dump_type = 0; @@ -569,7 +569,7 @@ int gui(int what, void *data) gtkSubDumpMPSub = gtkSubDumpSrt = 0; mplayerLoadFont(); - // misc + /* misc */ if (gtkCacheOn) stream_cache_size = gtkCacheSize; @@ -641,7 +641,7 @@ int gui(int what, void *data) case GUI_SET_VIDEO: - // video + /* video */ guiInfo.sh_video = data; @@ -875,7 +875,7 @@ int guiPlaylistInitialize(play_tree_t *m if ((my_pt_iter = pt_iter_create(&my_playtree, config))) { while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL) - // add it to end of list + /* add it to end of list */ if (import_file_into_gui(filename, 0)) result = 1; } @@ -904,7 +904,7 @@ int guiPlaylistAdd(play_tree_t *my_playt if ((my_pt_iter = pt_iter_create(&my_playtree, config))) { while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL) - // insert it into the list and set plCurrent=new item + /* insert it into the list and set plCurrent=new item */ if (import_file_into_gui(filename, 1)) result = 1; @@ -931,7 +931,7 @@ void mplayer(int what, float value, void equalizer_t *eq = (equalizer_t *)data; switch (what) { - // subtitle + /* subtitle */ case MPLAYER_SET_FONT_FACTOR: font_factor = value; @@ -997,7 +997,7 @@ void mplayer(int what, float value, void auto_quality = (int)value; break; - // set equalizers + /* set equalizers */ case MPLAYER_SET_CONTRAST: if (guiInfo.sh_video) Modified: trunk/gui/ui/actions.c ============================================================================== --- trunk/gui/ui/actions.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/ui/actions.c Fri Feb 24 18:16:54 2012 (r34772) @@ -135,7 +135,7 @@ void uiChangeSkin(char *name) } } - // reload menu window + /* reload menu window */ if (prev && guiApp.menuIsPresent) { free(menuDrawBuffer); @@ -153,7 +153,7 @@ void uiChangeSkin(char *name) } else uiMenuInit(); - // reload sub window + /* reload sub window */ if (guiApp.sub.Bitmap.Image) wsResizeImage(&guiApp.subWindow, guiApp.sub.Bitmap.Width, guiApp.sub.Bitmap.Height); @@ -173,14 +173,14 @@ void uiChangeSkin(char *name) wsPostRedisplay(&guiApp.subWindow); } - // reload playbar + /* reload playbar */ if (bprev) wsDestroyWindow(&guiApp.playbarWindow); uiPlaybarInit(); - // reload main window + /* reload main window */ free(mainDrawBuffer); mainDrawBuffer = calloc(1, guiApp.main.Bitmap.ImageSize); Modified: trunk/gui/ui/gtk/equalizer.c ============================================================================== --- trunk/gui/ui/gtk/equalizer.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/ui/gtk/equalizer.c Fri Feb 24 18:16:54 2012 (r34772) @@ -501,7 +501,7 @@ GtkWidget * create_Equalizer( void ) return Equalizer; } -// --- equalizer config dialog box +/* equalizer config dialog box */ static GtkWidget * CBChannel1; static GtkWidget * CEChannel1; Modified: trunk/gui/ui/gtk/fileselect.c ============================================================================== --- trunk/gui/ui/gtk/fileselect.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/ui/gtk/fileselect.c Fri Feb 24 18:16:54 2012 (r34772) @@ -396,7 +396,7 @@ static void fs_PersistantHistory( char * for ( i=FF_ARRAY_ELEMS(fsHistory) - 1;i;i-- ) fsHistory[i]=fsHistory[i - 1]; fsHistory[0]=gstrdup( subject ); } -//----------------------------------------------- +/* ----------------------------------------------- */ static void fs_fsFilterCombo_activate( GtkEntry * entry, gpointer user_data ) Modified: trunk/gui/ui/gtk/preferences.c ============================================================================== --- trunk/gui/ui/gtk/preferences.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/ui/gtk/preferences.c Fri Feb 24 18:16:54 2012 (r34772) @@ -51,7 +51,7 @@ #include "fileselect.h" #include "tools.h" -// for mpcodecs_[av]d_drivers: +/* for mpcodecs_[av]d_drivers: */ #include "libmpcodecs/vd.h" #include "libmpcodecs/ad.h" @@ -201,7 +201,7 @@ void ShowPreferences( void ) if ( Preferences ) gtkActive( Preferences ); else Preferences=create_Preferences(); -// -- 1. page +/* 1st page */ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAudioEqualizer ),gtkEnableAudioEqualizer ); #if 0 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSurround ),gtkAOSurround ); @@ -242,7 +242,7 @@ void ShowPreferences( void ) } } -// -- 2. page +/* 2nd page */ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ),vo_doublebuffering ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDR ),vo_directrendering ); @@ -280,7 +280,7 @@ void ShowPreferences( void ) gtk_adjustment_set_value( HSFPSadj,force_fps ); -// -- 3. page +/* 3rd page */ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSubOverlap ),suboverlap_enabled ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ),!sub_auto ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDumpMPSub ),gtkSubDumpMPSub ); @@ -324,8 +324,8 @@ void ShowPreferences( void ) } #endif -// --- 4. page - // font ... +/* 4th page */ + /* font ... */ if ( font_name ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name ); #ifndef CONFIG_FREETYPE gtk_adjustment_set_value( HSFontFactoradj,font_factor ); @@ -350,7 +350,7 @@ void ShowPreferences( void ) } #endif -// -- 5. page +/* 5th page */ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ),force_ni ); if ( index_mode == 1 ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBIndex ),1 ); { @@ -385,7 +385,7 @@ void ShowPreferences( void ) if ( name ) gtk_entry_set_text( GTK_ENTRY( EAFM ),name ); } -// --- 6. page +/* 6th page */ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVfPP ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ),gtkLoadFullscreen ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSaveWinPos ),gui_save_pos ); @@ -416,7 +416,7 @@ void ShowPreferences( void ) if ( cdrom_device ) gtk_entry_set_text( GTK_ENTRY( prECDRomDevice ),cdrom_device ); else gtk_entry_set_text( GTK_ENTRY( prECDRomDevice ),DEFAULT_CDROM_DEVICE ); -// -- disables +/* disables */ #ifndef CONFIG_ASS gtk_widget_set_sensitive( CBUseASS,FALSE ); gtk_widget_set_sensitive( CBASSUseMargins,FALSE ); @@ -424,7 +424,7 @@ void ShowPreferences( void ) gtk_widget_set_sensitive( SBASSBottomMargin,FALSE ); #endif -// -- signals +/* signals */ gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 ); gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 ); gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 ); @@ -529,7 +529,7 @@ static void prButton( GtkButton * button switch ( (int)user_data ) { case bOk: - // -- 1. page + /* 1st page */ gtkEnableAudioEqualizer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAudioEqualizer ) ); gtkAOExtraStereo=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBExtraStereo ) ); gtkAONorm=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNormalize ) ); @@ -540,7 +540,7 @@ static void prButton( GtkButton * button listSet( &audio_driver_list,ao_driver[0] ); listSet( &video_driver_list,vo_driver[0] ); - // -- 2. page + /* 2nd page */ vo_doublebuffering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) ); vo_directrendering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDR ) ); @@ -553,7 +553,7 @@ static void prButton( GtkButton * button force_fps=HSFPSadj->value; - // -- 3. page + /* 3rd page */ suboverlap_enabled=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSubOverlap ) ); sub_auto=!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ) ); gtkSubDumpMPSub=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDumpMPSub ) ); @@ -574,7 +574,7 @@ static void prButton( GtkButton * button if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDTPTT ) ) ) osd_level=3; - // --- 4. page + /* 4th page */ setdup( &font_name,gtk_entry_get_text( GTK_ENTRY( prEFontName ) ) ); #ifndef CONFIG_FREETYPE mplayer( MPLAYER_SET_FONT_FACTOR,HSFontFactoradj->value,0 ); @@ -589,7 +589,7 @@ static void prButton( GtkButton * button if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleDiagonal ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,3,0 ); #endif - // -- 5. page + /* -- 5th page */ force_ni=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ) ); index_mode=-1; if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBIndex ) ) ) index_mode=1; @@ -610,7 +610,7 @@ static void prButton( GtkButton * button { listSet( &audio_fm_list,(char *)mpcodecs_ad_drivers[i]->info->short_name ); break; } } - // --- 6. page + /* 6th page */ gtkVfPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) ); gtkLoadFullscreen=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ) ); gui_save_pos=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSaveWinPos ) ); @@ -857,7 +857,7 @@ GtkWidget * create_Preferences( void ) frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,1 ); frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); -// --- 1. page +/* 1st page */ vbox2=AddVBox( frame,0 ); @@ -910,7 +910,7 @@ GtkWidget * create_Preferences( void ) label=AddLabel( MSGTR_PREFERENCES_Audio,NULL ); gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),0 ),label ); -// --- 2. page +/* 2nd page */ hbox2=AddVBox( notebook1,0 ); @@ -975,7 +975,7 @@ GtkWidget * create_Preferences( void ) label=AddLabel( MSGTR_PREFERENCES_Video,NULL ); gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),1 ),label ); -// --- 3. page +/* 3rd page */ vbox6=AddVBox( notebook1,0 ); @@ -1094,7 +1094,7 @@ GtkWidget * create_Preferences( void ) gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),2 ),label ); vbox601=AddVBox( notebook1,0 ); -// --- 4. page +/* 4th page */ vbox603=AddVBox( AddFrame( NULL,GTK_SHADOW_NONE, @@ -1178,7 +1178,7 @@ GtkWidget * create_Preferences( void ) label=AddLabel( MSGTR_PREFERENCES_FRAME_Font,NULL ); gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),3 ),label ); -// --- 5. page +/* 5th page */ vbox601=AddVBox( notebook1,0 ); @@ -1222,7 +1222,7 @@ GtkWidget * create_Preferences( void ) vbox601=AddVBox( notebook1,0 ); -// --- 6. page +/* 6th page */ vbox602=AddVBox( AddFrame( NULL,GTK_SHADOW_NONE, @@ -1300,7 +1300,7 @@ GtkWidget * create_Preferences( void ) label=AddLabel( MSGTR_PREFERENCES_Misc,NULL ); gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),5 ),label ); -// --- +/* --- */ AddHSeparator( vbox1 ); @@ -1370,7 +1370,7 @@ GtkWidget * create_Preferences( void ) #ifdef CONFIG_OSS_AUDIO static GList *appendOSSDevices(GList *l) { - // careful! the current implementation allows only string constants! + /* careful! the current implementation allows only string constants! */ l = g_list_append(l, (gpointer)"/dev/dsp"); if (gtkAOOSSDevice && strncmp(gtkAOOSSDevice, "/dev/sound", 10) == 0) { l = g_list_append(l, (gpointer)"/dev/sound/dsp0"); @@ -1395,7 +1395,7 @@ static GList *appendOSSDevices(GList *l) static GList *appendOSSMixers(GList *l) { - // careful! the current implementation allows only string constants! + /* careful! the current implementation allows only string constants! */ l = g_list_append(l, (gpointer)"/dev/mixer"); if (gtkAOOSSMixer && strncmp(gtkAOOSSMixer, "/dev/sound", 10) == 0) { l = g_list_append(l, (gpointer)"/dev/sound/mixer0"); @@ -1706,7 +1706,7 @@ GtkWidget *create_AudioConfig( void ) { return AudioConfig; } -// --- dxr3 config box +/* dxr3 config box */ static GtkWidget * DXR3Config; static GtkWidget * CBDevice; Modified: trunk/gui/ui/main.c ============================================================================== --- trunk/gui/ui/main.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/ui/main.c Fri Feb 24 18:16:54 2012 (r34772) @@ -135,7 +135,7 @@ void uiEventHandling( int msg,float para switch( msg ) { -// --- user events +/* user events */ case evExit: mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 ); break; @@ -406,7 +406,7 @@ set_volume: guiInfo.NewPlay=GUI_FILE_NEW; break; -// --- timer events +/* timer events */ case ivRedraw: { unsigned now = GetTimerMS(); @@ -420,7 +420,7 @@ set_volume: wsPostRedisplay( &guiApp.mainWindow ); wsPostRedisplay( &guiApp.playbarWindow ); break; -// --- system events +/* system events */ case evNone: mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] uiEventHandling: evNone\n" ); break; @@ -507,7 +507,7 @@ void uiMainMouseHandle( int Button,int X gtkShow( ivShowPopUpMenu,NULL ); break; -// --- rolled mouse ... de szar :))) +/* rolled mouse ... de szar :))) */ case wsP5MouseButton: value=-2.5f; goto rollerhandled; case wsP4MouseButton: value= 2.5f; rollerhandled: @@ -520,7 +520,7 @@ rollerhandled: } break; -// --- moving +/* moving */ case wsMoveMouse: item=&guiApp.mainItems[SelectedItem]; switch ( itemtype ) Modified: trunk/gui/ui/menu.c ============================================================================== --- trunk/gui/ui/menu.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/ui/menu.c Fri Feb 24 18:16:54 2012 (r34772) @@ -48,7 +48,7 @@ static void uiMenuDraw( void ) if ( menuRender || menuItem != oldMenuItem ) { memcpy( menuDrawBuffer,guiApp.menu.Bitmap.Image,guiApp.menu.Bitmap.ImageSize ); -// --- +/* --- */ if ( menuItem != -1 ) { buf=(uint32_t *)menuDrawBuffer; @@ -61,7 +61,7 @@ static void uiMenuDraw( void ) } } oldMenuItem=menuItem; -// --- +/* --- */ wsConvert( &guiApp.menuWindow,menuDrawBuffer ); menuRender=0; } Modified: trunk/gui/ui/playbar.c ============================================================================== --- trunk/gui/ui/playbar.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/ui/playbar.c Fri Feb 24 18:16:54 2012 (r34772) @@ -99,7 +99,7 @@ static void uiPlaybarDraw( void ) break; } -// --- render +/* render */ if ( guiApp.playbarWindow.State == wsWindowExpose ) { btnModify( evSetMoviePosition,guiInfo.Position ); @@ -141,7 +141,7 @@ static void uiPlaybarMouseHandle( int Bu case wsRRMouseButton: gtkShow( ivShowPopUpMenu,NULL ); break; -// --- +/* --- */ case wsPLMouseButton: gtkShow( ivHidePopUpMenu,NULL ); SelectedItem=currentselected; @@ -189,7 +189,7 @@ static void uiPlaybarMouseHandle( int Bu itemtype=0; break; -// --- +/* --- */ case wsP5MouseButton: value=-2.5f; goto rollerhandled; case wsP4MouseButton: value= 2.5f; rollerhandled: @@ -201,7 +201,7 @@ rollerhandled: uiEventHandling( item->message,item->value ); } break; -// --- +/* --- */ case wsMoveMouse: item=&guiApp.playbarItems[SelectedItem]; switch ( itemtype ) Modified: trunk/gui/ui/sub.c ============================================================================== --- trunk/gui/ui/sub.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/ui/sub.c Fri Feb 24 18:16:54 2012 (r34772) @@ -73,7 +73,7 @@ void uiSubMouseHandle( int Button,int X, uiHideMenu( RX,RY,1 ); msButton=0; break; -// --- +/* --- */ case wsPLMouseButton: gtkShow( ivHidePopUpMenu,NULL ); sx=X; sy=Y; Modified: trunk/gui/ui/widgets.c ============================================================================== --- trunk/gui/ui/widgets.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/ui/widgets.c Fri Feb 24 18:16:54 2012 (r34772) @@ -69,7 +69,7 @@ static const char gui_icon_name[] = "mpl #define THRESHOLD 128 // transparency values equal to or above this will become // opaque, all values below this will become transparent -// --- init & close gtk +/* init & close gtk */ guiIcon_t guiIcon; @@ -107,7 +107,7 @@ static void gtkLoadIcon(GtkIconTheme *th } else mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_ICONERROR, gui_icon_name, size); - // start up GTK which realizes the pixmaps + /* start up GTK which realizes the pixmaps */ gtk_main_iteration_do(FALSE); } @@ -190,7 +190,7 @@ void gtkEventHandling(void) gtk_main_iteration_do(0); } -// --- funcs +/* funcs */ void gtkMessageBox(int type, const gchar *str) { Modified: trunk/gui/util/bitmap.c ============================================================================== --- trunk/gui/util/bitmap.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/util/bitmap.c Fri Feb 24 18:16:54 2012 (r34772) @@ -94,7 +94,7 @@ static int pngRead(const char *fname, gu av_init_packet(&pkt); pkt.data = data; pkt.size = len; - // HACK: make PNGs decode normally instead of as CorePNG delta frames + /* HACK: Make PNGs decode normally instead of as CorePNG delta frames. */ pkt.flags = AV_PKT_FLAG_KEY; avcodec_decode_video2(avctx, frame, &decode_ok, &pkt); Modified: trunk/gui/util/bitmap.h ============================================================================== --- trunk/gui/util/bitmap.h Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/util/bitmap.h Fri Feb 24 18:16:54 2012 (r34772) @@ -26,7 +26,7 @@ #define GUI_TRANSPARENT 0xffff00ff #define ALPHA_OPAQUE 0xff000000 -// for legacy reasons, we must treat all kind of fuchsia/magenta as transparent +/* for legacy reasons, we must treat all kind of fuchsia/magenta as transparent */ #define IS_TRANSPARENT(c) ((ALPHA_OPAQUE | (c)) == GUI_TRANSPARENT) typedef struct { Modified: trunk/gui/util/list.c ============================================================================== --- trunk/gui/util/list.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/util/list.c Fri Feb 24 18:16:54 2012 (r34772) @@ -49,7 +49,7 @@ void *listMgr(int cmd, void *data) urlItem *udat = (urlItem *)data; switch (cmd) { - // playlist + /* playlist */ case PLAYLIST_GET: @@ -154,7 +154,7 @@ void *listMgr(int cmd, void *data) plCurrent = NULL; return NULL; - // url list + /* URL list */ case URLLIST_GET: Modified: trunk/gui/win32/gui.c ============================================================================== --- trunk/gui/win32/gui.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/win32/gui.c Fri Feb 24 18:16:54 2012 (r34772) @@ -48,7 +48,7 @@ #include "dialogs.h" #include "version.h" -// HACK around bug in old mingw +/* HACK around bug in old mingw */ #undef INVALID_FILE_ATTRIBUTES #define INVALID_FILE_ATTRIBUTES ((DWORD)-1) Modified: trunk/gui/win32/skinload.h ============================================================================== --- trunk/gui/win32/skinload.h Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/win32/skinload.h Fri Feb 24 18:16:54 2012 (r34772) @@ -112,7 +112,7 @@ struct skin_t skin_t *loadskin(char *skindir, int desktopbpp); -// --- Widget types --- +/* --- Widget types --- */ #define tyBase 1 #define tyButton 2 @@ -123,14 +123,14 @@ skin_t *loadskin(char *skindir, int desk #define tySlabel 7 #define tyDlabel 8 -// --- Window types --- +/* --- Window types --- */ #define wiMain 1 #define wiSub 2 #define wiMenu 3 #define wiPlaybar 4 -// --- User events ------ +/* --- User events --- */ #define evNone 0 #define evPlay 1 @@ -180,7 +180,7 @@ skin_t *loadskin(char *skindir, int desk #define evIconify 11 #define evExit 1000 -// --- Internal events --- +/* --- Internal events --- */ #define ivSetAudio 45 #define ivSetVideo 46 Modified: trunk/gui/wm/ws.c ============================================================================== --- trunk/gui/wm/ws.c Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/wm/ws.c Fri Feb 24 18:16:54 2012 (r34772) @@ -121,7 +121,7 @@ static int wsSearch(Window win) return -1; } -// --- +/* --- */ #define PACK_RGB16(r, g, b, pixel) pixel = (b >> 3); \ pixel <<= 6; \ @@ -138,7 +138,7 @@ static int wsSearch(Window win) struct SwsContext *sws_ctx = NULL; enum PixelFormat out_pix_fmt = PIX_FMT_NONE; -// --- +/* --- */ #define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_DECORATIONS (1L << 1) @@ -452,9 +452,9 @@ void wsCreateWindow(wsTWindow *win, int win->OldWidth = win->Width; win->OldHeight = win->Height; -// Border size for window. +/* Border size for window. */ win->BorderWidth = bW; -// Hide Mouse Cursor +/* Hide Mouse Cursor */ win->wsCursor = None; win->wsMouseEventType = cV; win->wsCursorData[0] = 0; @@ -472,7 +472,7 @@ void wsCreateWindow(wsTWindow *win, int XMatchVisualInfo(wsDisplay, wsScreen, depth, TrueColor, &win->VisualInfo); -// --- +/* --- */ win->AtomLeaderClient = XInternAtom(wsDisplay, "WM_CLIENT_LEADER", False); win->AtomDeleteWindow = XInternAtom(wsDisplay, "WM_DELETE_WINDOW", False); win->AtomTakeFocus = XInternAtom(wsDisplay, "WM_TAKE_FOCUS", False); @@ -483,7 +483,7 @@ void wsCreateWindow(wsTWindow *win, int win->AtomsProtocols[0] = win->AtomDeleteWindow; win->AtomsProtocols[1] = win->AtomTakeFocus; win->AtomsProtocols[2] = win->AtomRolle; -// --- +/* --- */ win->WindowAttrib.background_pixel = BlackPixel(wsDisplay, wsScreen); win->WindowAttrib.border_pixel = WhitePixel(wsDisplay, wsScreen); @@ -582,7 +582,7 @@ void wsCreateWindow(wsTWindow *win, int XMapWindow(wsDisplay, win->WindowID); wsCreateImage(win, win->Width, win->Height); -// --- End of creating -------------------------------------------------------------------------- +/* End of creating -------------------------------------------------------------------------- */ { int i; @@ -904,7 +904,7 @@ buttonreleased: void wsHandleEvents(void) { - // handle pending events + /* handle pending events */ while (XPending(wsDisplay)) { XNextEvent(wsDisplay, &wsEvent); // printf("### X event: %d [%d]\n",wsEvent.type,delay); @@ -922,7 +922,7 @@ void wsMainLoop(void) // XIfEvent( wsDisplay,&wsEvent,wsEvents ); while (wsTrue) { - // handle pending events + /* handle pending events */ while (XPending(wsDisplay)) { XNextEvent(wsDisplay, &wsEvent); wsEvents(wsDisplay, &wsEvent); Modified: trunk/gui/wm/ws.h ============================================================================== --- trunk/gui/wm/ws.h Thu Feb 23 14:48:58 2012 (r34771) +++ trunk/gui/wm/ws.h Fri Feb 24 18:16:54 2012 (r34772) @@ -148,7 +148,7 @@ typedef struct { int Control; int NumLock; int CapsLock; -// --- Misc ------------------------------------------------------------------------------------- +/* Misc ------------------------------------------------------------------------------------- */ Atom AtomDeleteWindow; Atom AtomTakeFocus; From subversion at mplayerhq.hu Fri Feb 24 18:26:35 2012 From: subversion at mplayerhq.hu (ib) Date: Fri, 24 Feb 2012 18:26:35 +0100 (CET) Subject: [MPlayer-cvslog] r34773 - in trunk/gui: ui/gtk/preferences.c util/string.c util/string.h Message-ID: <20120224172635.796E6143D8B@avserver.banki.hu> Author: ib Date: Fri Feb 24 18:26:35 2012 New Revision: 34773 Log: Remove gstrcasecmp(). This function isn't necessary. strcasecmp() can be used just as well, because both arguments to the gstrcasecmp() calls have been checked to be not NULL prior to the call. Modified: trunk/gui/ui/gtk/preferences.c trunk/gui/util/string.c trunk/gui/util/string.h Modified: trunk/gui/ui/gtk/preferences.c ============================================================================== --- trunk/gui/ui/gtk/preferences.c Fri Feb 24 18:16:54 2012 (r34772) +++ trunk/gui/ui/gtk/preferences.c Fri Feb 24 18:26:35 2012 (r34773) @@ -319,7 +319,7 @@ void ShowPreferences( void ) { int i; for ( i=0;lEncoding[i].name;i++ ) - if ( !gstrcasecmp( sub_cp,lEncoding[i].name ) ) break; + if ( !strcasecmp( sub_cp,lEncoding[i].name ) ) break; if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),lEncoding[i].comment ); } #endif @@ -338,7 +338,7 @@ void ShowPreferences( void ) { int i; for ( i=0;lEncoding[i].name;i++ ) - if ( !gstrcasecmp( subtitle_font_encoding,lEncoding[i].name ) ) break; + if ( !strcasecmp( subtitle_font_encoding,lEncoding[i].name ) ) break; if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),lEncoding[i].comment ); } switch ( subtitle_autoscale ) Modified: trunk/gui/util/string.c ============================================================================== --- trunk/gui/util/string.c Fri Feb 24 18:16:54 2012 (r34772) +++ trunk/gui/util/string.c Fri Feb 24 18:26:35 2012 (r34773) @@ -163,16 +163,6 @@ int gstrcmp(const char *a, const char *b return strcmp(a, b); } -int gstrcasecmp(const char *a, const char *b) -{ - if (!a && !b) - return 0; - if (!a || !b) - return -1; - - return strcasecmp(a, b); -} - /** * @brief A strncmp() that can handle NULL pointers. * Modified: trunk/gui/util/string.h ============================================================================== --- trunk/gui/util/string.h Fri Feb 24 18:16:54 2012 (r34772) +++ trunk/gui/util/string.h Fri Feb 24 18:26:35 2012 (r34773) @@ -23,7 +23,6 @@ char *decomment(char *in); char *fgetstr(char *str, int size, FILE *file); -int gstrcasecmp(const char *a, const char *b); char *gstrchr(const char *str, int c); int gstrcmp(const char *a, const char *b); char *gstrdup(const char *str); From subversion at mplayerhq.hu Fri Feb 24 21:19:47 2012 From: subversion at mplayerhq.hu (cigaes) Date: Fri, 24 Feb 2012 21:19:47 +0100 (CET) Subject: [MPlayer-cvslog] r34774 - in trunk: DOCS/man/en/mplayer.1 cfg-mplayer.h etc/example.conf mplayer.h sub/sub.c Message-ID: <20120224201947.56FCD143E98@avserver.banki.hu> Author: cigaes Date: Fri Feb 24 21:19:46 2012 New Revision: 34774 Log: Allow to set the OST progress position. Patch by Changyu Li, ironyman13 at gmail. Modified: trunk/cfg-mplayer.h trunk/etc/example.conf trunk/mplayer.h trunk/sub/sub.c Changes in other areas also in this revision: Modified: trunk/DOCS/man/en/mplayer.1 Modified: trunk/cfg-mplayer.h ============================================================================== --- trunk/cfg-mplayer.h Fri Feb 24 18:26:35 2012 (r34773) +++ trunk/cfg-mplayer.h Fri Feb 24 21:19:46 2012 (r34774) @@ -351,6 +351,7 @@ const m_option_t mplayer_opts[]={ {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, {"vd", vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + {"progbar-align", &progbar_align, CONF_TYPE_INT, CONF_GLOBAL, 0, 100, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; Modified: trunk/etc/example.conf ============================================================================== --- trunk/etc/example.conf Fri Feb 24 18:26:35 2012 (r34773) +++ trunk/etc/example.conf Fri Feb 24 21:19:46 2012 (r34774) @@ -160,6 +160,8 @@ #vf-clr=yes +# OSD progress bar vertical alignment +#progbar-align=50 # You can also include other configuration files. #include = /path/to/the/file/you/want/to/include Modified: trunk/mplayer.h ============================================================================== --- trunk/mplayer.h Fri Feb 24 18:26:35 2012 (r34773) +++ trunk/mplayer.h Fri Feb 24 21:19:46 2012 (r34774) @@ -36,6 +36,7 @@ extern int use_menu; extern float audio_delay; extern double start_pts; +extern int progbar_align; /* for the GUI */ extern int auto_quality; Modified: trunk/sub/sub.c ============================================================================== --- trunk/sub/sub.c Fri Feb 24 18:26:35 2012 (r34773) +++ trunk/sub/sub.c Fri Feb 24 21:19:46 2012 (r34774) @@ -528,6 +528,7 @@ TODO: support for separated graphics sym int vo_osd_progbar_type=-1; int vo_osd_progbar_value=100; // 0..256 +int progbar_align=50; // if we have n=256 bars then OSD progbar looks like below // @@ -555,7 +556,7 @@ static inline void vo_update_text_progba // calculate bbox corners: { int h=0; - int y=(dys-vo_font->height)/2; + int y=((dys-vo_font->height)*progbar_align)/100; int delimw=vo_font->width[OSD_PB_START] +vo_font->width[OSD_PB_END] +vo_font->charspace; From subversion at mplayerhq.hu Sat Feb 25 19:26:31 2012 From: subversion at mplayerhq.hu (reimar) Date: Sat, 25 Feb 2012 19:26:31 +0100 (CET) Subject: [MPlayer-cvslog] r34777 - trunk/libmpdemux/demuxer.c Message-ID: <20120225182631.A6865144648@avserver.banki.hu> Author: reimar Date: Sat Feb 25 19:26:31 2012 New Revision: 34777 Log: Fix DVDs showing the subtitle language as "unknown" for a long time. Modified: trunk/libmpdemux/demuxer.c Modified: trunk/libmpdemux/demuxer.c ============================================================================== --- trunk/libmpdemux/demuxer.c Sat Feb 25 00:34:55 2012 (r34776) +++ trunk/libmpdemux/demuxer.c Sat Feb 25 19:26:31 2012 (r34777) @@ -1815,14 +1815,14 @@ int demuxer_sub_lang(demuxer_t *d, int i if (id < 0 || id >= MAX_S_STREAMS) return -1; sh = d->s_streams[id]; - if (!sh) - return -1; - if (sh->lang) { + if (sh && sh->lang) { av_strlcpy(buf, sh->lang, buf_len); return 0; } req.type = stream_ctrl_sub; - req.id = sh->sid; + // assume 1:1 mapping so we can show the language of + // DVD subs even when we have not yet created the stream. + req.id = sh ? sh->sid : id; if (stream_control(d->stream, STREAM_CTRL_GET_LANG, &req) == STREAM_OK) { av_strlcpy(buf, req.buf, buf_len); return 0; From diego at biurrun.de Sun Feb 26 15:16:12 2012 From: diego at biurrun.de (Diego Biurrun) Date: Sun, 26 Feb 2012 15:16:12 +0100 Subject: [MPlayer-cvslog] r34774 - in trunk: DOCS/man/en/mplayer.1 cfg-mplayer.h etc/example.conf mplayer.h sub/sub.c In-Reply-To: <20120224201947.56FCD143E98@avserver.banki.hu> References: <20120224201947.56FCD143E98@avserver.banki.hu> Message-ID: <20120226141611.GA14766@pool.informatik.rwth-aachen.de> On Fri, Feb 24, 2012 at 09:19:47PM +0100, cigaes wrote: > > Log: > Allow to set the OST progress position. OSD Diego From subversion at mplayerhq.hu Mon Feb 27 09:53:45 2012 From: subversion at mplayerhq.hu (cigaes) Date: Mon, 27 Feb 2012 09:53:45 +0100 (CET) Subject: [MPlayer-cvslog] [propchange]: r34774 - svn:log Message-ID: <20120227085345.B6030145112@avserver.banki.hu> Author: cigaes Revision: 34774 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1,3 +1,3 @@ -Allow to set the OST progress position. +Allow to set the OSD progress position. -Patch by Changyu Li, ironyman13 at gmail. \ No newline at end of file +Patch by Changyu Li, ironyman13 at gmail. From subversion at mplayerhq.hu Mon Feb 27 23:09:34 2012 From: subversion at mplayerhq.hu (ib) Date: Mon, 27 Feb 2012 23:09:34 +0100 (CET) Subject: [MPlayer-cvslog] r34778 - trunk/gui/ui/actions.c Message-ID: <20120227220934.B441B145500@avserver.banki.hu> Author: ib Date: Mon Feb 27 23:09:34 2012 New Revision: 34778 Log: Fix bug with playlist playback. When is pressed and you shift to another track and press , the track is played twice (before advancing to the next element in the list). Reported by drake ch, drake.ch hotmail com. When shifting to another track, set information that at the end of playback of the current track the next track to be played shall not be determined (!uiGotoTheNext) only if currently playing. That is because the track shifting function itself (which already has determined the next track to be played) will end the playback of the current track (and start the next one) only if currently playing. If not playing, the next track to be played after the end of playback of the current track (determined by the track shifting function) must be determined again (uiGotoTheNext). Modified: trunk/gui/ui/actions.c Modified: trunk/gui/ui/actions.c ============================================================================== --- trunk/gui/ui/actions.c Sat Feb 25 19:26:31 2012 (r34777) +++ trunk/gui/ui/actions.c Mon Feb 27 23:09:34 2012 (r34778) @@ -258,7 +258,7 @@ void uiCurr(void) if (curr) { uiSetFileName(curr->path, curr->name, STREAMTYPE_FILE); - uiGotoTheNext = 0; + uiGotoTheNext = (guiInfo.Playing ? 0 : 1); break; } @@ -314,7 +314,7 @@ void uiPrev(void) if (prev) { uiSetFileName(prev->path, prev->name, STREAMTYPE_FILE); - uiGotoTheNext = 0; + uiGotoTheNext = (guiInfo.Playing ? 0 : 1); guiInfo.Track--; break; } @@ -375,7 +375,7 @@ void uiNext(void) if (next) { uiSetFileName(next->path, next->name, STREAMTYPE_FILE); - uiGotoTheNext = 0; + uiGotoTheNext = (guiInfo.Playing ? 0 : 1); guiInfo.Track++; break; } From subversion at mplayerhq.hu Tue Feb 28 20:30:49 2012 From: subversion at mplayerhq.hu (reimar) Date: Tue, 28 Feb 2012 20:30:49 +0100 (CET) Subject: [MPlayer-cvslog] r34779 - in trunk/libmpcodecs: ve_lavc.c vf_lavc.c Message-ID: <20120228193049.4C2E8145B63@avserver.banki.hu> Author: reimar Date: Tue Feb 28 20:30:48 2012 New Revision: 34779 Log: Remove pointless casts. Modified: trunk/libmpcodecs/ve_lavc.c trunk/libmpcodecs/vf_lavc.c Modified: trunk/libmpcodecs/ve_lavc.c ============================================================================== --- trunk/libmpcodecs/ve_lavc.c Mon Feb 27 23:09:34 2012 (r34778) +++ trunk/libmpcodecs/ve_lavc.c Tue Feb 28 20:30:48 2012 (r34779) @@ -1018,7 +1018,7 @@ static int vf_open(vf_instance_t *vf, ch init_avcodec(); - vf->priv->codec = (AVCodec *)avcodec_find_encoder_by_name(lavc_param_vcodec); + vf->priv->codec = avcodec_find_encoder_by_name(lavc_param_vcodec); if (!vf->priv->codec) { mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_MissingLAVCcodec, lavc_param_vcodec); return 0; Modified: trunk/libmpcodecs/vf_lavc.c ============================================================================== --- trunk/libmpcodecs/vf_lavc.c Mon Feb 27 23:09:34 2012 (r34778) +++ trunk/libmpcodecs/vf_lavc.c Tue Feb 28 20:30:48 2012 (r34779) @@ -142,7 +142,7 @@ static int vf_open(vf_instance_t *vf, ch init_avcodec(); - vf->priv->codec = (AVCodec *)avcodec_find_encoder_by_name("mpeg1video"); + vf->priv->codec = avcodec_find_encoder_by_name("mpeg1video"); if (!vf->priv->codec) { mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_MissingLAVCcodec, "mpeg1video"); return 0; From subversion at mplayerhq.hu Tue Feb 28 20:31:56 2012 From: subversion at mplayerhq.hu (reimar) Date: Tue, 28 Feb 2012 20:31:56 +0100 (CET) Subject: [MPlayer-cvslog] r34780 - in trunk/libmpcodecs: ve_lavc.c vf_lavc.c Message-ID: <20120228193156.CACB9145B67@avserver.banki.hu> Author: reimar Date: Tue Feb 28 20:31:56 2012 New Revision: 34780 Log: Remove pointless check that used internals would fail always after the switch to encode2. Modified: trunk/libmpcodecs/ve_lavc.c trunk/libmpcodecs/vf_lavc.c Modified: trunk/libmpcodecs/ve_lavc.c ============================================================================== --- trunk/libmpcodecs/ve_lavc.c Tue Feb 28 20:30:48 2012 (r34779) +++ trunk/libmpcodecs/ve_lavc.c Tue Feb 28 20:31:56 2012 (r34780) @@ -679,11 +679,6 @@ static int config(struct vf_instance *vf } av_dict_free(&opts); - if (lavc_venc_context->codec->encode == NULL) { - mp_msg(MSGT_MENCODER,MSGL_ERR,"avcodec init failed (ctx->codec->encode == NULL)!\n"); - return 0; - } - /* free second pass buffer, its not needed anymore */ av_freep(&lavc_venc_context->stats_in); if(lavc_venc_context->bits_per_coded_sample) Modified: trunk/libmpcodecs/vf_lavc.c ============================================================================== --- trunk/libmpcodecs/vf_lavc.c Tue Feb 28 20:30:48 2012 (r34779) +++ trunk/libmpcodecs/vf_lavc.c Tue Feb 28 20:31:56 2012 (r34780) @@ -79,11 +79,6 @@ static int config(struct vf_instance *vf return 0; } - if (lavc_venc_context.codec->encode == NULL) { - mp_msg(MSGT_MENCODER,MSGL_ERR,"avcodec init failed (ctx->codec->encode == NULL)!\n"); - return 0; - } - return vf_next_config(vf,width,height,d_width,d_height,flags,IMGFMT_MPEGPES); }