summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
Diffstat (limited to 'stream')
-rw-r--r--stream/asf_streaming.c7
-rw-r--r--stream/stream_dvd.c4
-rw-r--r--stream/tv.c6
-rw-r--r--stream/tv.h1
-rw-r--r--stream/tvi_v4l2.c10
5 files changed, 22 insertions, 6 deletions
diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c
index 73cff872b5..a9825cf20f 100644
--- a/stream/asf_streaming.c
+++ b/stream/asf_streaming.c
@@ -85,7 +85,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 );
@@ -146,7 +147,7 @@ printf("0x%02X\n", stream_chunck->type );
}
static void close_s(stream_t *stream) {
- close(stream->fd);
+ closesocket(stream->fd);
stream->fd=-1;
}
@@ -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
};
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 05f9c411ab..2f00b083ae 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");
diff --git a/stream/tv.c b/stream/tv.c
index 641737a9f1..53d1adb2c5 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 0742135740..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;
@@ -1126,7 +1134,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 */