MPlayer-cvslog
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
March 2012
- 7 participants
- 52 discussions
Author: reimar
Date: Sun Mar 4 15:49:29 2012
New Revision: 34793
Log:
Replace off_t by int64_t in cache code.
Modified:
trunk/stream/cache2.c
Modified: trunk/stream/cache2.c
==============================================================================
--- trunk/stream/cache2.c Sun Mar 4 15:47:37 2012 (r34792)
+++ trunk/stream/cache2.c Sun Mar 4 15:49:29 2012 (r34793)
@@ -80,11 +80,11 @@ typedef struct {
#endif
// filler's pointers:
int eof;
- off_t min_filepos; // buffer contain only a part of the file, from min-max pos
- off_t max_filepos;
- off_t offset; // filepos <-> bufferpos offset value (filepos of the buffer's first byte)
+ int64_t min_filepos; // buffer contain only a part of the file, from min-max pos
+ int64_t max_filepos;
+ int64_t offset; // filepos <-> bufferpos offset value (filepos of the buffer's first byte)
// reader's pointers:
- off_t read_filepos;
+ int64_t read_filepos;
// commands/locking:
// int seek_lock; // 1 if we will seek/reset buffer, 2 if we are ready for cmd
// int fifo_flag; // 1 if we should use FIFO to notice cache about buffer reads.
@@ -174,7 +174,7 @@ static int cache_read(cache_vars_t *s, u
static int cache_fill(cache_vars_t *s)
{
int64_t back,back2,newb,space,len,pos;
- off_t read=s->read_filepos;
+ int64_t read=s->read_filepos;
int read_chunk;
int wraparound_copy = 0;
@@ -580,9 +580,9 @@ int cache_fill_status(stream_t *s) {
return (cv->max_filepos-cv->read_filepos)/(cv->buffer_size / 100);
}
-int cache_stream_seek_long(stream_t *stream,off_t pos){
+int cache_stream_seek_long(stream_t *stream,int64_t pos){
cache_vars_t* s;
- off_t newpos;
+ int64_t newpos;
if(!stream->cache_pid) return stream_seek_long(stream,pos);
s=stream->cache_data;
1
0
r34792 - in trunk: cfg-common.h mencoder.c mplayer.c osdep/shmem.c osdep/shmem.h stream/cache2.c stream/stream.h
by reimar 04 Mar '12
by reimar 04 Mar '12
04 Mar '12
Author: reimar
Date: Sun Mar 4 15:47:37 2012
New Revision: 34792
Log:
Allow using a cache size of up to 4 TB.
Obviously anything close to 4 GB will always fail
on 32 bit systems.
Modified:
trunk/cfg-common.h
trunk/mencoder.c
trunk/mplayer.c
trunk/osdep/shmem.c
trunk/osdep/shmem.h
trunk/stream/cache2.c
trunk/stream/stream.h
Modified: trunk/cfg-common.h
==============================================================================
--- trunk/cfg-common.h Sun Mar 4 15:37:31 2012 (r34791)
+++ trunk/cfg-common.h Sun Mar 4 15:47:37 2012 (r34792)
@@ -315,7 +315,7 @@ const m_option_t common_opts[] = {
// ------------------------- stream options --------------------
#ifdef CONFIG_STREAM_CACHE
- {"cache", &stream_cache_size, CONF_TYPE_INT, CONF_RANGE, 32, 1048576, NULL},
+ {"cache", &stream_cache_size, CONF_TYPE_INT, CONF_RANGE, 32, 0x7fffffff, NULL},
{"nocache", &stream_cache_size, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"cache-min", &stream_cache_min_percent, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL},
{"cache-seek-min", &stream_cache_seek_min_percent, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL},
Modified: trunk/mencoder.c
==============================================================================
--- trunk/mencoder.c Sun Mar 4 15:37:31 2012 (r34791)
+++ trunk/mencoder.c Sun Mar 4 15:47:37 2012 (r34792)
@@ -678,7 +678,7 @@ if(stream->type==STREAMTYPE_DVDNAV){
stream->start_pos+=seek_to_byte;
- if(stream_cache_size>0) stream_enable_cache(stream,stream_cache_size*1024,0,0);
+ if(stream_cache_size>0) stream_enable_cache(stream,stream_cache_size*1024ull,0,0);
if(demuxer2) audio_id=-2; /* do NOT read audio packets... */
Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c Sun Mar 4 15:37:31 2012 (r34791)
+++ trunk/mplayer.c Sun Mar 4 15:47:37 2012 (r34792)
@@ -3298,9 +3298,9 @@ goto_enable_cache:
if (stream_cache_size > 0) {
int res;
current_module = "enable_cache";
- res = stream_enable_cache(mpctx->stream, stream_cache_size * 1024,
- stream_cache_size * 1024 * (stream_cache_min_percent / 100.0),
- stream_cache_size * 1024 * (stream_cache_seek_min_percent / 100.0));
+ res = stream_enable_cache(mpctx->stream, stream_cache_size * 1024ull,
+ stream_cache_size * 1024ull * (stream_cache_min_percent / 100.0),
+ stream_cache_size * 1024ull * (stream_cache_seek_min_percent / 100.0));
if (res == 0)
if ((mpctx->eof = libmpdemux_was_interrupted(PT_NEXT_ENTRY)))
goto goto_next_file;
Modified: trunk/osdep/shmem.c
==============================================================================
--- trunk/osdep/shmem.c Sun Mar 4 15:37:31 2012 (r34791)
+++ trunk/osdep/shmem.c Sun Mar 4 15:47:37 2012 (r34792)
@@ -36,6 +36,7 @@
#endif
#include <sys/socket.h>
#include <fcntl.h>
+#include <inttypes.h>
#include "mp_msg.h"
#include "shmem.h"
@@ -55,16 +56,21 @@
static int shmem_type=0;
-void* shmem_alloc(int size){
+void* shmem_alloc(int64_t size){
void* p;
static int devzero = -1;
+if (size > SIZE_MAX) {
+ mp_msg(MSGT_OSDEP, MSGL_FATAL,
+ "Shared memory allocation larger than system max. allocation size.\n");
+ return NULL;
+}
while(1){
switch(shmem_type){
case 0: // ========= MAP_ANON|MAP_SHARED ==========
#ifdef MAP_ANON
p=mmap(0,size,PROT_READ|PROT_WRITE,MAP_ANON|MAP_SHARED,-1,0);
if(p==MAP_FAILED) break; // failed
- mp_dbg(MSGT_OSDEP, MSGL_DBG2, "shmem: %d bytes allocated using mmap anon (%p)\n",size,p);
+ mp_dbg(MSGT_OSDEP, MSGL_DBG2, "shmem: %"PRId64" bytes allocated using mmap anon (%p)\n",size,p);
return p;
#else
// system does not support MAP_ANON at all (e.g. solaris 2.5.1/2.6), just fail
@@ -75,7 +81,7 @@ while(1){
if (devzero == -1 && (devzero = open("/dev/zero", O_RDWR, 0)) == -1) break;
p=mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,devzero,0);
if(p==MAP_FAILED) break; // failed
- mp_dbg(MSGT_OSDEP, MSGL_DBG2, "shmem: %d bytes allocated using mmap /dev/zero (%p)\n",size,p);
+ mp_dbg(MSGT_OSDEP, MSGL_DBG2, "shmem: %"PRId64" bytes allocated using mmap /dev/zero (%p)\n",size,p);
return p;
case 2: { // ========= shmget() ==========
#ifdef HAVE_SHM
@@ -92,7 +98,7 @@ while(1){
if (shmdt(p) == -1) perror ("shmdt()");
break;
}
- mp_dbg(MSGT_OSDEP, MSGL_DBG2, "shmem: %d bytes allocated using SHM (%p)\n",size,p);
+ mp_dbg(MSGT_OSDEP, MSGL_DBG2, "shmem: %"PRId64" bytes allocated using SHM (%p)\n",size,p);
return p;
#else
mp_msg(MSGT_OSDEP, MSGL_FATAL, "shmem: no SHM support was compiled in!\n");
@@ -101,19 +107,19 @@ while(1){
}
default:
mp_msg(MSGT_OSDEP, MSGL_FATAL,
- "FATAL: Cannot allocate %d bytes of shared memory :(\n",size);
+ "FATAL: Cannot allocate %"PRId64" bytes of shared memory :(\n",size);
return NULL;
}
++shmem_type;
}
}
-void shmem_free(void* p,int size){
+void shmem_free(void* p,int64_t size){
switch(shmem_type){
case 0:
case 1:
if(munmap(p,size)) {
- mp_msg(MSGT_OSDEP, MSGL_ERR, "munmap failed on %p %d bytes: %s\n",
+ mp_msg(MSGT_OSDEP, MSGL_ERR, "munmap failed on %p %"PRId64" bytes: %s\n",
p,size,strerror(errno));
}
break;
Modified: trunk/osdep/shmem.h
==============================================================================
--- trunk/osdep/shmem.h Sun Mar 4 15:37:31 2012 (r34791)
+++ trunk/osdep/shmem.h Sun Mar 4 15:47:37 2012 (r34792)
@@ -19,7 +19,7 @@
#ifndef MPLAYER_SHMEM_H
#define MPLAYER_SHMEM_H
-void* shmem_alloc(int size);
-void shmem_free(void* p,int size);
+void* shmem_alloc(int64_t size);
+void shmem_free(void* p,int64_t size);
#endif /* MPLAYER_SHMEM_H */
Modified: trunk/stream/cache2.c
==============================================================================
--- trunk/stream/cache2.c Sun Mar 4 15:37:31 2012 (r34791)
+++ trunk/stream/cache2.c Sun Mar 4 15:47:37 2012 (r34792)
@@ -70,11 +70,11 @@ static void *ThreadProc(void *s);
typedef struct {
// constats:
unsigned char *buffer; // base pointer of the allocated buffer memory
- int buffer_size; // size of the allocated buffer memory
+ int64_t buffer_size; // size of the allocated buffer memory
int sector_size; // size of a single sector (2048/2324)
- int back_size; // we should keep back_size amount of old bytes for backward seek
- int fill_limit; // we should fill buffer only if space>=fill_limit
- int seek_limit; // keep filling cache if distance is less that seek limit
+ int64_t back_size; // we should keep back_size amount of old bytes for backward seek
+ int64_t fill_limit; // we should fill buffer only if space>=fill_limit
+ int64_t seek_limit; // keep filling cache if distance is less that seek limit
#if FORKED_CACHE
pid_t ppid; // parent PID to detect killed parent
#endif
@@ -117,9 +117,9 @@ static int cache_read(cache_vars_t *s, u
{
int total=0;
int sleep_count = 0;
- int last_max = s->max_filepos;
+ int64_t last_max = s->max_filepos;
while(size>0){
- int pos,newb,len;
+ int64_t pos,newb,len;
//printf("CACHE2_READ: 0x%X <= 0x%X <= 0x%X \n",s->min_filepos,s->read_filepos,s->max_filepos);
@@ -173,7 +173,7 @@ static int cache_read(cache_vars_t *s, u
static int cache_fill(cache_vars_t *s)
{
- int back,back2,newb,space,len,pos;
+ int64_t back,back2,newb,space,len,pos;
off_t read=s->read_filepos;
int read_chunk;
int wraparound_copy = 0;
@@ -334,7 +334,7 @@ static int cache_execute_control(cache_v
return 1;
}
-static void *shared_alloc(int size) {
+static void *shared_alloc(int64_t size) {
#if FORKED_CACHE
return shmem_alloc(size);
#else
@@ -342,7 +342,7 @@ static void *shared_alloc(int size) {
#endif
}
-static void shared_free(void *ptr, int size) {
+static void shared_free(void *ptr, int64_t size) {
#if FORKED_CACHE
shmem_free(ptr, size);
#else
@@ -350,8 +350,8 @@ static void shared_free(void *ptr, int s
#endif
}
-static cache_vars_t* cache_init(int size,int sector){
- int num;
+static cache_vars_t* cache_init(int64_t size,int sector){
+ int64_t num;
cache_vars_t* s=shared_alloc(sizeof(cache_vars_t));
if(s==NULL) return NULL;
@@ -441,7 +441,7 @@ static void cache_mainloop(cache_vars_t
/**
* \return 1 on success, 0 if the function was interrupted and -1 on error
*/
-int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
+int stream_enable_cache(stream_t *stream,int64_t size,int64_t min,int64_t seek_limit){
int ss = stream->sector_size ? stream->sector_size : STREAM_BUFFER_SIZE;
int res = -1;
cache_vars_t* s;
@@ -450,6 +450,10 @@ int stream_enable_cache(stream_t *stream
mp_msg(MSGT_CACHE,MSGL_STATUS,"\rThis stream is non-cacheable\n");
return 1;
}
+ if (size > SIZE_MAX) {
+ mp_msg(MSGT_CACHE, MSGL_FATAL, "Cache size larger than max. allocation size\n");
+ return -1;
+ }
s=cache_init(size,ss);
if(s == NULL) return -1;
@@ -498,7 +502,7 @@ int stream_enable_cache(stream_t *stream
goto err_out;
}
// wait until cache is filled at least prefill_init %
- mp_msg(MSGT_CACHE,MSGL_V,"CACHE_PRE_INIT: %"PRId64" [%"PRId64"] %"PRId64" pre:%d eof:%d \n",
+ mp_msg(MSGT_CACHE,MSGL_V,"CACHE_PRE_INIT: %"PRId64" [%"PRId64"] %"PRId64" pre:%"PRId64" eof:%d \n",
(int64_t)s->min_filepos,(int64_t)s->read_filepos,(int64_t)s->max_filepos,min,s->eof);
while(s->read_filepos<s->min_filepos || s->max_filepos-s->read_filepos<min){
mp_msg(MSGT_CACHE,MSGL_STATUS,MSGTR_CacheFill,
Modified: trunk/stream/stream.h
==============================================================================
--- trunk/stream/stream.h Sun Mar 4 15:37:31 2012 (r34791)
+++ trunk/stream/stream.h Sun Mar 4 15:47:37 2012 (r34792)
@@ -191,7 +191,7 @@ int stream_seek_long(stream_t *s, off_t
void stream_capture_do(stream_t *s);
#ifdef CONFIG_STREAM_CACHE
-int stream_enable_cache(stream_t *stream,int size,int min,int prefill);
+int stream_enable_cache(stream_t *stream,int64_t size,int64_t min,int64_t prefill);
int cache_stream_fill_buffer(stream_t *s);
int cache_stream_seek_long(stream_t *s,off_t pos);
#else
1
0
Author: reimar
Date: Sun Mar 4 15:37:31 2012
New Revision: 34791
Log:
Remove variable that is only assigned but never used.
Modified:
trunk/stream/cache2.c
Modified: trunk/stream/cache2.c
==============================================================================
--- trunk/stream/cache2.c Sun Mar 4 00:34:29 2012 (r34790)
+++ trunk/stream/cache2.c Sun Mar 4 15:37:31 2012 (r34791)
@@ -99,8 +99,6 @@ typedef struct {
volatile double stream_time_pos;
} cache_vars_t;
-static int min_fill=0;
-
static void cache_wakeup(stream_t *s)
{
#if FORKED_CACHE
@@ -145,7 +143,6 @@ static int cache_read(cache_vars_t *s, u
sleep_count = 0;
newb=s->max_filepos-s->read_filepos; // new bytes in the buffer
- if(newb<min_fill) min_fill=newb; // statistics...
// printf("*** newb: %d bytes ***\n",newb);
1
0
Author: compn
Date: Fri Mar 2 14:32:29 2012
New Revision: 34781
Log:
subcc switch nonascii characters to hex, patch by frogs on irc
Modified:
trunk/sub/sub_cc.c
Modified: trunk/sub/sub_cc.c
==============================================================================
--- trunk/sub/sub_cc.c Tue Feb 28 20:31:56 2012 (r34780)
+++ trunk/sub/sub_cc.c Fri Mar 2 14:32:29 2012 (r34781)
@@ -65,16 +65,16 @@ static void build_char_table(void)
for (i = 0; i < 128; i++)
chartbl[i] = (char) i;
/* now the special codes */
- chartbl[0x2a] = '�';
- chartbl[0x5c] = '�';
- chartbl[0x5e] = '�';
- chartbl[0x5f] = '�';
- chartbl[0x60] = '�';
- chartbl[0x7b] = '�';
- chartbl[0x7c] = '�';
- chartbl[0x7d] = '�';
- chartbl[0x7e] = '�';
- chartbl[0x7f] = '�'; /* FIXME: this should be a solid block */
+ chartbl[0x2a] = '0xe1';
+ chartbl[0x5c] = '0xe9';
+ chartbl[0x5e] = '0xed';
+ chartbl[0x5f] = '0xf3';
+ chartbl[0x60] = '0xfa';
+ chartbl[0x7b] = '0xe7';
+ chartbl[0x7c] = '0xf7';
+ chartbl[0x7d] = '0xd1';
+ chartbl[0x7e] = '0xf1';
+ chartbl[0x7f] = '0xa4'; /* FIXME: this should be a solid block */
}
static void clear_buffer(subtitle *buf)
6
7
Author: al
Date: Sun Mar 4 00:34:29 2012
New Revision: 34790
Log:
Do not use single quotes around hex literals
This is a fixup for r34781. Somehow single quotes were added
to what was meant to be a C hex constant. They were not present
in the original patch. This probably means 10l for Compn :)
Additionally I added comments to describe what characters the
hex literals stand for.
Found-By: Ingo Brückl
Modified:
trunk/sub/sub_cc.c
Modified: trunk/sub/sub_cc.c
==============================================================================
--- trunk/sub/sub_cc.c Sun Mar 4 00:31:28 2012 (r34789)
+++ trunk/sub/sub_cc.c Sun Mar 4 00:34:29 2012 (r34790)
@@ -65,16 +65,16 @@ static void build_char_table(void)
for (i = 0; i < 128; i++)
chartbl[i] = (char) i;
/* now the special codes */
- chartbl[0x2a] = '0xe1';
- chartbl[0x5c] = '0xe9';
- chartbl[0x5e] = '0xed';
- chartbl[0x5f] = '0xf3';
- chartbl[0x60] = '0xfa';
- chartbl[0x7b] = '0xe7';
- chartbl[0x7c] = '0xf7';
- chartbl[0x7d] = '0xd1';
- chartbl[0x7e] = '0xf1';
- chartbl[0x7f] = '0xa4'; /* FIXME: this should be a solid block */
+ chartbl[0x2a] = 0xe1; /* Latin Small Letter A with acute */
+ chartbl[0x5c] = 0xe9; /* Latin Small Letter E with acute */
+ chartbl[0x5e] = 0xed; /* Latin Small Letter I with acute */
+ chartbl[0x5f] = 0xf3; /* Latin Small Letter O with acute */
+ chartbl[0x60] = 0xfa; /* Latin Small Letter U with acute */
+ chartbl[0x7b] = 0xe7; /* Latin Small Letter C with cedilla */
+ chartbl[0x7c] = 0xf7; /* Division sign */
+ chartbl[0x7d] = 0xd1; /* Latin Capital letter N with tilde */
+ chartbl[0x7e] = 0xf1; /* Latin Small Letter N with tilde */
+ chartbl[0x7f] = 0xa4; /* Currency sign FIXME: this should be a solid block */
}
static void clear_buffer(subtitle *buf)
1
0
Author: cehoyos
Date: Sun Mar 4 00:31:28 2012
New Revision: 34789
Log:
Fix compilation with latest FFmpeg (without libbluray).
Modified:
trunk/configure
Modified: trunk/configure
==============================================================================
--- trunk/configure Sat Mar 3 18:38:58 2012 (r34788)
+++ trunk/configure Sun Mar 4 00:31:28 2012 (r34789)
@@ -674,7 +674,7 @@ libavmuxers_all=$(sed -n 's/^[^#]*_MUX.*
libavmuxers=$(echo $libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER// -e s/RTSP_MUXER// -e s/SAP_MUXER//)
libavprotocols_all=$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' ffmpeg/libavformat/allformats.c | tr '[a-z]' '[A-Z]')
libavprotocols=$libavprotocols_all
-libavprotocols=$(echo $libavprotocols | sed -e s/HTTPS_PROTOCOL// -e s/TLS_PROTOCOL//)
+libavprotocols=$(echo $libavprotocols | sed -e s/HTTPS_PROTOCOL// -e s/TLS_PROTOCOL// -e s/BLURAY_PROTOCOL//)
libavfilters_all=$(sed -n 's/^[^#]*FILTER.*(.*, *\(.*\),.*).*/\1_filter/p' ffmpeg/libavfilter/allfilters.c | tr '[a-z]' '[A-Z]')
libavfilters=$(echo $libavfilters_all | sed -e 's/ LIB[A-Z0-9_]*_FILTER//g' -e 's/ FREI0R[A-Z0-9_]*_FILTER//g' -e 's/ OCV_FILTER//g' -e 's/ MP_FILTER//g')
_mencoder=yes
1
0
Author: ib
Date: Sat Mar 3 17:53:21 2012
New Revision: 34787
Log:
Cosmetic: Move, change and add some comments on GUI windows.
Modified:
trunk/gui/ui/main.c
trunk/gui/ui/menu.c
trunk/gui/ui/playbar.c
trunk/gui/ui/video.c
Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c Sat Mar 3 17:48:08 2012 (r34786)
+++ trunk/gui/ui/main.c Sat Mar 3 17:53:21 2012 (r34787)
@@ -1,6 +1,4 @@
/*
- * main window
- *
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
@@ -18,6 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+/* main window */
+
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
Modified: trunk/gui/ui/menu.c
==============================================================================
--- trunk/gui/ui/menu.c Sat Mar 3 17:48:08 2012 (r34786)
+++ trunk/gui/ui/menu.c Sat Mar 3 17:53:21 2012 (r34787)
@@ -16,6 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+/* menu window */
+
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
Modified: trunk/gui/ui/playbar.c
==============================================================================
--- trunk/gui/ui/playbar.c Sat Mar 3 17:48:08 2012 (r34786)
+++ trunk/gui/ui/playbar.c Sat Mar 3 17:53:21 2012 (r34787)
@@ -1,6 +1,4 @@
/*
- * main window
- *
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
@@ -18,6 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+/* playbar window */
+
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
Modified: trunk/gui/ui/video.c
==============================================================================
--- trunk/gui/ui/video.c Sat Mar 3 17:48:08 2012 (r34786)
+++ trunk/gui/ui/video.c Sat Mar 3 17:53:21 2012 (r34787)
@@ -1,6 +1,4 @@
/*
- * video window
- *
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
@@ -18,6 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+/* video window */
+
#include <string.h>
#include "config.h"
1
0
Author: ib
Date: Sat Mar 3 17:48:08 2012
New Revision: 34786
Log:
Cosmetic: Adjust indent.
Modified:
trunk/gui/cfg.c
trunk/gui/interface.c
trunk/gui/skin/skin.c
Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c Sat Mar 3 17:45:15 2012 (r34785)
+++ trunk/gui/cfg.c Sat Mar 3 17:48:08 2012 (r34786)
@@ -86,9 +86,9 @@ int gtkEnablePlayBar = 1;
int gtkLoadFullscreen;
int gtkShowVideoWindow = 1;
-int gui_save_pos = 1;
-int gui_main_pos_x = -3;
-int gui_main_pos_y = -3;
+int gui_save_pos = 1;
+int gui_main_pos_x = -3;
+int gui_main_pos_y = -3;
int gui_video_pos_x = -3;
int gui_video_pos_y = -3;
Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c Sat Mar 3 17:45:15 2012 (r34785)
+++ trunk/gui/interface.c Sat Mar 3 17:48:08 2012 (r34786)
@@ -219,7 +219,7 @@ void guiInit(void)
while (xev.type != MapNotify || xev.xmap.event != guiApp.videoWindow.WindowID);
guiApp.videoWindow.Mapped = wsMapped;
- guiInfo.VideoWindow = True;
+ guiInfo.VideoWindow = True;
}
if (gtkLoadFullscreen)
@@ -255,8 +255,8 @@ void guiDone(void)
uiMainRender = 0;
if (gui_save_pos) {
- gui_main_pos_x = guiApp.mainWindow.X;
- gui_main_pos_y = guiApp.mainWindow.Y;
+ gui_main_pos_x = guiApp.mainWindow.X;
+ gui_main_pos_y = guiApp.mainWindow.Y;
gui_video_pos_x = guiApp.video.x;
gui_video_pos_y = guiApp.video.y;
}
Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c Sat Mar 3 17:45:15 2012 (r34785)
+++ trunk/gui/skin/skin.c Sat Mar 3 17:48:08 2012 (r34786)
@@ -316,8 +316,8 @@ static int item_base(char *in)
return 1;
is_video = (strcmp(currWinName, "video") == 0);
- is_bar = (strcmp(currWinName, "playbar") == 0);
- is_menu = (strcmp(currWinName, "menu") == 0);
+ is_bar = (strcmp(currWinName, "playbar") == 0);
+ is_menu = (strcmp(currWinName, "menu") == 0);
cutItem(in, fname, ',', 0);
x = cutItemToInt(in, ',', 1);
1
0
03 Mar '12
Author: ib
Date: Sat Mar 3 17:45:15 2012
New Revision: 34785
Log:
Rename sub window video window.
It was a bad idea to name the video window "sub window" at the time
the GUI was written. The term "sub window" does make sense from the
programmer's point of view, but it doesn't make any sense at all from
the user's point of view, because the sub window simply is the window
where the video will be displayed.
Moreover, since the term "sub" is generally short for "subtitles",
the renaming makes the code much easier to understand.
Added:
trunk/gui/ui/video.c
- copied, changed from r34780, trunk/gui/ui/sub.c
Deleted:
trunk/gui/ui/sub.c
Modified:
trunk/Makefile
trunk/gui/app.c
trunk/gui/app.h
trunk/gui/cfg.c
trunk/gui/cfg.h
trunk/gui/interface.c
trunk/gui/skin/skin.c
trunk/gui/ui/actions.c
trunk/gui/ui/gmplayer.h
trunk/gui/ui/gtk/menu.c
trunk/gui/ui/gtk/preferences.c
trunk/gui/ui/main.c
trunk/gui/ui/playbar.c
trunk/gui/ui/widgets.c
trunk/gui/win32/dialogs.c
trunk/gui/win32/dialogs.h
trunk/gui/win32/gui.c
trunk/gui/win32/gui.h
trunk/gui/win32/interface.c
trunk/gui/win32/preferences.c
trunk/gui/win32/skinload.c
trunk/gui/win32/skinload.h
trunk/gui/win32/wincfg.c
Changes in other areas also in this revision:
Modified:
trunk/DOCS/xml/de/skin.xml
trunk/DOCS/xml/en/skin.xml
trunk/help/help_mp-de.h
trunk/help/help_mp-en.h
trunk/help/help_mp-zh_CN.h
Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/Makefile Sat Mar 3 17:45:15 2012 (r34785)
@@ -545,7 +545,7 @@ SRCS_MPLAYER-$(GUI_GTK) += gui/app.
gui/ui/menu.c \
gui/ui/playbar.c \
gui/ui/render.c \
- gui/ui/sub.c \
+ gui/ui/video.c \
gui/ui/widgets.c \
gui/util/cut.c \
gui/wm/ws.c \
Modified: trunk/gui/app.c
==============================================================================
--- trunk/gui/app.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/app.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -108,7 +108,7 @@ void appFreeStruct(void)
appClearItem(&guiApp.main);
guiApp.mainDecoration = 0;
- appClearItem(&guiApp.sub);
+ appClearItem(&guiApp.video);
appClearItem(&guiApp.playbar);
guiApp.playbarIsPresent = 0;
@@ -161,7 +161,7 @@ wItem *appFindItem(int event)
wItem *item;
int i, n;
- if (guiApp.subWindow.isFullScreen && guiApp.playbarIsPresent) {
+ if (guiApp.videoWindow.isFullScreen && guiApp.playbarIsPresent) {
item = guiApp.playbarItems;
n = guiApp.IndexOfPlaybarItems;
} else {
Modified: trunk/gui/app.h
==============================================================================
--- trunk/gui/app.h Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/app.h Sat Mar 3 17:45:15 2012 (r34785)
@@ -155,8 +155,8 @@ typedef struct {
wsTWindow mainWindow;
int mainDecoration;
- wItem sub;
- wsTWindow subWindow;
+ wItem video;
+ wsTWindow videoWindow;
wItem playbar;
wsTWindow playbarWindow;
Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/cfg.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -89,8 +89,8 @@ int gtkShowVideoWindow = 1;
int gui_save_pos = 1;
int gui_main_pos_x = -3;
int gui_main_pos_y = -3;
-int gui_sub_pos_x = -3;
-int gui_sub_pos_y = -3;
+int gui_video_pos_x = -3;
+int gui_video_pos_y = -3;
int guiWinID = -1;
@@ -168,8 +168,8 @@ static const m_option_t gui_opts[] = {
{ "gui_save_pos", &gui_save_pos, CONF_TYPE_FLAG, 0, 0, 1, NULL },
{ "gui_main_pos_x", &gui_main_pos_x, CONF_TYPE_INT, 0, 0, 0, NULL },
{ "gui_main_pos_y", &gui_main_pos_y, CONF_TYPE_INT, 0, 0, 0, NULL },
- { "gui_video_out_pos_x", &gui_sub_pos_x, CONF_TYPE_INT, 0, 0, 0, NULL },
- { "gui_video_out_pos_y", &gui_sub_pos_y, CONF_TYPE_INT, 0, 0, 0, NULL },
+ { "gui_video_out_pos_x", &gui_video_pos_x, CONF_TYPE_INT, 0, 0, 0, NULL },
+ { "gui_video_out_pos_y", &gui_video_pos_y, CONF_TYPE_INT, 0, 0, 0, NULL },
{ "idle", &player_idle_mode, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL },
Modified: trunk/gui/cfg.h
==============================================================================
--- trunk/gui/cfg.h Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/cfg.h Sat Mar 3 17:45:15 2012 (r34785)
@@ -80,8 +80,8 @@ extern int gtkShowVideoWindow;
extern int gui_save_pos;
extern int gui_main_pos_x;
extern int gui_main_pos_y;
-extern int gui_sub_pos_x;
-extern int gui_sub_pos_y;
+extern int gui_video_pos_x;
+extern int gui_video_pos_y;
extern int guiWinID;
Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/interface.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -144,27 +144,27 @@ void guiInit(void)
guiApp.main.x = gui_main_pos_x;
if (gui_main_pos_y != -3)
guiApp.main.y = gui_main_pos_y;
- if (gui_sub_pos_x != -3)
- guiApp.sub.x = gui_sub_pos_x;
- if (gui_sub_pos_y != -3)
- guiApp.sub.y = gui_sub_pos_y;
+ if (gui_video_pos_x != -3)
+ guiApp.video.x = gui_video_pos_x;
+ if (gui_video_pos_y != -3)
+ guiApp.video.y = gui_video_pos_y;
}
if (WinID > 0) {
- guiApp.subWindow.Parent = WinID;
- guiApp.sub.x = 0;
- guiApp.sub.y = 0;
+ guiApp.videoWindow.Parent = WinID;
+ guiApp.video.x = 0;
+ guiApp.video.y = 0;
}
if (guiWinID >= 0)
guiApp.mainWindow.Parent = guiWinID;
- wsCreateWindow(&guiApp.subWindow, guiApp.sub.x, guiApp.sub.y, guiApp.sub.width, guiApp.sub.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsHideWindow, "MPlayer - Video");
- wsDestroyImage(&guiApp.subWindow);
- wsCreateImage(&guiApp.subWindow, guiApp.sub.Bitmap.Width, guiApp.sub.Bitmap.Height);
- wsXDNDMakeAwareness(&guiApp.subWindow);
+ wsCreateWindow(&guiApp.videoWindow, guiApp.video.x, guiApp.video.y, guiApp.video.width, guiApp.video.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsHideWindow, "MPlayer - Video");
+ wsDestroyImage(&guiApp.videoWindow);
+ wsCreateImage(&guiApp.videoWindow, guiApp.video.Bitmap.Width, guiApp.video.Bitmap.Height);
+ wsXDNDMakeAwareness(&guiApp.videoWindow);
- WinID = guiApp.subWindow.WindowID;
+ WinID = guiApp.videoWindow.WindowID;
uiMenuInit();
uiPlaybarInit();
@@ -178,30 +178,30 @@ void guiInit(void)
mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] screen depth: %d\n", wsDepthOnScreen);
mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] mainWindow ID: 0x%x\n", (int)guiApp.mainWindow.WindowID);
- mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] subWindow ID: 0x%x\n", (int)guiApp.subWindow.WindowID);
+ mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] videoWindow ID: 0x%x\n", (int)guiApp.videoWindow.WindowID);
guiApp.mainWindow.ReDraw = (void *)uiMainDraw;
guiApp.mainWindow.MouseHandler = uiMainMouseHandle;
guiApp.mainWindow.KeyHandler = uiMainKeyHandle;
guiApp.mainWindow.DandDHandler = uiDandDHandler;
- guiApp.subWindow.ReDraw = (void *)uiSubDraw;
- guiApp.subWindow.MouseHandler = uiSubMouseHandle;
- guiApp.subWindow.KeyHandler = uiMainKeyHandle;
- guiApp.subWindow.DandDHandler = uiDandDHandler;
+ guiApp.videoWindow.ReDraw = (void *)uiVideoDraw;
+ guiApp.videoWindow.MouseHandler = uiVideoMouseHandle;
+ guiApp.videoWindow.KeyHandler = uiMainKeyHandle;
+ guiApp.videoWindow.DandDHandler = uiDandDHandler;
- wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
- wsClearWindow(guiApp.subWindow);
+ wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B);
+ wsClearWindow(guiApp.videoWindow);
- if (guiApp.sub.Bitmap.Image)
- wsConvert(&guiApp.subWindow, guiApp.sub.Bitmap.Image);
+ if (guiApp.video.Bitmap.Image)
+ wsConvert(&guiApp.videoWindow, guiApp.video.Bitmap.Image);
btnModify(evSetVolume, guiInfo.Volume);
btnModify(evSetBalance, guiInfo.Balance);
btnModify(evSetMoviePosition, guiInfo.Position);
wsSetIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon);
- wsSetIcon(wsDisplay, guiApp.subWindow.WindowID, &guiIcon);
+ wsSetIcon(wsDisplay, guiApp.videoWindow.WindowID, &guiIcon);
if (!guiApp.mainDecoration)
wsWindowDecoration(&guiApp.mainWindow, 0);
@@ -209,30 +209,30 @@ void guiInit(void)
wsVisibleWindow(&guiApp.mainWindow, wsShowWindow);
if (gtkShowVideoWindow) {
- wsVisibleWindow(&guiApp.subWindow, wsShowWindow);
+ wsVisibleWindow(&guiApp.videoWindow, wsShowWindow);
{
XEvent xev;
do
XNextEvent(wsDisplay, &xev);
- while (xev.type != MapNotify || xev.xmap.event != guiApp.subWindow.WindowID);
+ while (xev.type != MapNotify || xev.xmap.event != guiApp.videoWindow.WindowID);
- guiApp.subWindow.Mapped = wsMapped;
+ guiApp.videoWindow.Mapped = wsMapped;
guiInfo.VideoWindow = True;
}
if (gtkLoadFullscreen)
uiFullScreen();
} else
- wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0);
+ wsSetBackgroundRGB(&guiApp.videoWindow, 0, 0, 0);
if (gtkLoadFullscreen)
btnSet(evFullScreen, btnPressed);
guiInfo.Playing = GUI_STOP;
- uiSubRender = 1;
+ uiVideoRender = 1;
playlist = listMgr(PLAYLIST_ITEM_GET_CURR, 0);
@@ -257,8 +257,8 @@ void guiDone(void)
if (gui_save_pos) {
gui_main_pos_x = guiApp.mainWindow.X;
gui_main_pos_y = guiApp.mainWindow.Y;
- gui_sub_pos_x = guiApp.sub.x;
- gui_sub_pos_y = guiApp.sub.y;
+ gui_video_pos_x = guiApp.video.x;
+ gui_video_pos_y = guiApp.video.y;
}
ass_enabled = gtkASS.enabled;
@@ -341,7 +341,7 @@ int gui(int what, void *data)
switch ((int)data) {
case GUI_STOP:
case GUI_PLAY:
-// if ( !gtkShowVideoWindow ) wsVisibleWindow( &guiApp.subWindow,wsHideWindow );
+// if ( !gtkShowVideoWindow ) wsVisibleWindow( &guiApp.videoWindow,wsHideWindow );
case GUI_PAUSE:
guiInfo.Playing = (int)data;
break;
@@ -394,7 +394,7 @@ int gui(int what, void *data)
case GUI_PREPARE:
- wsVisibleMouse(&guiApp.subWindow, wsHideMouseCursor);
+ wsVisibleMouse(&guiApp.videoWindow, wsHideMouseCursor);
if (guiInfo.NewPlay == GUI_FILE_NEW) {
dvd_title = 0;
@@ -689,7 +689,7 @@ int gui(int what, void *data)
// ...without video there will be no call to GUI_SETUP_VIDEO_WINDOW
if (!guiInfo.VideoWindow) {
- wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
+ wsVisibleWindow(&guiApp.videoWindow, wsHideWindow);
btnSet(evFullScreen, (gtkLoadFullscreen ? btnPressed : btnReleased));
}
@@ -731,17 +731,17 @@ int gui(int what, void *data)
guiInfo.VideoWidth = vo_dwidth;
guiInfo.VideoHeight = vo_dheight;
- if (!guiApp.subWindow.isFullScreen || !guiApp.subWindow.Mapped) {
- if (!guiApp.subWindow.isFullScreen)
- wsResizeWindow(&guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight);
+ if (!guiApp.videoWindow.isFullScreen || !guiApp.videoWindow.Mapped) {
+ if (!guiApp.videoWindow.isFullScreen)
+ wsResizeWindow(&guiApp.videoWindow, guiInfo.VideoWidth, guiInfo.VideoHeight);
- wsMoveWindow(&guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y);
+ wsMoveWindow(&guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y);
- if (!guiApp.subWindow.Mapped)
- wsVisibleWindow(&guiApp.subWindow, wsShowWindow);
+ if (!guiApp.videoWindow.Mapped)
+ wsVisibleWindow(&guiApp.videoWindow, wsShowWindow);
}
- if (gtkLoadFullscreen ^ guiApp.subWindow.isFullScreen)
+ if (gtkLoadFullscreen ^ guiApp.videoWindow.isFullScreen)
uiEventHandling(evFullScreen, 0);
if (guiWinID >= 0)
@@ -794,21 +794,21 @@ int gui(int what, void *data)
if (gtkShowVideoWindow) {
guiInfo.VideoWindow = True;
- guiInfo.VideoWidth = guiApp.sub.width;
- guiInfo.VideoHeight = guiApp.sub.height;
+ guiInfo.VideoWidth = guiApp.video.width;
+ guiInfo.VideoHeight = guiApp.video.height;
- if (!guiApp.subWindow.isFullScreen) {
- wsResizeWindow(&guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight);
- wsMoveWindow(&guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y);
+ if (!guiApp.videoWindow.isFullScreen) {
+ wsResizeWindow(&guiApp.videoWindow, guiInfo.VideoWidth, guiInfo.VideoHeight);
+ wsMoveWindow(&guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y);
}
- if (!guiApp.subWindow.Mapped)
- wsVisibleWindow(&guiApp.subWindow, wsShowWindow);
+ if (!guiApp.videoWindow.Mapped)
+ wsVisibleWindow(&guiApp.videoWindow, wsShowWindow);
- if (gtkLoadFullscreen ^ guiApp.subWindow.isFullScreen)
+ if (gtkLoadFullscreen ^ guiApp.videoWindow.isFullScreen)
uiEventHandling(evFullScreen, 0);
} else {
- wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
+ wsVisibleWindow(&guiApp.videoWindow, wsHideWindow);
guiInfo.VideoWindow = False;
btnSet(evFullScreen, (gtkLoadFullscreen ? btnPressed : btnReleased));
}
@@ -816,11 +816,11 @@ int gui(int what, void *data)
gui(GUI_SET_STATE, (void *)GUI_STOP);
wsHandleEvents();
- uiSubRender = 1;
- wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
- wsClearWindow(guiApp.subWindow);
- wsPostRedisplay(&guiApp.subWindow);
- wsVisibleMouse(&guiApp.subWindow, wsShowMouseCursor);
+ uiVideoRender = 1;
+ wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B);
+ wsClearWindow(guiApp.videoWindow);
+ wsPostRedisplay(&guiApp.videoWindow);
+ wsVisibleMouse(&guiApp.videoWindow, wsShowMouseCursor);
}
break;
Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/skin/skin.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -246,7 +246,7 @@ static int item_end(char *in)
/**
* @brief Parse a @a window definition.
*
- * Syntax: window=main|sub|playbar|menu
+ * Syntax: window=main|video|playbar|menu
*
* @param in definition to be analyzed
*
@@ -264,12 +264,15 @@ static int item_window(char *in)
strlower(in);
+ if (strcmp(in, "sub") == 0)
+ strcpy(in, "video"); // legacy
+
if (strcmp(in, "main") == 0) {
currWin = &skin->main;
currWinItemIdx = &skin->IndexOfMainItems;
currWinItems = skin->mainItems;
- } else if (strcmp(in, "sub") == 0) {
- currWin = &skin->sub;
+ } else if (strcmp(in, "video") == 0) {
+ currWin = &skin->video;
currWinItemIdx = NULL;
currWinItems = NULL;
} else if (strcmp(in, "playbar") == 0) {
@@ -307,12 +310,12 @@ static int item_base(char *in)
unsigned char file[512];
int x, y;
int w = 0, h = 0;
- int is_sub, is_bar, is_menu;
+ int is_video, is_bar, is_menu;
if (!window_item("base"))
return 1;
- is_sub = (strcmp(currWinName, "sub") == 0);
+ is_video = (strcmp(currWinName, "video") == 0);
is_bar = (strcmp(currWinName, "playbar") == 0);
is_menu = (strcmp(currWinName, "menu") == 0);
@@ -344,7 +347,7 @@ static int item_base(char *in)
currWin->width = currWin->Bitmap.Width;
currWin->height = currWin->Bitmap.Height;
- if (is_sub) {
+ if (is_video) {
if (w && h) {
currWin->width = w;
currWin->height = h;
@@ -353,7 +356,7 @@ static int item_base(char *in)
mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] bitmap: %dx%d\n", currWin->width, currWin->height);
- if (!is_sub) {
+ if (!is_video) {
if (!bpRenderMask(&currWin->Bitmap, &currWin->Mask)) {
skin_error(MSGTR_SKIN_NotEnoughMemory);
return 1;
@@ -419,7 +422,7 @@ static int item_button(char *in)
if (!window_item("button"))
return 1;
- if (in_window("sub"))
+ if (in_window("video"))
return 1;
if (in_window("menu"))
return 1;
@@ -492,7 +495,7 @@ static int item_selected(char *in)
if (in_window("main"))
return 1;
- if (in_window("sub"))
+ if (in_window("video"))
return 1;
if (in_window("playbar"))
return 1;
@@ -536,7 +539,7 @@ static int item_menu(char *in)
if (in_window("main"))
return 1;
- if (in_window("sub"))
+ if (in_window("video"))
return 1;
if (in_window("playbar"))
return 1;
@@ -594,7 +597,7 @@ static int item_hpotmeter(char *in)
if (!window_item("h/v potmeter"))
return 1;
- if (in_window("sub"))
+ if (in_window("video"))
return 1;
if (in_window("menu"))
return 1;
@@ -710,7 +713,7 @@ static int item_potmeter(char *in)
if (!window_item("potmeter"))
return 1;
- if (in_window("sub"))
+ if (in_window("video"))
return 1;
if (in_window("menu"))
return 1;
@@ -780,7 +783,7 @@ static int item_font(char *in)
if (!window_item("font"))
return 1;
- if (in_window("sub"))
+ if (in_window("video"))
return 1;
if (in_window("menu"))
return 1;
@@ -829,7 +832,7 @@ static int item_slabel(char *in)
if (!window_item("slabel"))
return 1;
- if (in_window("sub"))
+ if (in_window("video"))
return 1;
if (in_window("menu"))
return 1;
@@ -892,7 +895,7 @@ static int item_dlabel(char *in)
if (!window_item("dlabel"))
return 1;
- if (in_window("sub"))
+ if (in_window("video"))
return 1;
if (in_window("menu"))
return 1;
@@ -954,7 +957,7 @@ static int item_decoration(char *in)
if (!window_item("decoration"))
return 1;
- if (in_window("sub"))
+ if (in_window("video"))
return 1;
if (in_window("playbar"))
return 1;
Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/ui/actions.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -45,19 +45,19 @@ void uiFullScreen(void)
if (!guiInfo.VideoWindow)
return;
- wsFullScreen(&guiApp.subWindow);
+ wsFullScreen(&guiApp.videoWindow);
- vo_fs = guiApp.subWindow.isFullScreen;
+ vo_fs = guiApp.videoWindow.isFullScreen;
- wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.subWindow.isFullScreen);
+ wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.videoWindow.isFullScreen);
if (guiApp.menuIsPresent)
- wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.subWindow.isFullScreen);
+ wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.videoWindow.isFullScreen);
if (guiInfo.Playing)
- wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0);
+ wsSetBackgroundRGB(&guiApp.videoWindow, 0, 0, 0);
else
- wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
+ wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B);
}
void uiPlay(void)
@@ -77,9 +77,9 @@ void uiPlay(void)
}
gui(GUI_SET_STATE, (void *)GUI_PLAY);
- uiSubRender = 0;
- wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0);
- wsClearWindow(guiApp.subWindow);
+ uiVideoRender = 0;
+ wsSetBackgroundRGB(&guiApp.videoWindow, 0, 0, 0);
+ wsClearWindow(guiApp.videoWindow);
}
void uiPause(void)
@@ -153,24 +153,24 @@ void uiChangeSkin(char *name)
} else
uiMenuInit();
- /* reload sub window */
+ /* reload video window */
- if (guiApp.sub.Bitmap.Image)
- wsResizeImage(&guiApp.subWindow, guiApp.sub.Bitmap.Width, guiApp.sub.Bitmap.Height);
+ if (guiApp.video.Bitmap.Image)
+ wsResizeImage(&guiApp.videoWindow, guiApp.video.Bitmap.Width, guiApp.video.Bitmap.Height);
- if (!guiApp.subWindow.isFullScreen && !guiInfo.Playing) {
- wsResizeWindow(&guiApp.subWindow, guiApp.sub.width, guiApp.sub.height);
- wsMoveWindow(&guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y);
+ if (!guiApp.videoWindow.isFullScreen && !guiInfo.Playing) {
+ wsResizeWindow(&guiApp.videoWindow, guiApp.video.width, guiApp.video.height);
+ wsMoveWindow(&guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y);
}
- if (guiApp.sub.Bitmap.Image)
- wsConvert(&guiApp.subWindow, guiApp.sub.Bitmap.Image);
+ if (guiApp.video.Bitmap.Image)
+ wsConvert(&guiApp.videoWindow, guiApp.video.Bitmap.Image);
if (!guiInfo.Playing) {
- uiSubRender = 1;
- wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
- wsClearWindow(guiApp.subWindow);
- wsPostRedisplay(&guiApp.subWindow);
+ uiVideoRender = 1;
+ wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B);
+ wsClearWindow(guiApp.videoWindow);
+ wsPostRedisplay(&guiApp.videoWindow);
}
/* reload playbar */
@@ -213,10 +213,10 @@ void uiChangeSkin(char *name)
btnModify(evSetVolume, guiInfo.Volume);
btnModify(evSetBalance, guiInfo.Balance);
btnModify(evSetMoviePosition, guiInfo.Position);
- btnSet(evFullScreen, (guiApp.subWindow.isFullScreen ? btnPressed : btnReleased));
+ btnSet(evFullScreen, (guiApp.videoWindow.isFullScreen ? btnPressed : btnReleased));
- wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.subWindow.isFullScreen);
- wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.subWindow.isFullScreen);
+ wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.videoWindow.isFullScreen);
+ wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.videoWindow.isFullScreen);
}
void uiSetFileName(char *dir, char *name, int type)
Modified: trunk/gui/ui/gmplayer.h
==============================================================================
--- trunk/gui/ui/gmplayer.h Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/ui/gmplayer.h Sat Mar 3 17:45:15 2012 (r34785)
@@ -19,7 +19,7 @@
#ifndef MPLAYER_GUI_GMPLAYER_H
#define MPLAYER_GUI_GMPLAYER_H
-extern int uiSubRender;
+extern int uiVideoRender;
extern int uiMainRender;
extern unsigned char * mainDrawBuffer;
@@ -40,8 +40,8 @@ void uiMainMouseHandle( int Button, int
void uiMainKeyHandle( int KeyCode, int Type, int Key );
void uiDandDHandler(int num, char** files);
-void uiSubDraw( void );
-void uiSubMouseHandle( int Button, int X, int Y, int RX, int RY );
+void uiVideoDraw( void );
+void uiVideoMouseHandle( int Button, int X, int Y, int RX, int RY );
void uiMenuInit( void );
void uiHideMenu( int mx, int my, int w );
Modified: trunk/gui/ui/gtk/menu.c
==============================================================================
--- trunk/gui/ui/gtk/menu.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/ui/gtk/menu.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -645,18 +645,18 @@ GtkWidget * create_PopUpMenu( void )
{
int b1 = 0, b2 = 0, b_half = 0;
AddSeparator( Menu );
- if ( !guiApp.subWindow.isFullScreen && guiInfo.Playing )
+ if ( !guiApp.videoWindow.isFullScreen && guiInfo.Playing )
{
- if ( ( guiApp.subWindow.Width == guiInfo.VideoWidth * 2 )&&
- ( guiApp.subWindow.Height == guiInfo.VideoHeight * 2 ) ) b2=1;
- else if ( ( guiApp.subWindow.Width == guiInfo.VideoWidth / 2 ) &&
- ( guiApp.subWindow.Height == guiInfo.VideoHeight / 2 ) ) b_half=1;
+ if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth * 2 )&&
+ ( guiApp.videoWindow.Height == guiInfo.VideoHeight * 2 ) ) b2=1;
+ else if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth / 2 ) &&
+ ( guiApp.videoWindow.Height == guiInfo.VideoHeight / 2 ) ) b_half=1;
else b1=1;
- } else b1=!guiApp.subWindow.isFullScreen;
+ } else b1=!guiApp.videoWindow.isFullScreen;
H=AddMenuCheckItem( window1, (const char*)half_xpm, Menu,MSGTR_MENU_HalfSize,b_half,evHalfSize );
N=AddMenuCheckItem( window1, (const char*)normal_xpm, Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize );
D=AddMenuCheckItem( window1, (const char*)double_xpm, Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize );
- F=AddMenuCheckItem( window1, (const char*)full_xpm, Menu,MSGTR_MENU_FullScreen,guiApp.subWindow.isFullScreen,evFullScreen );
+ F=AddMenuCheckItem( window1, (const char*)full_xpm, Menu,MSGTR_MENU_FullScreen,guiApp.videoWindow.isFullScreen,evFullScreen );
if ( !guiInfo.Playing )
{
gtk_widget_set_sensitive( H,FALSE );
Modified: trunk/gui/ui/gtk/preferences.c
==============================================================================
--- trunk/gui/ui/gtk/preferences.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/ui/gtk/preferences.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -726,7 +726,7 @@ static void prToggled( GtkToggleButton *
gtkActive( Preferences );
} else window=wsHideWindow;
// NOTE TO MYSELF: doesn't work with a fullscreen window
- if ( !guiInfo.Playing ) wsVisibleWindow( &guiApp.subWindow,window );
+ if ( !guiInfo.Playing ) wsVisibleWindow( &guiApp.videoWindow,window );
break;
case 4:
case 5:
Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/ui/main.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -337,56 +337,56 @@ set_volume:
switch ( iparam )
{
case 0: wsIconify( guiApp.mainWindow ); break;
- case 1: wsIconify( guiApp.subWindow ); break;
+ case 1: wsIconify( guiApp.videoWindow ); break;
}
break;
case evHalfSize:
if ( guiInfo.VideoWindow && guiInfo.Playing )
{
- if ( guiApp.subWindow.isFullScreen )
+ if ( guiApp.videoWindow.isFullScreen )
{
uiFullScreen();
}
- wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth / 2, guiInfo.VideoHeight / 2 );
- wsMoveWindow( &guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y );
+ wsResizeWindow( &guiApp.videoWindow, guiInfo.VideoWidth / 2, guiInfo.VideoHeight / 2 );
+ wsMoveWindow( &guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y );
btnSet( evFullScreen,btnReleased );
}
break;
case evDoubleSize:
if ( guiInfo.VideoWindow && guiInfo.Playing )
{
- if ( guiApp.subWindow.isFullScreen )
+ if ( guiApp.videoWindow.isFullScreen )
{
uiFullScreen();
}
- wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth * 2, guiInfo.VideoHeight * 2 );
- wsMoveWindowWithin( &guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y );
+ wsResizeWindow( &guiApp.videoWindow, guiInfo.VideoWidth * 2, guiInfo.VideoHeight * 2 );
+ wsMoveWindowWithin( &guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y );
btnSet( evFullScreen,btnReleased );
}
break;
case evNormalSize:
if ( guiInfo.VideoWindow && guiInfo.Playing )
{
- if ( guiApp.subWindow.isFullScreen )
+ if ( guiApp.videoWindow.isFullScreen )
{
uiFullScreen();
}
- wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight );
- wsMoveWindow( &guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y );
+ wsResizeWindow( &guiApp.videoWindow, guiInfo.VideoWidth, guiInfo.VideoHeight );
+ wsMoveWindow( &guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y );
btnSet( evFullScreen,btnReleased );
break;
- } else if ( !guiApp.subWindow.isFullScreen ) break;
+ } else if ( !guiApp.videoWindow.isFullScreen ) break;
case evFullScreen:
if ( guiInfo.VideoWindow && guiInfo.Playing )
{
uiFullScreen();
- if ( !guiApp.subWindow.isFullScreen )
+ if ( !guiApp.videoWindow.isFullScreen )
{
- wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight );
- wsMoveWindow( &guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y );
+ wsResizeWindow( &guiApp.videoWindow, guiInfo.VideoWidth, guiInfo.VideoHeight );
+ wsMoveWindow( &guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y );
}
}
- if ( guiApp.subWindow.isFullScreen ) btnSet( evFullScreen,btnPressed );
+ if ( guiApp.videoWindow.isFullScreen ) btnSet( evFullScreen,btnPressed );
else btnSet( evFullScreen,btnReleased );
break;
@@ -399,7 +399,7 @@ set_volume:
case 1:
default: movie_aspect=-1;
}
- wsClearWindow( guiApp.subWindow );
+ wsClearWindow( guiApp.videoWindow );
if ( guiInfo.StreamType == STREAMTYPE_VCD ) uiEventHandling( evPlayVCD, 0 );
else if ( guiInfo.StreamType == STREAMTYPE_DVD ) uiEventHandling( ivPlayDVD, 0 );
else
@@ -587,7 +587,7 @@ void uiMainKeyHandle( int KeyCode,int Ty
case wsXF86Next: msg=evNext; break;
case wsXF86Media: msg=evLoad; break;
case wsEscape:
- if ( guiInfo.VideoWindow && guiInfo.Playing && guiApp.subWindow.isFullScreen )
+ if ( guiInfo.VideoWindow && guiInfo.Playing && guiApp.videoWindow.isFullScreen )
{
uiEventHandling( evNormalSize,0 );
return;
Modified: trunk/gui/ui/playbar.c
==============================================================================
--- trunk/gui/ui/playbar.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/ui/playbar.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -62,14 +62,14 @@ static void uiPlaybarDraw( void )
{
int x;
- if ( !guiApp.subWindow.isFullScreen ) return;
+ if ( !guiApp.videoWindow.isFullScreen ) return;
if ( !playbarVisible || !guiApp.playbarIsPresent ) return;
-// guiApp.playbar.x=( guiApp.subWindow.Width - guiApp.playbar.width ) / 2;
+// guiApp.playbar.x=( guiApp.videoWindow.Width - guiApp.playbar.width ) / 2;
switch( guiApp.playbar.x )
{
- case -1: x=( guiApp.subWindow.Width - guiApp.playbar.width ) / 2; break;
- case -2: x=( guiApp.subWindow.Width - guiApp.playbar.width ); break;
+ case -1: x=( guiApp.videoWindow.Width - guiApp.playbar.width ) / 2; break;
+ case -2: x=( guiApp.videoWindow.Width - guiApp.playbar.width ); break;
default: x=guiApp.playbar.x;
}
@@ -77,9 +77,9 @@ static void uiPlaybarDraw( void )
{
case 1: // fade in
playbarLength--;
- if ( guiApp.subWindow.Height - guiApp.playbar.height >= playbarLength )
+ if ( guiApp.videoWindow.Height - guiApp.playbar.height >= playbarLength )
{
- playbarLength=guiApp.subWindow.Height - guiApp.playbar.height;
+ playbarLength=guiApp.videoWindow.Height - guiApp.playbar.height;
uiPlaybarFade=0;
vo_mouse_autohide=0;
}
@@ -87,9 +87,9 @@ static void uiPlaybarDraw( void )
break;
case 2: // fade out
playbarLength+=10;
- if ( playbarLength > guiApp.subWindow.Height )
+ if ( playbarLength > guiApp.videoWindow.Height )
{
- playbarLength=guiApp.subWindow.Height;
+ playbarLength=guiApp.videoWindow.Height;
uiPlaybarFade=playbarVisible=0;
vo_mouse_autohide=1;
wsVisibleWindow( &guiApp.playbarWindow,wsHideWindow );
@@ -230,9 +230,9 @@ potihandled:
void uiPlaybarShow( int y )
{
if ( !guiApp.playbarIsPresent || !gtkEnablePlayBar ) return;
- if ( !guiApp.subWindow.isFullScreen ) return;
+ if ( !guiApp.videoWindow.isFullScreen ) return;
- if ( y > guiApp.subWindow.Height - guiApp.playbar.height )
+ if ( y > guiApp.videoWindow.Height - guiApp.playbar.height )
{
if ( !uiPlaybarFade ) wsVisibleWindow( &guiApp.playbarWindow,wsShowWindow );
uiPlaybarFade=1; playbarVisible=1; wsPostRedisplay( &guiApp.playbarWindow );
@@ -252,7 +252,7 @@ void uiPlaybarInit( void )
mplayer( MPLAYER_EXIT_GUI, EXIT_ERROR, 0 );
}
- guiApp.playbarWindow.Parent=guiApp.subWindow.WindowID;
+ guiApp.playbarWindow.Parent=guiApp.videoWindow.WindowID;
wsCreateWindow( &guiApp.playbarWindow,
guiApp.playbar.x,guiApp.playbar.y,guiApp.playbar.width,guiApp.playbar.height,
wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsHideFrame|wsHideWindow,"PlayBar" );
@@ -263,5 +263,5 @@ void uiPlaybarInit( void )
guiApp.playbarWindow.MouseHandler=uiPlaybarMouseHandle;
guiApp.playbarWindow.KeyHandler=uiMainKeyHandle;
- playbarLength=guiApp.subWindow.Height;
+ playbarLength=guiApp.videoWindow.Height;
}
Copied and modified: trunk/gui/ui/video.c (from r34780, trunk/gui/ui/sub.c)
==============================================================================
--- trunk/gui/ui/sub.c Tue Feb 28 20:31:56 2012 (r34780, copy source)
+++ trunk/gui/ui/video.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -1,5 +1,5 @@
/*
- * sub window
+ * video window
*
* This file is part of MPlayer.
*
@@ -30,31 +30,31 @@
#include "gui/interface.h"
#include "widgets.h"
-int uiSubRender = 0;
-int subVisible = 0;
+int uiVideoRender = 0;
+int videoVisible = 0;
-void uiSubDraw( void )
+void uiVideoDraw( void )
{
- if ( guiApp.subWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 );
+ if ( guiApp.videoWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 );
- if ( guiApp.subWindow.State == wsWindowFocusIn ) subVisible++;
- if ( guiApp.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) subVisible--;
+ if ( guiApp.videoWindow.State == wsWindowFocusIn ) videoVisible++;
+ if ( guiApp.videoWindow.State == wsWindowFocusOut && metacity_hack != 3 ) videoVisible--;
- if ( !guiApp.subWindow.Mapped ||
- guiApp.subWindow.Visible == wsWindowNotVisible ) return;
+ if ( !guiApp.videoWindow.Mapped ||
+ guiApp.videoWindow.Visible == wsWindowNotVisible ) return;
- if ( guiInfo.Playing ) uiSubRender=0;
+ if ( guiInfo.Playing ) uiVideoRender=0;
- if ( uiSubRender && guiApp.subWindow.State == wsWindowExpose )
+ if ( uiVideoRender && guiApp.videoWindow.State == wsWindowExpose )
{
- if ( guiApp.sub.Bitmap.Image ) wsPutImage( &guiApp.subWindow );
+ if ( guiApp.video.Bitmap.Image ) wsPutImage( &guiApp.videoWindow );
}
- guiApp.subWindow.State=0;
+ guiApp.videoWindow.State=0;
}
-void uiSubMouseHandle( int Button,int X,int Y,int RX,int RY )
+void uiVideoMouseHandle( int Button,int X,int Y,int RX,int RY )
{
- static int mplSubMoved = 0;
+ static int mplVideoMoved = 0;
static int msButton = 0;
uiPlaybarShow( Y );
@@ -78,18 +78,18 @@ void uiSubMouseHandle( int Button,int X,
gtkShow( ivHidePopUpMenu,NULL );
sx=X; sy=Y;
msButton=wsPLMouseButton;
- mplSubMoved=0;
+ mplVideoMoved=0;
break;
case wsMoveMouse:
switch ( msButton )
{
case wsPLMouseButton:
- mplSubMoved=1;
- if ( !guiApp.subWindow.isFullScreen )
+ mplVideoMoved=1;
+ if ( !guiApp.videoWindow.isFullScreen )
{
- wsMoveWindow( &guiApp.subWindow,True,RX - sx,RY - sy );
- guiApp.sub.x = guiApp.subWindow.X;
- guiApp.sub.y = guiApp.subWindow.Y;
+ wsMoveWindow( &guiApp.videoWindow,True,RX - sx,RY - sy );
+ guiApp.video.x = guiApp.videoWindow.X;
+ guiApp.video.y = guiApp.videoWindow.Y;
// NOTE TO MYSELF: dragging the title bar goes unnoticed?
}
break;
@@ -100,13 +100,13 @@ void uiSubMouseHandle( int Button,int X,
}
break;
case wsRLMouseButton:
- if ( ( !mplSubMoved )&&( guiApp.subWindow.isFullScreen ) )
+ if ( ( !mplVideoMoved )&&( guiApp.videoWindow.isFullScreen ) )
{
- if( subVisible++%2 ) wsRaiseWindowTop( wsDisplay,guiApp.mainWindow.WindowID );
- else wsRaiseWindowTop( wsDisplay,guiApp.subWindow.WindowID );
+ if( videoVisible++%2 ) wsRaiseWindowTop( wsDisplay,guiApp.mainWindow.WindowID );
+ else wsRaiseWindowTop( wsDisplay,guiApp.videoWindow.WindowID );
}
msButton=0;
- mplSubMoved=0;
+ mplVideoMoved=0;
break;
}
}
Modified: trunk/gui/ui/widgets.c
==============================================================================
--- trunk/gui/ui/widgets.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/ui/widgets.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -237,7 +237,7 @@ void gtkMessageBox(int type, const gchar
void gtkSetLayer(GtkWidget *wdg)
{
- wsSetLayer(gdk_display, GDK_WINDOW_XWINDOW(wdg->window), guiApp.subWindow.isFullScreen);
+ wsSetLayer(gdk_display, GDK_WINDOW_XWINDOW(wdg->window), guiApp.videoWindow.isFullScreen);
gtkActive(wdg);
}
Modified: trunk/gui/win32/dialogs.c
==============================================================================
--- trunk/gui/win32/dialogs.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/win32/dialogs.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -721,7 +721,7 @@ static LRESULT CALLBACK SkinBrowserWndPr
Shell_NotifyIcon(NIM_DELETE, &nid);
destroy_window(mygui);
create_window(mygui, skinspath);
- create_subwindow(mygui);
+ create_videowindow(mygui);
SendMessage(hwnd, WM_CLOSE, 0, 0); /* Avoid crashing when switching skin */
}
}
Modified: trunk/gui/win32/dialogs.h
==============================================================================
--- trunk/gui/win32/dialogs.h Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/win32/dialogs.h Sat Mar 3 17:45:15 2012 (r34785)
@@ -116,7 +116,7 @@
#define ID_ASPECT2 84
#define ID_ASPECT3 85
#define ID_ASPECT4 86
-#define ID_SUBWINDOW 87
+#define ID_VIDEOWINDOW 87
#define ID_TIMER 88
#define ID_MUTE 89
#define ID_FULLSCREEN 90
Modified: trunk/gui/win32/gui.c
==============================================================================
--- trunk/gui/win32/gui.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/win32/gui.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -59,7 +59,7 @@
#endif
/* Globals / Externs */
-float sub_aspect;
+float video_aspect;
DWORD oldtime;
NOTIFYICONDATA nid;
@@ -344,10 +344,10 @@ static void updatedisplay(gui_t *gui, HW
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE);
}
-static LRESULT CALLBACK SubProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK VideoProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
gui_t *gui = (gui_t *) GetWindowLongPtr(hWnd, GWLP_USERDATA);
- if (gui && (gui->subwindow != hWnd)) return FALSE;
+ if (gui && (gui->videowindow != hWnd)) return FALSE;
switch (message)
{
@@ -507,7 +507,7 @@ static LRESULT CALLBACK SubProc(HWND hWn
gui->playlist->add_track(gui->playlist, (const char *) wParam, NULL, NULL, 0);
gui->playercontrol(evLoadPlay);
}
- SetForegroundWindow(gui->subwindow);
+ SetForegroundWindow(gui->videowindow);
return 0;
}
case WM_LBUTTONDOWN:
@@ -530,7 +530,7 @@ static LRESULT CALLBACK SubProc(HWND hWn
ClientToScreen(hWnd, &point);
if(guiInfo.StreamType == STREAMTYPE_DVD)
EnableMenuItem(gui->dvdmenu, ID_CHAPTERSEL, MF_BYCOMMAND | MF_ENABLED);
- TrackPopupMenu(gui->submenu, 0, point.x, point.y, 0, hWnd, NULL);
+ TrackPopupMenu(gui->videomenu, 0, point.x, point.y, 0, hWnd, NULL);
return 0;
}
case WM_LBUTTONDBLCLK:
@@ -610,11 +610,11 @@ static LRESULT CALLBACK SubProc(HWND hWn
rect_height = rd.bottom - rd.top;
/* maintain our aspect ratio */
- tmpheight = ((float)rect_width/sub_aspect);
+ tmpheight = ((float)rect_width/video_aspect);
tmpheight += tmpheight % 2;
if(tmpheight > rect_height)
{
- rect_width = ((float)rect_height*sub_aspect);
+ rect_width = ((float)rect_height*video_aspect);
rect_width += rect_width % 2;
}
else rect_height = tmpheight;
@@ -656,7 +656,7 @@ static LRESULT CALLBACK SubProc(HWND hWn
window *desc = NULL;
for (i=0; i<gui->skin->windowcount; i++)
- if(gui->skin->windows[i]->type == wiSub)
+ if(gui->skin->windows[i]->type == wiVideo)
desc = gui->skin->windows[i];
SelectObject(hMemDC, get_bitmap(hWnd));
@@ -1140,12 +1140,12 @@ int destroy_window(gui_t *gui)
gui_main_pos_x = rd.left;
gui_main_pos_y = rd.top;
- /* sub window position */
- if(IsIconic(gui->subwindow))
- ShowWindow(gui->subwindow, SW_SHOWNORMAL);
- GetWindowRect(gui->subwindow, &rd);
- gui_sub_pos_x = rd.left;
- gui_sub_pos_y = rd.top;
+ /* video window position */
+ if(IsIconic(gui->videowindow))
+ ShowWindow(gui->videowindow, SW_SHOWNORMAL);
+ GetWindowRect(gui->videowindow, &rd);
+ gui_video_pos_x = rd.left;
+ gui_video_pos_y = rd.top;
for(i=0; i<gui->window_priv_count; i++)
{
@@ -1161,10 +1161,10 @@ int destroy_window(gui_t *gui)
DestroyWindow(gui->mainwindow);
gui->mainwindow = NULL;
- /* destroy the sub window */
- if(gui->subwindow)
- DestroyWindow(gui->subwindow);
- gui->subwindow = NULL;
+ /* destroy the video window */
+ if(gui->videowindow)
+ DestroyWindow(gui->videowindow);
+ gui->videowindow = NULL;
UnregisterClass(gui->classname, 0);
DestroyIcon(gui->icon);
@@ -1226,28 +1226,28 @@ static void create_traymenu(gui_t *gui)
AppendMenu(gui->traymenu, MF_STRING, IDEXIT, acp(MSGTR_MENU_Exit));
}
-static void create_submenu(gui_t *gui)
+static void create_videomenu(gui_t *gui)
{
- gui->submenu = CreatePopupMenu();
+ gui->videomenu = CreatePopupMenu();
gui->dvdmenu = CreatePopupMenu();
gui->aspectmenu = CreatePopupMenu();
gui->subtitlemenu = CreatePopupMenu();
- AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->trayplaymenu, acp(MSGTR_MENU_Open));
- AppendMenu(gui->submenu, MF_SEPARATOR, 0, 0);
- AppendMenu(gui->submenu, MF_STRING, ID_SEEKB, acp(MSGTR_MENU_SeekBack));
- AppendMenu(gui->submenu, MF_STRING, ID_PTRACK, acp(MSGTR_MENU_PrevStream));
- AppendMenu(gui->submenu, MF_STRING, ID_PLAY, acp(MSGTR_MENU_Play "/" MSGTR_MENU_Pause));
- AppendMenu(gui->submenu, MF_STRING, ID_STOP, acp(MSGTR_MENU_Stop));
- AppendMenu(gui->submenu, MF_STRING, ID_NTRACK, acp(MSGTR_MENU_NextStream));
- AppendMenu(gui->submenu, MF_STRING, ID_SEEKF, acp(MSGTR_MENU_SeekForw));
- AppendMenu(gui->submenu, MF_SEPARATOR, 0, 0);
- AppendMenu(gui->submenu, MF_STRING, ID_FULLSCREEN, acp(MSGTR_MENU_FullScreen));
- AppendMenu(gui->submenu, MF_STRING, ID_MUTE, acp(MSGTR_MENU_Mute));
- AppendMenu(gui->submenu, MF_SEPARATOR, 0, 0);
- AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->aspectmenu, acp(MSGTR_MENU_AspectRatio));
- AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->subtitlemenu, acp(MSGTR_MENU_Subtitles));
+ AppendMenu(gui->videomenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->trayplaymenu, acp(MSGTR_MENU_Open));
+ AppendMenu(gui->videomenu, MF_SEPARATOR, 0, 0);
+ AppendMenu(gui->videomenu, MF_STRING, ID_SEEKB, acp(MSGTR_MENU_SeekBack));
+ AppendMenu(gui->videomenu, MF_STRING, ID_PTRACK, acp(MSGTR_MENU_PrevStream));
+ AppendMenu(gui->videomenu, MF_STRING, ID_PLAY, acp(MSGTR_MENU_Play "/" MSGTR_MENU_Pause));
+ AppendMenu(gui->videomenu, MF_STRING, ID_STOP, acp(MSGTR_MENU_Stop));
+ AppendMenu(gui->videomenu, MF_STRING, ID_NTRACK, acp(MSGTR_MENU_NextStream));
+ AppendMenu(gui->videomenu, MF_STRING, ID_SEEKF, acp(MSGTR_MENU_SeekForw));
+ AppendMenu(gui->videomenu, MF_SEPARATOR, 0, 0);
+ AppendMenu(gui->videomenu, MF_STRING, ID_FULLSCREEN, acp(MSGTR_MENU_FullScreen));
+ AppendMenu(gui->videomenu, MF_STRING, ID_MUTE, acp(MSGTR_MENU_Mute));
+ AppendMenu(gui->videomenu, MF_SEPARATOR, 0, 0);
+ AppendMenu(gui->videomenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->aspectmenu, acp(MSGTR_MENU_AspectRatio));
+ AppendMenu(gui->videomenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->subtitlemenu, acp(MSGTR_MENU_Subtitles));
#ifdef CONFIG_DVDREAD
- AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->dvdmenu, acp(MSGTR_MENU_DVD));
+ AppendMenu(gui->videomenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->dvdmenu, acp(MSGTR_MENU_DVD));
AppendMenu(gui->dvdmenu, MF_STRING | MF_GRAYED, ID_CHAPTERSEL, acp(MSGTR_SelectTitleChapter));
#endif
AppendMenu(gui->subtitlemenu, MF_STRING, IDSUB_TOGGLE, acp(MSGTR_MENU_SubtitlesOnOff));
@@ -1257,8 +1257,8 @@ static void create_submenu(gui_t *gui)
AppendMenu(gui->aspectmenu, MF_STRING, ID_ASPECT3, "2.35");
AppendMenu(gui->aspectmenu, MF_SEPARATOR, 0, 0);
AppendMenu(gui->aspectmenu, MF_STRING, ID_ASPECT4, acp(MSGTR_MENU_Original));
- AppendMenu(gui->submenu, MF_SEPARATOR, 0, 0);
- AppendMenu(gui->submenu, MF_STRING, IDEXIT, acp(MSGTR_MENU_Exit));
+ AppendMenu(gui->videomenu, MF_SEPARATOR, 0, 0);
+ AppendMenu(gui->videomenu, MF_STRING, IDEXIT, acp(MSGTR_MENU_Exit));
}
static void maketransparent(HWND hwnd, COLORREF crTransparent)
@@ -1369,8 +1369,8 @@ static int window_render(gui_t *gui, HWN
return 0;
}
-/* creates the sub (AKA video) window,*/
-int create_subwindow(gui_t *gui)
+/* creates the video window */
+int create_videowindow(gui_t *gui)
{
HINSTANCE instance = GetModuleHandle(NULL);
WNDCLASS wc;
@@ -1385,7 +1385,7 @@ int create_subwindow(gui_t *gui)
vo_colorkey = 0xff00ff;
for (i=0; i<gui->skin->windowcount; i++)
- if(gui->skin->windows[i]->type == wiSub)
+ if(gui->skin->windows[i]->type == wiVideo)
desc = gui->skin->windows[i];
if(!desc)
@@ -1397,7 +1397,7 @@ int create_subwindow(gui_t *gui)
windowcolor = vo_colorkey;
colorbrush = CreateSolidBrush(windowcolor);
wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
- wc.lpfnWndProc = SubProc;
+ wc.lpfnWndProc = VideoProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = instance;
@@ -1408,23 +1408,23 @@ int create_subwindow(gui_t *gui)
wc.lpszMenuName = NULL;
RegisterClass(&wc);
- /* create the sub window menu */
- create_submenu(gui);
+ /* create the video window menu */
+ create_videomenu(gui);
rect.top = rect.left = 100;
rect.bottom = rect.top+desc->base->bitmap[0]->height;
rect.right = rect.left+desc->base->bitmap[0]->width;
/* our window aspect */
- sub_aspect = (float)(rect.right-rect.left)/(rect.bottom-rect.top);
+ video_aspect = (float)(rect.right-rect.left)/(rect.bottom-rect.top);
style = fullscreen?WS_VISIBLE | WS_POPUP:WS_OVERLAPPEDWINDOW | WS_SYSMENU | WS_MINIMIZEBOX;
AdjustWindowRect(&rect, style, 0);
- if (gui_sub_pos_x >= 0)
- x = gui_sub_pos_x;
- if (gui_sub_pos_y >= 0)
- y = gui_sub_pos_y;
+ if (gui_video_pos_x >= 0)
+ x = gui_video_pos_x;
+ if (gui_video_pos_y >= 0)
+ y = gui_video_pos_y;
/* out of bounds check */
if (x <= -1 || (x+(rect.right-rect.left) > GetSystemMetrics(SM_CXSCREEN)))
@@ -1434,7 +1434,7 @@ int create_subwindow(gui_t *gui)
hWnd = CreateWindowEx(0, "MPlayer - Video", "MPlayer - Video", style,
x, y, rect.right-rect.left, rect.bottom-rect.top,
- gui->subwindow, NULL, instance, NULL);
+ gui->videowindow, NULL, instance, NULL);
/* load all the window images */
window_render(gui, hWnd, hdc, priv, desc, binfo);
@@ -1442,11 +1442,11 @@ int create_subwindow(gui_t *gui)
/* enable drag and drop support */
DragAcceptFiles(hWnd, TRUE);
- gui->subwindow = hWnd;
- if(sub_window)
- WinID = gui->subwindow;
- ShowWindow(gui->subwindow, SW_SHOW);
- UpdateWindow(gui->subwindow);
+ gui->videowindow = hWnd;
+ if(video_window)
+ WinID = gui->videowindow;
+ ShowWindow(gui->videowindow, SW_SHOW);
+ UpdateWindow(gui->videowindow);
return 0;
}
@@ -1601,7 +1601,7 @@ gui_t *create_gui(char *skindir, void (*
sprintf(temp, "%s/%s", skindir, skinName);
if(create_window(gui, temp)) return NULL;
- if(create_subwindow(gui)) return NULL;
+ if(create_videowindow(gui)) return NULL;
if(console) console_toggle();
return gui;
}
Modified: trunk/gui/win32/gui.h
==============================================================================
--- trunk/gui/win32/gui.h Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/win32/gui.h Sat Mar 3 17:45:15 2012 (r34785)
@@ -31,9 +31,9 @@
#include "skinload.h"
#include "playlist.h"
-extern float sub_aspect;
+extern float video_aspect;
extern play_tree_t* playtree;
-extern int sub_window;
+extern int video_window;
extern int console;
extern NOTIFYICONDATA nid;
extern char *codecname;
@@ -60,7 +60,7 @@ struct gui_t
window_priv_t **window_priv;
HWND mainwindow;
- HWND subwindow;
+ HWND videowindow;
/* for event handling */
widget *activewidget;
@@ -73,7 +73,7 @@ struct gui_t
HMENU traymenu;
HMENU trayplaymenu;
HMENU trayplaybackmenu;
- HMENU submenu;
+ HMENU videomenu;
HMENU subtitlemenu;
HMENU aspectmenu;
HMENU dvdmenu;
@@ -101,7 +101,7 @@ struct gui_t
gui_t *create_gui(char *skindir, void (*playercontrol)(int event));
int destroy_window(gui_t *gui);
int create_window(gui_t *gui, char *skindir);
-int create_subwindow(gui_t *gui);
+int create_videowindow(gui_t *gui);
int parse_filename(char *file, play_tree_t *playtree, m_config_t *mconfig, int clear);
void capitalize(char *filename);
LPSTR acp(LPCSTR utf8);
Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/win32/interface.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -79,7 +79,7 @@ char *skinName = NULL;
char *codecname = NULL;
int uiGotoTheNext = 1;
static gui_t *mygui = NULL;
-static int update_subwindow(void);
+static int update_videowindow(void);
static RECT old_rect;
static DWORD style;
static HANDLE hThread;
@@ -477,10 +477,10 @@ void uiFullScreen( void )
{
if(!guiInfo.sh_video) return;
- if(sub_window)
+ if(video_window)
{
- if(!fullscreen && IsWindowVisible(mygui->subwindow) && !IsIconic(mygui->subwindow))
- GetWindowRect(mygui->subwindow, &old_rect);
+ if(!fullscreen && IsWindowVisible(mygui->videowindow) && !IsIconic(mygui->videowindow))
+ GetWindowRect(mygui->videowindow, &old_rect);
if(fullscreen)
{
@@ -490,11 +490,11 @@ void uiFullScreen( void )
fullscreen = 1;
style = WS_VISIBLE | WS_POPUP;
}
- SetWindowLong(mygui->subwindow, GWL_STYLE, style);
- update_subwindow();
+ SetWindowLong(mygui->videowindow, GWL_STYLE, style);
+ update_videowindow();
}
video_out->control(VOCTRL_FULLSCREEN, 0);
- if(sub_window) ShowWindow(mygui->subwindow, SW_SHOW);
+ if(video_window) ShowWindow(mygui->videowindow, SW_SHOW);
}
static unsigned __stdcall GuiThread(void* param)
@@ -618,8 +618,8 @@ int gui(int what, void *data)
case GUI_SET_AUDIO:
{
if (data && !guiInfo.sh_video) guiInfo.VideoWindow = 0;
- if(IsWindowVisible(mygui->subwindow) && !guiInfo.VideoWindow)
- ShowWindow(mygui->subwindow, SW_HIDE);
+ if(IsWindowVisible(mygui->videowindow) && !guiInfo.VideoWindow)
+ ShowWindow(mygui->videowindow, SW_HIDE);
break;
}
case GUI_SET_CONTEXT:
@@ -633,11 +633,11 @@ int gui(int what, void *data)
sh_video_t *sh = data;
codecname = sh->codec->name;
- /* we have video, show the subwindow */
- if(!IsWindowVisible(mygui->subwindow) || IsIconic(mygui->subwindow))
- ShowWindow(mygui->subwindow, SW_SHOWNORMAL);
+ /* we have video, show the video window */
+ if(!IsWindowVisible(mygui->videowindow) || IsIconic(mygui->videowindow))
+ ShowWindow(mygui->videowindow, SW_SHOWNORMAL);
if(WinID == -1)
- update_subwindow();
+ update_videowindow();
}
break;
@@ -647,9 +647,9 @@ int gui(int what, void *data)
guiInfo.VideoWidth = vo_dwidth;
guiInfo.VideoHeight = vo_dheight;
- sub_aspect = (float)guiInfo.VideoWidth/guiInfo.VideoHeight;
+ video_aspect = (float)guiInfo.VideoWidth/guiInfo.VideoHeight;
if(WinID != -1)
- update_subwindow();
+ update_videowindow();
break;
}
case GUI_SET_STREAM:
@@ -699,7 +699,7 @@ int gui(int what, void *data)
guiInfo.Playing = GUI_STOP;
if(movie_aspect >= 0)
movie_aspect = -1;
- update_subwindow();
+ update_videowindow();
break;
}
case GUI_PAUSE:
@@ -799,7 +799,7 @@ int gui(int what, void *data)
if(style == WS_VISIBLE | WS_POPUP)
{
style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
- SetWindowLong(mygui->subwindow, GWL_STYLE, style);
+ SetWindowLong(mygui->videowindow, GWL_STYLE, style);
}
gui(GUI_SET_STATE, (void *) GUI_STOP);
break;
@@ -890,37 +890,37 @@ int guiPlaylistAdd(play_tree_t *my_playt
return result;
}
-static int update_subwindow(void)
+static int update_videowindow(void)
{
int x,y;
RECT rd;
WINDOWPOS wp;
- if(!sub_window)
+ if(!video_window)
{
WinID = -1;
- if(IsWindowVisible(mygui->subwindow) && guiInfo.sh_video && guiInfo.Playing)
+ if(IsWindowVisible(mygui->videowindow) && guiInfo.sh_video && guiInfo.Playing)
{
- ShowWindow(mygui->subwindow, SW_HIDE);
+ ShowWindow(mygui->videowindow, SW_HIDE);
return 0;
}
else if(!guiInfo.VideoWindow)
return 0;
- else ShowWindow(mygui->subwindow, SW_SHOW);
+ else ShowWindow(mygui->videowindow, SW_SHOW);
}
/* we've come out of fullscreen at the end of file */
- if((!IsWindowVisible(mygui->subwindow) || IsIconic(mygui->subwindow)) && guiInfo.VideoWindow)
- ShowWindow(mygui->subwindow, SW_SHOWNORMAL);
+ if((!IsWindowVisible(mygui->videowindow) || IsIconic(mygui->videowindow)) && guiInfo.VideoWindow)
+ ShowWindow(mygui->videowindow, SW_SHOWNORMAL);
/* get our current window coordinates */
- GetWindowRect(mygui->subwindow, &rd);
+ GetWindowRect(mygui->videowindow, &rd);
x = rd.left;
y = rd.top;
- /* restore sub window position when coming out of fullscreen */
+ /* restore video window position when coming out of fullscreen */
if(x <= 0) x = old_rect.left;
if(y <= 0) y = old_rect.top;
@@ -930,12 +930,12 @@ static int update_subwindow(void)
int i;
for (i=0; i<mygui->skin->windowcount; i++)
- if(mygui->skin->windows[i]->type == wiSub)
+ if(mygui->skin->windows[i]->type == wiVideo)
desc = mygui->skin->windows[i];
rd.right = rd.left+desc->base->bitmap[0]->width;
rd.bottom = rd.top+desc->base->bitmap[0]->height;
- sub_aspect = (float)(rd.right-rd.left)/(rd.bottom-rd.top);
+ video_aspect = (float)(rd.right-rd.left)/(rd.bottom-rd.top);
}
else
{
@@ -943,14 +943,14 @@ static int update_subwindow(void)
rd.bottom = rd.top+guiInfo.VideoHeight;
if (movie_aspect > 0.0) // forced aspect from the cmdline
- sub_aspect = movie_aspect;
+ video_aspect = movie_aspect;
}
AdjustWindowRect(&rd, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, 0);
- SetWindowPos(mygui->subwindow, 0, x, y, rd.right-rd.left, rd.bottom-rd.top, SWP_NOOWNERZORDER);
+ SetWindowPos(mygui->videowindow, 0, x, y, rd.right-rd.left, rd.bottom-rd.top, SWP_NOOWNERZORDER);
- wp.hwnd = mygui->subwindow;
+ wp.hwnd = mygui->videowindow;
wp.x = rd.left;
wp.y = rd.top;
wp.cx = rd.right-rd.left;
@@ -959,9 +959,9 @@ static int update_subwindow(void)
/* erase the bitmap image if there's video */
if(guiInfo.Playing != GUI_STOP && guiInfo.sh_video)
- SendMessage(mygui->subwindow, WM_ERASEBKGND, (WPARAM)GetDC(mygui->subwindow), 0);
+ SendMessage(mygui->videowindow, WM_ERASEBKGND, (WPARAM)GetDC(mygui->videowindow), 0);
/* reset the window aspect */
- SendMessage(mygui->subwindow, WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp);
+ SendMessage(mygui->videowindow, WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp);
return 0;
}
Modified: trunk/gui/win32/preferences.c
==============================================================================
--- trunk/gui/win32/preferences.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/win32/preferences.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -51,7 +51,7 @@ static void set_defaults(void)
gtkAOExtraStereo = 0;
gtkAOExtraStereoMul = 1.0;
audio_delay = 0.0;
- sub_window = 1;
+ video_window = 1;
gtkCacheOn = 0;
gtkCacheSize = 2048;
gtkAutoSyncOn = 0;
@@ -219,10 +219,10 @@ static LRESULT CALLBACK PrefsWndProc(HWN
NULL);
SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
- btn = CreateWindow("button", acp(MSGTR_PREFERENCES_VideoInSubwin),
+ btn = CreateWindow("button", acp(MSGTR_PREFERENCES_ShowInVideoWin),
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
10, 249, 250, 25,
- hwnd, (HMENU) ID_SUBWINDOW,
+ hwnd, (HMENU) ID_VIDEOWINDOW,
((LPCREATESTRUCT) lParam) -> hInstance,
NULL);
SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
@@ -429,8 +429,8 @@ static LRESULT CALLBACK PrefsWndProc(HWN
else gtkAutoSync = 0;
SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETPOS32, 0, (LPARAM)gtkAutoSync);
- if(sub_window)
- SendDlgItemMessage(hwnd, ID_SUBWINDOW, BM_SETCHECK, 1, 0);
+ if(video_window)
+ SendDlgItemMessage(hwnd, ID_VIDEOWINDOW, BM_SETCHECK, 1, 0);
if(!osd_level)
SendDlgItemMessage(hwnd, ID_NONE, BM_SETCHECK, 1, 0);
@@ -529,7 +529,7 @@ static LRESULT CALLBACK PrefsWndProc(HWN
SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_SETCHECK, 0, 0);
SendDlgItemMessage(hwnd, ID_CACHE, BM_SETCHECK, 0, 0);
SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_SETCHECK, 0, 0);
- SendDlgItemMessage(hwnd, ID_SUBWINDOW, BM_SETCHECK, 1, 0);
+ SendDlgItemMessage(hwnd, ID_VIDEOWINDOW, BM_SETCHECK, 1, 0);
SendDlgItemMessage(hwnd, ID_NONE, BM_SETCHECK, 0, 0);
SendDlgItemMessage(hwnd, ID_OSD1, BM_SETCHECK, 1, 0);
SendDlgItemMessage(hwnd, ID_OSD2, BM_SETCHECK, 0, 0);
@@ -617,10 +617,10 @@ static LRESULT CALLBACK PrefsWndProc(HWN
else gtkAutoSyncOn = 0;
gtkAutoSync = SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_GETPOS32, 0, 0);
- /* sub window */
- if(SendDlgItemMessage(hwnd, ID_SUBWINDOW, BM_GETCHECK, 0, 0) == BST_CHECKED)
- sub_window = 1;
- else sub_window = 0;
+ /* video window */
+ if(SendDlgItemMessage(hwnd, ID_VIDEOWINDOW, BM_GETCHECK, 0, 0) == BST_CHECKED)
+ video_window = 1;
+ else video_window = 0;
/* osd level */
if(SendDlgItemMessage(hwnd, ID_NONE, BM_GETCHECK, 0, 0) == BST_CHECKED)
Modified: trunk/gui/win32/skinload.c
==============================================================================
--- trunk/gui/win32/skinload.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/win32/skinload.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -618,9 +618,9 @@ skin_t* loadskin(char* skindir, int desk
mywindow = skin->windows[(skin->windowcount) - 1] = calloc(1, sizeof(window));
mywindow->name = strdup(desc + 7);
if(!strncmp(desc + 7, "main", 4)) mywindow->type = wiMain;
- else if(!strncmp(desc+7, "sub", 3))
+ else if(!strncmp(desc+7, "video", 5) || !strncmp(desc+7, "sub", 3)) // legacy
{
- mywindow->type = wiSub;
+ mywindow->type = wiVideo;
mywindow->decoration = 1;
}
else if(!strncmp(desc + 7, "menu", 4)) mywindow->type = wiMenu;
Modified: trunk/gui/win32/skinload.h
==============================================================================
--- trunk/gui/win32/skinload.h Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/win32/skinload.h Sat Mar 3 17:45:15 2012 (r34785)
@@ -126,7 +126,7 @@ skin_t *loadskin(char *skindir, int desk
/* --- Window types --- */
#define wiMain 1
-#define wiSub 2
+#define wiVideo 2
#define wiMenu 3
#define wiPlaybar 4
Modified: trunk/gui/win32/wincfg.c
==============================================================================
--- trunk/gui/win32/wincfg.c Sat Mar 3 15:03:18 2012 (r34784)
+++ trunk/gui/win32/wincfg.c Sat Mar 3 17:45:15 2012 (r34785)
@@ -49,14 +49,14 @@ int gtkCacheSize = 2048;
int gtkAutoSyncOn = 0;
int gtkAutoSync = 0;
-int sub_window = 1;
+int video_window = 1;
int console = 0;
int gui_save_pos = 1;
int gui_main_pos_x = -2;
int gui_main_pos_y = -2;
-int gui_sub_pos_x = -1;
-int gui_sub_pos_y = -1;
+int gui_video_pos_x = -1;
+int gui_video_pos_y = -1;
m_config_t *gui_conf;
static const m_option_t gui_opts[] =
@@ -80,9 +80,9 @@ static const m_option_t gui_opts[] =
{ "gui_skin", &skinName, CONF_TYPE_STRING, 0, 0, 0, NULL },
{ "gui_main_pos_x", &gui_main_pos_x, CONF_TYPE_INT, 0, 0, 0, NULL },
{ "gui_main_pos_y", &gui_main_pos_y, CONF_TYPE_INT, 0, 0, 0, NULL },
- { "gui_sub_pos_x", &gui_sub_pos_x, CONF_TYPE_INT, 0, 0, 0, NULL },
- { "gui_sub_pos_y", &gui_sub_pos_y, CONF_TYPE_INT, 0, 0, 0, NULL },
- { "sub_window", &sub_window, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+ { "gui_sub_pos_x", &gui_video_pos_x, CONF_TYPE_INT, 0, 0, 0, NULL },
+ { "gui_sub_pos_y", &gui_video_pos_y, CONF_TYPE_INT, 0, 0, 0, NULL },
+ { "sub_window", &video_window, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{ "console", &console, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{ "idle", &player_idle_mode, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{ NULL, NULL, 0, 0, 0, 0, NULL }
1
0
Author: reimar
Date: Sat Mar 3 15:03:18 2012
New Revision: 34784
Log:
Add suboption parsing support to ao_pulse and add an
option to override auto-detection of broken pause detection.
Modified:
trunk/libao2/ao_pulse.c
Changes in other areas also in this revision:
Modified:
trunk/DOCS/man/en/mplayer.1
Modified: trunk/libao2/ao_pulse.c
==============================================================================
--- trunk/libao2/ao_pulse.c Sat Mar 3 14:44:46 2012 (r34783)
+++ trunk/libao2/ao_pulse.c Sat Mar 3 15:03:18 2012 (r34784)
@@ -30,6 +30,7 @@
#include "mp_msg.h"
#include "audio_out.h"
#include "audio_out_internal.h"
+#include "subopt-helper.h"
#define PULSE_CLIENT_NAME "MPlayer"
@@ -134,6 +135,11 @@ static const struct format_map_s {
{AF_FORMAT_UNKNOWN, 0}
};
+static const opt_t subopts[] = {
+ {"broken_pause", OPT_ARG_BOOL, &broken_pause, NULL},
+ {NULL}
+};
+
static int init(int rate_hz, int channels, int format, int flags) {
struct pa_sample_spec ss;
struct pa_channel_map map;
@@ -143,22 +149,31 @@ static int init(int rate_hz, int channel
char *sink = NULL;
const char *version = pa_get_library_version();
+ broken_pause = -1;
if (ao_subdevice) {
+ char *opts;
devarg = strdup(ao_subdevice);
sink = strchr(devarg, ':');
if (sink) *sink++ = 0;
if (devarg[0]) host = devarg;
+ opts = strchr(sink, ':');
+ if (opts) {
+ *opts++ = 0;
+ if (!sink[0]) sink = NULL;
+ if (subopt_parse(opts, subopts))
+ goto fail;
+ }
}
- broken_pause = 0;
// not sure which versions are affected, assume 0.9.11* to 0.9.14*
// known bad: 0.9.14, 0.9.13
// known good: 0.9.9, 0.9.10, 0.9.15
// to test: pause, wait ca. 5 seconds framestep and see if MPlayer hangs somewhen
- if (strncmp(version, "0.9.1", 5) == 0 && version[5] >= '1' && version[5] <= '4') {
+ if (broken_pause == -1)
+ broken_pause = strncmp(version, "0.9.1", 5) == 0 && version[5] >= '1' && version[5] <= '4';
+ if (broken_pause) {
mp_msg(MSGT_AO, MSGL_WARN, "[pulse] working around probably broken pause functionality,\n"
" see http://www.pulseaudio.org/ticket/440\n");
- broken_pause = 1;
}
ss.channels = channels;
1
0