mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
No longer retuning or restarting a recording if only the language code of a audio or dolby PID changes
This commit is contained in:
parent
a20ddc1f22
commit
89105812fb
2
HISTORY
2
HISTORY
@ -3504,3 +3504,5 @@ Video Disk Recorder Revision History
|
|||||||
recording (suggested by Matthias Schniedermeyer). See man vdr(5) for details.
|
recording (suggested by Matthias Schniedermeyer). See man vdr(5) for details.
|
||||||
- Removed scaling coordinates in letterbox mode from cDvbSpu - the DVD plugin, which
|
- Removed scaling coordinates in letterbox mode from cDvbSpu - the DVD plugin, which
|
||||||
was the only one needing this, doesn't need it any more (thanks to Marco Schlüßler).
|
was the only one needing this, doesn't need it any more (thanks to Marco Schlüßler).
|
||||||
|
- No longer retuning or restarting a recording if only the language code of an
|
||||||
|
audio or dolby PID changes.
|
||||||
|
37
channels.c
37
channels.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: channels.c 1.37 2005/05/06 13:46:57 kls Exp $
|
* $Id: channels.c 1.38 2005/05/07 13:14:32 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "channels.h"
|
#include "channels.h"
|
||||||
@ -389,15 +389,21 @@ void cChannel::SetPortalName(const char *PortalName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IntArraysDiffer(const int *a, const int *b, const char na[][4] = NULL, const char nb[][4] = NULL)
|
#define STRDIFF 0x01
|
||||||
|
#define VALDIFF 0x02
|
||||||
|
|
||||||
|
static int IntArraysDiffer(const int *a, const int *b, const char na[][4] = NULL, const char nb[][4] = NULL)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int result = 0;
|
||||||
while (a[i] && b[i]) {
|
for (int i = 0; a[i] || b[i]; i++) {
|
||||||
if (a[i] != b[i] || na && nb && strcmp(na[i], nb[i]) != 0)
|
if (a[i] && na && nb && strcmp(na[i], nb[i]) != 0)
|
||||||
return true;
|
result |= STRDIFF;
|
||||||
i++;
|
if (a[i] != b[i])
|
||||||
|
result |= VALDIFF;
|
||||||
|
if (!a[i] || !b[i])
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return a[i] != b[i] || a[i] && na && nb && strcmp(na[i], nb[i]) != 0;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int IntArrayToString(char *s, const int *a, int Base = 10, const char n[][4] = NULL)
|
static int IntArrayToString(char *s, const int *a, int Base = 10, const char n[][4] = NULL)
|
||||||
@ -418,10 +424,15 @@ static int IntArrayToString(char *s, const int *a, int Base = 10, const char n[]
|
|||||||
|
|
||||||
void cChannel::SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][4], int *Dpids, char DLangs[][4], int Tpid)
|
void cChannel::SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][4], int *Dpids, char DLangs[][4], int Tpid)
|
||||||
{
|
{
|
||||||
bool modified = vpid != Vpid || ppid != Ppid || tpid != Tpid;
|
int mod = CHANNELMOD_NONE;
|
||||||
if (!modified)
|
if (vpid != Vpid || ppid != Ppid || tpid != Tpid)
|
||||||
modified = IntArraysDiffer(apids, Apids, alangs, ALangs) || IntArraysDiffer(dpids, Dpids, dlangs, DLangs);
|
mod |= CHANNELMOD_PIDS;
|
||||||
if (modified) {
|
int m = IntArraysDiffer(apids, Apids, alangs, ALangs) | IntArraysDiffer(dpids, Dpids, dlangs, DLangs);
|
||||||
|
if (m & STRDIFF)
|
||||||
|
mod |= CHANNELMOD_LANGS;
|
||||||
|
if (m & VALDIFF)
|
||||||
|
mod |= CHANNELMOD_PIDS;
|
||||||
|
if (mod) {
|
||||||
char OldApidsBuf[(MAXAPIDS + MAXDPIDS) * 10 + 10]; // 10: 5 digits plus delimiting ',' or ';' plus optional '=cod', +10: paranoia
|
char OldApidsBuf[(MAXAPIDS + MAXDPIDS) * 10 + 10]; // 10: 5 digits plus delimiting ',' or ';' plus optional '=cod', +10: paranoia
|
||||||
char NewApidsBuf[(MAXAPIDS + MAXDPIDS) * 10 + 10];
|
char NewApidsBuf[(MAXAPIDS + MAXDPIDS) * 10 + 10];
|
||||||
char *q = OldApidsBuf;
|
char *q = OldApidsBuf;
|
||||||
@ -450,7 +461,7 @@ void cChannel::SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][4], int *Dp
|
|||||||
strn0cpy(dlangs[i], DLangs[i], 4);
|
strn0cpy(dlangs[i], DLangs[i], 4);
|
||||||
}
|
}
|
||||||
tpid = Tpid;
|
tpid = Tpid;
|
||||||
modification |= CHANNELMOD_PIDS;
|
modification |= mod;
|
||||||
Channels.SetModified();
|
Channels.SetModified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: channels.h 1.27 2005/05/06 13:47:06 kls Exp $
|
* $Id: channels.h 1.28 2005/05/07 13:07:09 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CHANNELS_H
|
#ifndef __CHANNELS_H
|
||||||
@ -24,6 +24,7 @@
|
|||||||
#define CHANNELMOD_ID 0x04
|
#define CHANNELMOD_ID 0x04
|
||||||
#define CHANNELMOD_CA 0x10
|
#define CHANNELMOD_CA 0x10
|
||||||
#define CHANNELMOD_TRANSP 0x20
|
#define CHANNELMOD_TRANSP 0x20
|
||||||
|
#define CHANNELMOD_LANGS 0x40
|
||||||
#define CHANNELMOD_RETUNE (CHANNELMOD_PIDS | CHANNELMOD_CA | CHANNELMOD_TRANSP)
|
#define CHANNELMOD_RETUNE (CHANNELMOD_PIDS | CHANNELMOD_CA | CHANNELMOD_TRANSP)
|
||||||
|
|
||||||
#define CHANNELSMOD_NONE 0
|
#define CHANNELSMOD_NONE 0
|
||||||
|
Loading…
Reference in New Issue
Block a user