summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-09 23:37:00 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-09 23:37:00 +0200
commit42bf12c2d3b2903a127f625dea0d3516a87debfa (patch)
tree7fe1a2c4a3c250d44b9ff2a8bdf3809104744eb9
parentfa34ea27b94cd870ec56de4ce215bf797054119f (diff)
parent3c514ea708749679623ae04fc8f7ade87e51aade (diff)
downloadmpv-42bf12c2d3b2903a127f625dea0d3516a87debfa.tar.bz2
mpv-42bf12c2d3b2903a127f625dea0d3516a87debfa.tar.xz
Merge svn changes up to r30595
Conflicts: mplayer.c vidix/nvidia_vid.c
-rw-r--r--etc/codecs.conf2
-rw-r--r--libmenu/menu.h2
-rw-r--r--libmpcodecs/ad_libdv.c4
-rw-r--r--libmpcodecs/ad_mp3lib.c1
-rw-r--r--libmpcodecs/ad_mp3lib.h24
-rw-r--r--libmpcodecs/vd_libdv.c1
-rw-r--r--libmpcodecs/vd_libdv.h26
-rw-r--r--libmpcodecs/vd_theora.c27
-rw-r--r--libmpdemux/aac_hdr.c5
-rw-r--r--libmpdemux/demux_avi.c5
-rw-r--r--libmpdemux/demuxer.h8
-rw-r--r--libvo/font_load_ft.c26
-rw-r--r--loader/wine/mmreg.h26
-rw-r--r--loader/wine/pe_image.h26
-rw-r--r--mp3lib/sr1.c4
-rw-r--r--mplayer.c1
-rw-r--r--vidix/drivers.c1
-rw-r--r--vidix/nvidia_vid.c6
-rw-r--r--vidix/sis_bridge.c1
-rw-r--r--vidix/sis_bridge.h26
-rw-r--r--vidix/sis_vid.c4
-rw-r--r--vidix/vidix.c2
22 files changed, 146 insertions, 82 deletions
diff --git a/etc/codecs.conf b/etc/codecs.conf
index c3f2c6987b..85a212b027 100644
--- a/etc/codecs.conf
+++ b/etc/codecs.conf
@@ -583,7 +583,7 @@ videocodec theora
fourcc theo,Thra
driver theora
dll libtheora
- out YV12
+ out YV12,422P,444P
; prefer native codecs over win32?
; the win32 codecs probably are (better) optimized and support direct
diff --git a/libmenu/menu.h b/libmenu/menu.h
index cc76b5b7a3..bfb8f9a30b 100644
--- a/libmenu/menu.h
+++ b/libmenu/menu.h
@@ -116,4 +116,6 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt,
void menu_draw_box(mp_image_t* mpi, unsigned char grey, unsigned char alpha, int x, int y, int w, int h);
+void vf_menu_pause_update(struct vf_instance *vf);
+
#endif /* MPLAYER_MENU_H */
diff --git a/libmpcodecs/ad_libdv.c b/libmpcodecs/ad_libdv.c
index 384627462d..c4b30a747d 100644
--- a/libmpcodecs/ad_libdv.c
+++ b/libmpcodecs/ad_libdv.c
@@ -37,6 +37,7 @@
#include "libmpdemux/stheader.h"
#include "ad_internal.h"
+#include "vd_libdv.h"
static const ad_info_t info =
{
@@ -49,9 +50,6 @@ static const ad_info_t info =
LIBAD_EXTERN(libdv)
-// defined in vd_libdv.c:
-dv_decoder_t* init_global_rawdv_decoder(void);
-
static int preinit(sh_audio_t *sh_audio)
{
sh_audio->audio_out_minsize=4*DV_AUDIO_MAX_SAMPLES*2;
diff --git a/libmpcodecs/ad_mp3lib.c b/libmpcodecs/ad_mp3lib.c
index 5b50557c96..f262757526 100644
--- a/libmpcodecs/ad_mp3lib.c
+++ b/libmpcodecs/ad_mp3lib.c
@@ -23,6 +23,7 @@
#include "config.h"
#include "ad_internal.h"
+#include "ad_mp3lib.h"
static const ad_info_t info =
{
diff --git a/libmpcodecs/ad_mp3lib.h b/libmpcodecs/ad_mp3lib.h
new file mode 100644
index 0000000000..aeb78b4ed8
--- /dev/null
+++ b/libmpcodecs/ad_mp3lib.h
@@ -0,0 +1,24 @@
+/*
+ * 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_AD_MP3LIB_H
+#define MPLAYER_AD_MP3LIB_H
+
+int mplayer_audio_read(char *buf, int size);
+
+#endif /* MPLAYER_AD_MP3LIB_H */
diff --git a/libmpcodecs/vd_libdv.c b/libmpcodecs/vd_libdv.c
index 02d7e2fc54..137fa7bf60 100644
--- a/libmpcodecs/vd_libdv.c
+++ b/libmpcodecs/vd_libdv.c
@@ -35,6 +35,7 @@
#include "libmpdemux/stheader.h"
#include "vd_internal.h"
+#include "vd_libdv.h"
static const vd_info_t info =
{
diff --git a/libmpcodecs/vd_libdv.h b/libmpcodecs/vd_libdv.h
new file mode 100644
index 0000000000..608d06bf21
--- /dev/null
+++ b/libmpcodecs/vd_libdv.h
@@ -0,0 +1,26 @@
+/*
+ * 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_VD_LIBDV_H
+#define MPLAYER_VD_LIBDV_H
+
+#include <libdv/dv_types.h>
+
+dv_decoder_t* init_global_rawdv_decoder(void);
+
+#endif /* MPLAYER_VD_LIBDV_H */
diff --git a/libmpcodecs/vd_theora.c b/libmpcodecs/vd_theora.c
index 35e3edfab8..b8be6d747b 100644
--- a/libmpcodecs/vd_theora.c
+++ b/libmpcodecs/vd_theora.c
@@ -41,11 +41,28 @@ LIBVD_EXTERN(theora)
#define THEORA_NUM_HEADER_PACKETS 3
+typedef struct theora_struct_st {
+ theora_state st;
+ theora_comment cc;
+ theora_info inf;
+} theora_struct_t;
+
+/** Convert Theora pixelformat to the corresponding IMGFMT_ */
+static uint32_t theora_pixelformat2imgfmt(theora_pixelformat fmt){
+ switch(fmt) {
+ case OC_PF_420: return IMGFMT_YV12;
+ case OC_PF_422: return IMGFMT_422P;
+ case OC_PF_444: return IMGFMT_444P;
+ }
+ return 0;
+}
+
// to set/get/query special features/parameters
static int control(sh_video_t *sh,int cmd,void* arg,...){
+ theora_struct_t *context = sh->context;
switch(cmd) {
case VDCTRL_QUERY_FORMAT:
- if (*(int*)arg == IMGFMT_YV12)
+ if (*(int*)arg == theora_pixelformat2imgfmt(context->inf.pixelformat))
return CONTROL_TRUE;
return CONTROL_FALSE;
}
@@ -53,12 +70,6 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
return CONTROL_UNKNOWN;
}
-typedef struct theora_struct_st {
- theora_state st;
- theora_comment cc;
- theora_info inf;
-} theora_struct_t;
-
/*
* init driver
*/
@@ -104,7 +115,7 @@ static int init(sh_video_t *sh){
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Theora video init ok!\n");
- return mpcodecs_config_vo (sh,context->inf.frame_width,context->inf.frame_height,IMGFMT_YV12);
+ return mpcodecs_config_vo (sh,context->inf.frame_width,context->inf.frame_height,theora_pixelformat2imgfmt(context->inf.pixelformat));
err_out:
free(context);
diff --git a/libmpdemux/aac_hdr.c b/libmpdemux/aac_hdr.c
index e9c4f5dcc7..1866288349 100644
--- a/libmpdemux/aac_hdr.c
+++ b/libmpdemux/aac_hdr.c
@@ -18,10 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "config.h"
+#include <stdint.h>
/// \param srate (out) sample rate
/// \param num (out) number of audio frames in this ADTS frame
diff --git a/libmpdemux/demux_avi.c b/libmpdemux/demux_avi.c
index 12b04b3e01..e554606d14 100644
--- a/libmpdemux/demux_avi.c
+++ b/libmpdemux/demux_avi.c
@@ -539,14 +539,15 @@ static demuxer_t* demux_open_avi(demuxer_t* demuxer){
// calculating audio/video bitrate:
if(priv->idx_size>0){
// we have index, let's count 'em!
+ AVIINDEXENTRY *idx = priv->idx;
int64_t vsize=0;
int64_t asize=0;
size_t vsamples=0;
size_t asamples=0;
int i;
for(i=0;i<priv->idx_size;i++){
- int id=avi_stream_id(((AVIINDEXENTRY *)priv->idx)[i].ckid);
- int len=((AVIINDEXENTRY *)priv->idx)[i].dwChunkLength;
+ int id=avi_stream_id(idx[i].ckid);
+ unsigned len=idx[i].dwChunkLength;
if(sh_video->ds->id == id) {
vsize+=len;
++vsamples;
diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h
index 6aaa7c8b79..a5b67779ab 100644
--- a/libmpdemux/demuxer.h
+++ b/libmpdemux/demuxer.h
@@ -407,13 +407,9 @@ void ds_clear_parser(demux_stream_t *sh);
stream_t* new_ds_stream(demux_stream_t *ds);
static inline int avi_stream_id(unsigned int id){
- unsigned char *p=(unsigned char *)&id;
unsigned char a,b;
-#if HAVE_BIGENDIAN
- a=p[3]-'0'; b=p[2]-'0';
-#else
- a=p[0]-'0'; b=p[1]-'0';
-#endif
+ a = id - '0';
+ b = (id >> 8) - '0';
if(a>9 || b>9) return 100; // invalid ID
return a*10+b;
}
diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c
index 1ddd15d268..d7f6e85f7b 100644
--- a/libvo/font_load_ft.c
+++ b/libvo/font_load_ft.c
@@ -836,36 +836,18 @@ static int prepare_charset_unicode(FT_Face face, FT_ULong *charset, FT_ULong *ch
static font_desc_t* init_font_desc(void)
{
font_desc_t *desc;
- int i;
- desc = malloc(sizeof(font_desc_t));
+ desc = calloc(1, sizeof(*desc));
if(!desc) return NULL;
- memset(desc,0,sizeof(font_desc_t));
desc->dynamic = 1;
/* setup sane defaults */
- desc->name = NULL;
- desc->fpath = NULL;
-
- desc->face_cnt = 0;
- desc->charspace = 0;
- desc->spacewidth = 0;
- desc->height = 0;
- desc->max_width = 0;
- desc->max_height = 0;
desc->freetype = 1;
- desc->tables.g = NULL;
- desc->tables.gt2 = NULL;
- desc->tables.om = NULL;
- desc->tables.omt = NULL;
- desc->tables.tmp = NULL;
-
- for(i = 0; i < 65536; i++)
- desc->start[i] = desc->width[i] = desc->font[i] = -1;
- for(i = 0; i < 16; i++)
- desc->pic_a[i] = desc->pic_b[i] = NULL;
+ memset(desc->start, 0xff, sizeof(desc->start));
+ memset(desc->width, 0xff, sizeof(desc->width));
+ memset(desc->font, 0xff, sizeof(desc->font));
return desc;
}
diff --git a/loader/wine/mmreg.h b/loader/wine/mmreg.h
index 4ab6b7a2ff..2ed01a215e 100644
--- a/loader/wine/mmreg.h
+++ b/loader/wine/mmreg.h
@@ -89,19 +89,19 @@ typedef struct {
#ifndef _MPEGLAYER3WAVEFORMAT_
#define _MPEGLAYER3WAVEFORMAT_
-typedef struct mpeglayer3waveformat_tag {
- WORD wFormatTag WINE_PACKED;
- WORD nChannels WINE_PACKED;
- DWORD nSamplesPerSec WINE_PACKED;
- DWORD nAvgBytesPerSec WINE_PACKED;
- WORD nBlockAlign WINE_PACKED;
- WORD wBitsPerSample WINE_PACKED;
- WORD cbSize WINE_PACKED;
- WORD wID WINE_PACKED;
- DWORD fdwFlags WINE_PACKED;
- WORD nBlockSize WINE_PACKED;
- WORD nFramesPerBlock WINE_PACKED;
- WORD nCodecDelay WINE_PACKED;
+typedef struct WINE_PACKED mpeglayer3waveformat_tag {
+ WORD wFormatTag;
+ WORD nChannels;
+ DWORD nSamplesPerSec;
+ DWORD nAvgBytesPerSec;
+ WORD nBlockAlign;
+ WORD wBitsPerSample;
+ WORD cbSize;
+ WORD wID;
+ DWORD fdwFlags;
+ WORD nBlockSize;
+ WORD nFramesPerBlock;
+ WORD nCodecDelay;
} MPEGLAYER3WAVEFORMAT;
#endif /* !_MPEGLAYER3WAVEFORMAT_ */
diff --git a/loader/wine/pe_image.h b/loader/wine/pe_image.h
index 1c28bc12d0..aab6fd8cd3 100644
--- a/loader/wine/pe_image.h
+++ b/loader/wine/pe_image.h
@@ -54,19 +54,19 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY, LPCWSTR, DW
typedef DWORD CALLBACK (*DLLENTRYPROC)(HMODULE,DWORD,LPVOID);
-typedef struct {
- WORD popl WINE_PACKED; /* 0x8f 0x05 */
- DWORD addr_popped WINE_PACKED;/* ... */
- BYTE pushl1 WINE_PACKED; /* 0x68 */
- DWORD newret WINE_PACKED; /* ... */
- BYTE pushl2 WINE_PACKED; /* 0x68 */
- DWORD origfun WINE_PACKED; /* original function */
- BYTE ret1 WINE_PACKED; /* 0xc3 */
- WORD addesp WINE_PACKED; /* 0x83 0xc4 */
- BYTE nrofargs WINE_PACKED; /* nr of arguments to add esp, */
- BYTE pushl3 WINE_PACKED; /* 0x68 */
- DWORD oldret WINE_PACKED; /* Filled out from popl above */
- BYTE ret2 WINE_PACKED; /* 0xc3 */
+typedef struct WINE_PACKED {
+ WORD popl; /* 0x8f 0x05 */
+ DWORD addr_popped; /* ... */
+ BYTE pushl1; /* 0x68 */
+ DWORD newret; /* ... */
+ BYTE pushl2; /* 0x68 */
+ DWORD origfun; /* original function */
+ BYTE ret1; /* 0xc3 */
+ WORD addesp; /* 0x83 0xc4 */
+ BYTE nrofargs; /* nr of arguments to add esp, */
+ BYTE pushl3; /* 0x68 */
+ DWORD oldret; /* Filled out from popl above */
+ BYTE ret2; /* 0xc3 */
} ELF_STDCALL_STUB;
typedef struct {
diff --git a/mp3lib/sr1.c b/mp3lib/sr1.c
index fdbf19ba89..43afb6a674 100644
--- a/mp3lib/sr1.c
+++ b/mp3lib/sr1.c
@@ -20,7 +20,7 @@
#include "cpudetect.h"
//#include "liba52/mm_accel.h"
#include "mp_msg.h"
-
+#include "libmpcodecs/ad_mp3lib.h"
#include "libvo/fastmemcpy.h"
#include "libavutil/common.h"
@@ -51,8 +51,6 @@ static long outscale = 32768;
#include "tabinit.c"
#if 1
-int mplayer_audio_read(char *buf,int size);
-
LOCAL int mp3_read(char *buf,int size){
// int len=fread(buf,1,size,mp3_file);
int len=mplayer_audio_read(buf,size);
diff --git a/mplayer.c b/mplayer.c
index e158011bab..ad754e9f1c 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -374,7 +374,6 @@ char* current_module=NULL; // for debugging
#ifdef CONFIG_MENU
#include "m_struct.h"
#include "libmenu/menu.h"
-void vf_menu_pause_update(struct vf_instance* vf);
extern vf_info_t vf_info_menu;
static const vf_info_t* const libmenu_vfs[] = {
&vf_info_menu,
diff --git a/vidix/drivers.c b/vidix/drivers.c
index 559dee30e0..7968156662 100644
--- a/vidix/drivers.c
+++ b/vidix/drivers.c
@@ -27,6 +27,7 @@
#include "drivers.h"
#include "config.h"
#include "vidix.h"
+#include "drivers.h"
#include "libavutil/common.h"
#include "mpbswap.h"
#include "config.h"
diff --git a/vidix/nvidia_vid.c b/vidix/nvidia_vid.c
index 79f3880ebd..6c3786a815 100644
--- a/vidix/nvidia_vid.c
+++ b/vidix/nvidia_vid.c
@@ -441,12 +441,14 @@ struct rivatv_info {
};
typedef struct rivatv_info rivatv_info;
-static uint8_t nvReadVGA (struct rivatv_chip *chip, int index) {
+static uint8_t nvReadVGA(struct rivatv_chip *chip, int index)
+{
VID_WR08 (chip->PCIO, 0x3D4, index);
return VID_RD08 (chip->PCIO, 0x3D5);
}
-static void nvWriteVGA (struct rivatv_chip *chip, int index, int data) {
+static void nvWriteVGA(struct rivatv_chip *chip, int index, int data)
+{
VID_WR08 (chip->PCIO, 0x3D4, index);
VID_WR08 (chip->PCIO, 0x3D5, data);
}
diff --git a/vidix/sis_bridge.c b/vidix/sis_bridge.c
index f143754a9a..265bce5fd3 100644
--- a/vidix/sis_bridge.c
+++ b/vidix/sis_bridge.c
@@ -28,6 +28,7 @@
#include <unistd.h>
#include "dha.h"
+#include "sis_bridge.h"
#include "sis_regs.h"
#include "sis_defs.h"
diff --git a/vidix/sis_bridge.h b/vidix/sis_bridge.h
new file mode 100644
index 0000000000..d06488fad8
--- /dev/null
+++ b/vidix/sis_bridge.h
@@ -0,0 +1,26 @@
+/*
+ * VIDIX - VIDeo Interface for *niX.
+ *
+ * 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_SIS_BRIDGE_H
+#define MPLAYER_SIS_BRIDGE_H
+
+void sis_init_video_bridge(void);
+
+#endif /* MPLAYER_SIS_BRIDGE_H */
diff --git a/vidix/sis_vid.c b/vidix/sis_vid.c
index 0f5960cf54..4d82755bdf 100644
--- a/vidix/sis_vid.c
+++ b/vidix/sis_vid.c
@@ -37,6 +37,7 @@
#include "pci_ids.h"
#include "pci_names.h"
+#include "sis_bridge.h"
#include "sis_regs.h"
#include "sis_defs.h"
@@ -167,9 +168,6 @@ static unsigned short sis_card_ids[] = {
/** function declarations **/
-void sis_init_video_bridge(void);
-
-
static void set_overlay(SISOverlayPtr pOverlay, int index);
static void close_overlay(void);
static void calc_scale_factor(SISOverlayPtr pOverlay,
diff --git a/vidix/vidix.c b/vidix/vidix.c
index adb5613948..8fe02e4836 100644
--- a/vidix/vidix.c
+++ b/vidix/vidix.c
@@ -153,7 +153,7 @@ int vdlPlaybackSetEq (VDXContext *ctx, const vidix_video_eq_t *e)
return ctx->drv->set_eq ? ctx->drv->set_eq (e) : ENOSYS;
}
-int vdlPlaybackCopyFrame (VDXContext *ctx, const vidix_dma_t *f)
+static int vdlPlaybackCopyFrame(VDXContext *ctx, const vidix_dma_t *f)
{
return ctx->drv->copy_frame ? ctx->drv->copy_frame (f) : ENOSYS;
}