Ticket #1326: normid.patch

File normid.patch, 2.7 KB (added by ffplay99@…, 14 years ago)

patch to leave norm alone if not configured

  • stream/tv.c

     
    10141014int tv_step_channel(tvi_handle_t *tvh, int direction) {
    10151015        tvh->tv_param->scan=0;
    10161016        if (tv_channel_list) {
     1017                tv_channel_last = tv_channel_current;
    10171018                if (direction == TV_CHANNEL_HIGHER) {
    1018                         tv_channel_last = tv_channel_current;
    10191019                        if (tv_channel_current->next)
    10201020                                tv_channel_current = tv_channel_current->next;
    10211021                        else
    10221022                                tv_channel_current = tv_channel_list;
    1023 
    1024                                 tv_set_norm_i(tvh, tv_channel_current->norm);
    1025                                 tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
    1026                                 mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3,
    1027                         tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
    10281023                }
    10291024                if (direction == TV_CHANNEL_LOWER) {
    1030                         tv_channel_last = tv_channel_current;
    10311025                        if (tv_channel_current->prev)
    10321026                                tv_channel_current = tv_channel_current->prev;
    10331027                        else
    10341028                                while (tv_channel_current->next)
    10351029                                        tv_channel_current = tv_channel_current->next;
    1036                                 tv_set_norm_i(tvh, tv_channel_current->norm);
    1037                                 tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
    1038                                 mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3,
    1039                         tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
    10401030                }
     1031                if (tv_channel_current->norm != tvh->norm)
     1032                        tv_set_norm_i(tvh, tv_channel_current->norm);
     1033                tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
     1034                mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3,
     1035                        tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
     1036               
    10411037        } else tv_step_channel_real(tvh, direction);
    10421038        return 1;
    10431039}
     
    10781074                                tv_channel_current = tv_channel_current->next;
    10791075                mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
    10801076                                tv_channel_current->name, (float)tv_channel_current->freq/1000);
    1081                 tv_set_norm_i(tvh, tv_channel_current->norm);
     1077                if (tv_channel_current->norm != tvh->norm)
     1078                        tv_set_norm_i(tvh, tv_channel_current->norm);
    10821079                tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
    10831080        } else tv_set_channel_real(tvh, channel);
    10841081        return 1;
     
    10961093
    10971094                mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
    10981095                                tv_channel_current->name, (float)tv_channel_current->freq/1000);
    1099                 tv_set_norm_i(tvh, tv_channel_current->norm);
     1096                if (tv_channel_current->norm != tvh->norm)
     1097                        tv_set_norm_i(tvh, tv_channel_current->norm);
    11001098                tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
    11011099        } else {
    11021100                int i;