summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-06-17 02:18:10 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-06-17 05:04:32 +0300
commit68e70b3ec34af2e1002d17d0dc81b3408a399ade (patch)
treeb6b00fd57b24e713e0dc180b64d266b958df7daa /stream
parentaf3fcdf2ded43e887bceed3a957b5cc4f7dbc2c6 (diff)
parentdcd0902bcdb1a62f4246cbfba48bd1b77841ceda (diff)
downloadmpv-68e70b3ec34af2e1002d17d0dc81b3408a399ade.tar.bz2
mpv-68e70b3ec34af2e1002d17d0dc81b3408a399ade.tar.xz
Merge svn changes up to r27092
Conflicts: libmpdemux/demuxer.c libvo/vo_xv.c mencoder.c
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_dvd.h1
-rw-r--r--stream/stream_dvd_common.h1
-rw-r--r--stream/tv.c37
-rw-r--r--stream/tv.h1
4 files changed, 34 insertions, 6 deletions
diff --git a/stream/stream_dvd.h b/stream/stream_dvd.h
index 379a7ffc84..9a80ea2f42 100644
--- a/stream/stream_dvd.h
+++ b/stream/stream_dvd.h
@@ -1,6 +1,7 @@
#ifndef MPLAYER_STREAM_DVD_H
#define MPLAYER_STREAM_DVD_H
+#include "config.h"
#include <stdint.h>
#ifdef USE_DVDREAD_INTERNAL
#include "dvdread/dvd_reader.h"
diff --git a/stream/stream_dvd_common.h b/stream/stream_dvd_common.h
index 443daa45f9..b1d31d1dde 100644
--- a/stream/stream_dvd_common.h
+++ b/stream/stream_dvd_common.h
@@ -1,6 +1,7 @@
#ifndef MPLAYER_STREAM_DVD_COMMON_H
#define MPLAYER_STREAM_DVD_COMMON_H
+#include "config.h"
#include <inttypes.h>
#ifdef USE_DVDREAD_INTERNAL
#include <dvdread/ifo_types.h>
diff --git a/stream/tv.c b/stream/tv.c
index 696c0d542d..48ddb8fb49 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -254,6 +254,7 @@ static void parse_channels(tvi_handle_t *tvh)
tv_channel_list->next=NULL;
tv_channel_list->prev=NULL;
tv_channel_current = tv_channel_list;
+ tv_channel_current->norm = tvh->norm;
while (*channels) {
char* tmp = *(channels++);
@@ -299,6 +300,12 @@ static void parse_channels(tvi_handle_t *tvh)
if ( sep[0] == '-' ) tv_channel_current->freq -= i * 100;
sep[0] = '\0';
}
+
+ sep = strchr(tv_channel_current->name, '=');
+ if ( sep ) {
+ tv_channel_current->norm = norm_from_string(tvh, sep+1);
+ sep[0] = '\0';
+ }
}
/*mp_msg(MSGT_TV, MSGL_INFO, "-- Detected channel %s - %s (%5.3f)\n",
@@ -310,6 +317,7 @@ static void parse_channels(tvi_handle_t *tvh)
tv_channel_current->next->prev = tv_channel_current;
tv_channel_current->next->next = NULL;
tv_channel_current = tv_channel_current->next;
+ tv_channel_current->norm = tvh->norm;
}
if (tv_channel_current->prev)
tv_channel_current->prev->next = NULL;
@@ -376,12 +384,9 @@ static int open_tv(tvi_handle_t *tvh)
#ifdef HAVE_TV_DSHOW
|| (!strcmp(tvh->tv_param->driver, "dshow") && tvh->tv_param->normid >= 0)
#endif
- ) {
- mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNormId, tvh->tv_param->normid);
- if (funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->tv_param->normid) != TVI_CONTROL_TRUE) {
- mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm);
- }
- } else
+ )
+ tv_set_norm_i(tvh, tvh->tv_param->normid);
+ else
#endif
tv_set_norm(tvh,tvh->tv_param->norm);
@@ -500,6 +505,7 @@ static int open_tv(tvi_handle_t *tvh)
mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
tv_channel_current->name, (float)tv_channel_current->freq/1000);
+ tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
tv_channel_last = tv_channel_current;
} else {
@@ -922,6 +928,8 @@ int tv_step_channel(tvi_handle_t *tvh, int direction) {
tv_channel_current = tv_channel_current->next;
else
tv_channel_current = tv_channel_list;
+
+ tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3,
tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
@@ -933,6 +941,7 @@ int tv_step_channel(tvi_handle_t *tvh, int direction) {
else
while (tv_channel_current->next)
tv_channel_current = tv_channel_current->next;
+ tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3,
tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
@@ -977,6 +986,7 @@ int tv_set_channel(tvi_handle_t *tvh, char *channel) {
tv_channel_current = tv_channel_current->next;
mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
tv_channel_current->name, (float)tv_channel_current->freq/1000);
+ tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
} else tv_set_channel_real(tvh, channel);
return 1;
@@ -994,6 +1004,7 @@ int tv_last_channel(tvi_handle_t *tvh) {
mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
tv_channel_current->name, (float)tv_channel_current->freq/1000);
+ tv_set_norm_i(tvh, tv_channel_current->norm);
tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
} else {
int i;
@@ -1050,6 +1061,20 @@ int tv_set_norm(tvi_handle_t *tvh, char* norm)
return 1;
}
+int tv_set_norm_i(tvi_handle_t *tvh, int norm)
+{
+ tvh->norm = norm;
+
+ mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNormId, norm);
+ if (tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm) != TVI_CONTROL_TRUE) {
+ mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm);
+ return 0;
+ }
+
+ tvh->functions->control(tvh->priv,TV_VBI_CONTROL_RESET,tvh->tv_param);
+ return(1);
+}
+
demuxer_desc_t demuxer_desc_tv = {
"Tv card demuxer",
"tv",
diff --git a/stream/tv.h b/stream/tv.h
index 7413860ae0..37c63b7a89 100644
--- a/stream/tv.h
+++ b/stream/tv.h
@@ -119,6 +119,7 @@ typedef struct tv_channels_s {
int index;
char number[5];
char name[20];
+ int norm;
int freq;
struct tv_channels_s *next;
struct tv_channels_s *prev;