summaryrefslogtreecommitdiff
path: root/command
diff options
context:
space:
mode:
Diffstat (limited to 'command')
-rw-r--r--command/demux.cpp8
-rw-r--r--command/demux.h1
-rw-r--r--command/markad-standalone.cpp54
-rw-r--r--command/markad-standalone.h1
-rw-r--r--command/streaminfo.cpp6
5 files changed, 15 insertions, 55 deletions
diff --git a/command/demux.cpp b/command/demux.cpp
index a5b4ed7..6f58dde 100644
--- a/command/demux.cpp
+++ b/command/demux.cpp
@@ -183,6 +183,13 @@ int cMarkAdDemux::GetMinNeeded(MarkAdPid Pid, uchar *Data, int Count, bool *Offc
}
}
+void cMarkAdDemux::VDRTSAddPATPMT2Offset(MarkAdPid Pid, uchar *Data, int Count, bool *Offcnt)
+{
+ if (Pid.Num<0) return;
+ if (Count<2) return;
+ if ((Data[0]==0x47) && (Data[1]==0x40) && ((Data[2]==0) || (Data[2]==0x84))) *Offcnt=false;
+}
+
int cMarkAdDemux::Process(MarkAdPid Pid, uchar *Data, int Count, MarkAdPacket *Pkt)
{
if ((!Data) && (!Count) && (!Pkt)) return -1;
@@ -274,5 +281,6 @@ int cMarkAdDemux::Process(MarkAdPid Pid, uchar *Data, int Count, MarkAdPacket *P
}
Pkt->Offcnt=true;
+ VDRTSAddPATPMT2Offset(Pid, in, inlen, &Pkt->Offcnt);
return retval;
}
diff --git a/command/demux.h b/command/demux.h
index 9313912..0c91c7a 100644
--- a/command/demux.h
+++ b/command/demux.h
@@ -35,6 +35,7 @@ private:
int GetMinNeeded(MarkAdPid Pid, uchar *Data, int Count, bool *Offcnt);
void ProcessTS(MarkAdPid Pid, uchar *Data, int Count, MarkAdPacket *pkt);
void ProcessVDR(MarkAdPid Pid, uchar *Data, int Count, MarkAdPacket *pkt);
+ void VDRTSAddPATPMT2Offset(MarkAdPid Pid, uchar *Data, int Count, bool *Offcnt);
public:
cMarkAdDemux();
~cMarkAdDemux();
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index 20fc530..a3922a9 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -1318,15 +1318,7 @@ bool cMarkAdStandalone::ProcessFile(int Number)
lastiframe=iframe;
CheckStartStop(lastiframe);
if (lastiframe>chkLEFT) CheckAspectRatio_and_AudioChannels();
-
- if (macontext.Info.VPid.Type==MARKAD_PIDTYPE_VIDEO_H264)
- {
- iframe=framecnt;
- }
- else
- {
- iframe=framecnt-1;
- }
+ iframe=framecnt-1;
dRes=true;
}
}
@@ -1470,39 +1462,6 @@ bool cMarkAdStandalone::Reset(bool FirstPass)
return ret;
}
-bool cMarkAdStandalone::CheckDolbyDigital51()
-{
- if (macontext.Info.Channels!=6) return false;
- if (abort) return false;
-
- // Assumption: last mark must be MT_CHANNELSTOP and the position must be
- // beyond the half of the broadcast length (or?)
- clMark *mark=marks.GetLast();
- if (!mark) return false; // no last mark? there is a problem!
-
- mark=marks.GetPrev(mark->position,MT_CHANNELSTART);
- if (mark)
- {
- if (mark->position>chkLEFT) return false;
- }
-
- reprocess=true;
- bDecodeVideo=macontext.Config->DecodeVideo;
- setAudio20=true;
- setAudio51=false;
- macontext.Info.Channels=2;
- isyslog("%s DolbyDigital5.1 marks found", mark ? "not enough" : "no");
- isyslog("restarting from scratch");
- if ((ac3_demux) && (!macontext.Config->AC3Always))
- {
- delete ac3_demux;
- ac3_demux=NULL;
- macontext.Info.DPid.Num=0;
- }
- Reset();
- return true;
-}
-
void cMarkAdStandalone::ProcessFile()
{
for (int i=1; i<=MaxFiles; i++)
@@ -1552,7 +1511,6 @@ void cMarkAdStandalone::Process()
if (macontext.Config->BackupMarks) marks.Backup(directory,isTS);
ProcessFile();
- if (CheckDolbyDigital51()) ProcessFile();
marks.CloseIndex(directory,isTS);
if (!abort)
@@ -1607,7 +1565,7 @@ void cMarkAdStandalone::Process()
else
{
// this shouldn't be reached
- if (!macontext.Config->logoExtraction!=-1)
+ if (macontext.Config->logoExtraction==-1)
esyslog("ALERT: stopping before end of broadcast");
}
}
@@ -2035,14 +1993,6 @@ bool cMarkAdStandalone::LoadInfo()
macontext.Info.Channels=6;
macontext.Video.Options.IgnoreAspectRatio=true;
isyslog("broadcast with DolbyDigital5.1, disabling video decoding");
- if ((macontext.Info.AspectRatio.Num==4) &&
- (macontext.Info.AspectRatio.Den==3))
- {
- isyslog("wrong aspectratio in info, changing to 16:9");
- macontext.Info.AspectRatio.Num=16;
- macontext.Info.AspectRatio.Den=9;
- setVideo169=true;
- }
}
else
{
diff --git a/command/markad-standalone.h b/command/markad-standalone.h
index 412530a..e93b6a9 100644
--- a/command/markad-standalone.h
+++ b/command/markad-standalone.h
@@ -242,7 +242,6 @@ unsigned Descriptor_Length:
void CalculateStopPosition(int startframe, int delta);
void CheckFirstMark();
void CheckLastMark();
- bool CheckDolbyDigital51();
void CheckStartStop(int frame, bool checkend=false);
void CheckAspectRatio_and_AudioChannels();
void CheckLogoMarks(clMark *last=NULL);
diff --git a/command/streaminfo.cpp b/command/streaminfo.cpp
index e52ca0b..3330e12 100644
--- a/command/streaminfo.cpp
+++ b/command/streaminfo.cpp
@@ -142,6 +142,7 @@ bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt,
uint32_t height=0;
uint32_t aspect_ratio_idc=0;
double frame_rate=0;
+ bool fixedframerate=false;
int sar_width=1,sar_height=1;
int profile_idc = bs.getU8(); // profile_idc
@@ -250,9 +251,10 @@ bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt,
time_scale = bs.getU32(); // time_scale
if (num_units_in_tick > 0)
{
- frame_rate = time_scale / (2*num_units_in_tick);
+ frame_rate = time_scale / num_units_in_tick;
+ if (frame_mbs_only_flag) frame_rate/=2;
}
- bs.skipBit(); // fixed_frame_rate_flag
+ fixedframerate=bs.getBit(); // fixed_frame_rate_flag
}
#if 0
int nal_hrd_parameters_present_flag = bs.getBit(); // nal_hrd_parameters_present_flag