From 37c6f0d36cab8654c68c6e6ab280bb20871d0464 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 15 Mar 2009 16:12:05 +0000 Subject: 100l fix calculation of dropped frames, number of frames is time * fps, not time / fps. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28962 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/tvi_v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stream') diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c index 0742135740..a5485bf07f 100644 --- a/stream/tvi_v4l2.c +++ b/stream/tvi_v4l2.c @@ -1126,7 +1126,7 @@ static int uninit(priv_t *priv) struct v4l2_buffer buf; /* get performance */ - frames = 1 + lrintf((double)(priv->curr_frame - priv->first_frame) / (1e6 * getfps(priv))); + frames = 1 + lrintf((double)(priv->curr_frame - priv->first_frame) / 1e6 * getfps(priv)); dropped = frames - priv->frames; /* turn off streaming */ -- cgit v1.2.3 From b397b28b31e8a57b71f90ef31dbdafad25fd5820 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 16 Mar 2009 17:12:29 +0000 Subject: Add TVI_CONTROL_VID_SET_WIDTH_HEIGHT to set width and height together for v4l2, otherwise some drivers will always stay stuck in the lowest resolution. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28975 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/tv.c | 6 ++++++ stream/tv.h | 1 + stream/tvi_v4l2.c | 8 ++++++++ 3 files changed, 15 insertions(+) (limited to 'stream') diff --git a/stream/tv.c b/stream/tv.c index 58321d5302..7e8ae530d4 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -439,6 +439,12 @@ static int open_tv(tvi_handle_t *tvh) #endif /* limits on w&h are norm-dependent -- JM */ + if (tvh->tv_param->width != -1 && tvh->tv_param->height != -1) { + // first tell the driver both width and height, some drivers do not support setting them independently. + int dim[2]; + dim[0] = tvh->tv_param->width; dim[1] = tvh->tv_param->height; + funcs->control(tvh->priv, TVI_CONTROL_VID_SET_WIDTH_HEIGHT, dim); + } /* set width */ if (tvh->tv_param->width != -1) { diff --git a/stream/tv.h b/stream/tv.h index 37c63b7a89..c7ffae032c 100644 --- a/stream/tv.h +++ b/stream/tv.h @@ -175,6 +175,7 @@ typedef struct { #define TVI_CONTROL_VID_SET_PICTURE 0x11e #define TVI_CONTROL_VID_SET_GAIN 0x11f #define TVI_CONTROL_VID_GET_GAIN 0x120 +#define TVI_CONTROL_VID_SET_WIDTH_HEIGHT 0x121 /* TUNER controls */ #define TVI_CONTROL_TUN_GET_FREQ 0x201 diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c index a5485bf07f..c890d7a51e 100644 --- a/stream/tvi_v4l2.c +++ b/stream/tvi_v4l2.c @@ -780,6 +780,14 @@ static int control(priv_t *priv, int cmd, void *arg) return TVI_CONTROL_TRUE; case TVI_CONTROL_VID_CHK_WIDTH: return TVI_CONTROL_TRUE; + case TVI_CONTROL_VID_SET_WIDTH_HEIGHT: + if (getfmt(priv) < 0) return TVI_CONTROL_FALSE; + priv->format.fmt.pix.width = ((int *)arg)[0]; + priv->format.fmt.pix.height = ((int *)arg)[1]; + priv->format.fmt.pix.field = V4L2_FIELD_ANY; + if (ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) + return TVI_CONTROL_FALSE; + return TVI_CONTROL_TRUE; case TVI_CONTROL_VID_SET_WIDTH: if (getfmt(priv) < 0) return TVI_CONTROL_FALSE; priv->format.fmt.pix.width = *(int *)arg; -- cgit v1.2.3 From 127480e66054bcceda3397a4c29742846811135a Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 26 Mar 2009 11:00:04 +0000 Subject: Add support for mmsh:// as alias for mmshttp:// Patch by Francesco Cosoleto [cosoleto gmail com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29064 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/asf_streaming.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'stream') diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c index 64a8152ee3..3057f06c05 100644 --- a/stream/asf_streaming.c +++ b/stream/asf_streaming.c @@ -84,7 +84,8 @@ static int asf_streaming_start( stream_t *stream, int *demuxer_type) { //Is protocol http, http_proxy, or mms? if (!strcasecmp(proto, "http_proxy") || !strcasecmp(proto, "http") || - !strcasecmp(proto, "mms") || !strcasecmp(proto, "mmshttp")) + !strcasecmp(proto, "mms") || !strcasecmp(proto, "mmsh") || + !strcasecmp(proto, "mmshttp")) { mp_msg(MSGT_NETWORK,MSGL_V,"Trying ASF/HTTP...\n"); fd = asf_http_streaming_start( stream, demuxer_type ); @@ -847,7 +848,7 @@ const stream_info_t stream_info_asf = { "Bertrand, Reimar Doeffinger, Albeu", "originally based on work by Majormms (is that code still there?)", open_s, - {"mms", "mmsu", "mmst", "http", "http_proxy", "mmshttp", NULL}, + {"mms", "mmsu", "mmst", "http", "http_proxy", "mmsh", "mmshttp", NULL}, NULL, 0 // Urls are an option string }; -- cgit v1.2.3 From 09d4f18010278fb2cb15e57a775c79906be2e04a Mon Sep 17 00:00:00 2001 From: compn Date: Thu, 26 Mar 2009 13:35:12 +0000 Subject: change close to closesocket, unifies close streaming code patch by Francesco Cosoleto , cosoleto gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29066 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/asf_streaming.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stream') diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c index 3057f06c05..c3e70a4aa2 100644 --- a/stream/asf_streaming.c +++ b/stream/asf_streaming.c @@ -149,7 +149,7 @@ extern int audio_id; extern int video_id; static void close_s(stream_t *stream) { - close(stream->fd); + closesocket(stream->fd); stream->fd=-1; } -- cgit v1.2.3 From 8198495234d85e9003daf970f9e7d4f335724c61 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 27 Mar 2009 21:26:26 +0000 Subject: Simplify detection of .ifo extension. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29078 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stream') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index ae07239ad5..70a94303e6 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -1097,9 +1097,9 @@ static int ifo_stream_open (stream_t *stream, int mode, void *opts, int *file_fo char *ext; char* filename; struct stream_priv_s *spriv; + int len = strlen(stream->url); - ext = strrchr (stream->url, '.'); - if (!ext || strcasecmp (ext + 1, "ifo")) + if (len < 4 || strcasecmp (stream->url + len - 4, ".ifo")) return STREAM_UNSUPPORTED; mp_msg(MSGT_DVD, MSGL_INFO, ".IFO detected. Redirecting to dvd://\n"); -- cgit v1.2.3 From df1af7047583d6b963301495490b12aad178f1e5 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 28 Mar 2009 15:53:32 +0000 Subject: Simplify extracting title number from ifo name git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29082 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'stream') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 70a94303e6..55f4efa9df 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -1108,12 +1108,8 @@ static int ifo_stream_open (stream_t *stream, int mode, void *opts, int *file_fo spriv=calloc(1, sizeof(struct stream_priv_s)); spriv->device = strdup(dirname(stream->url)); - if(!strncasecmp(filename,"vts_",4)) - { - if(sscanf(filename+3, "_%02d_", &spriv->title)!=1) + if(sscanf(filename, "vts_%02d_", &spriv->title)!=1) spriv->title=1; - }else - spriv->title=1; free(filename); free(stream->url); -- cgit v1.2.3 From 8d376de96fb5e3456846f4f8368bb644213ba380 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 28 Mar 2009 15:54:08 +0000 Subject: Reindent git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29083 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stream') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 55f4efa9df..c383598895 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -1108,8 +1108,8 @@ static int ifo_stream_open (stream_t *stream, int mode, void *opts, int *file_fo spriv=calloc(1, sizeof(struct stream_priv_s)); spriv->device = strdup(dirname(stream->url)); - if(sscanf(filename, "vts_%02d_", &spriv->title)!=1) - spriv->title=1; + if(sscanf(filename, "vts_%02d_", &spriv->title)!=1) + spriv->title=1; free(filename); free(stream->url); -- cgit v1.2.3 From f5d01796a861b5b3e926584bed7b6e073595f0d8 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 28 Mar 2009 16:09:56 +0000 Subject: 100l, revert r29082, I missed that the vts comparison should be case-insensitive. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29084 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'stream') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index c383598895..70a94303e6 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -1108,7 +1108,11 @@ static int ifo_stream_open (stream_t *stream, int mode, void *opts, int *file_fo spriv=calloc(1, sizeof(struct stream_priv_s)); spriv->device = strdup(dirname(stream->url)); - if(sscanf(filename, "vts_%02d_", &spriv->title)!=1) + if(!strncasecmp(filename,"vts_",4)) + { + if(sscanf(filename+3, "_%02d_", &spriv->title)!=1) + spriv->title=1; + }else spriv->title=1; free(filename); -- cgit v1.2.3