blob: ac2135c521c6738b9f167e96cb22d6b20c558abc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/* -*- c++ -*-
* ttxtaudio.c
*
* Created on: Oct 31, 2012
* Author: Dimitar Petrovski
*/
#include "ttxtaudio.h"
int64_t cTtxtAudio::pts = 0;
cTtxtAudio::cTtxtAudio()
:cExternalAudio("TtxtAudio")
{
}
cTtxtAudio::~cTtxtAudio()
{
}
void cTtxtAudio::Play(const uchar* p, int Length, uchar Id)
{
int64_t tmp_pts = 0;
bool audio_pts_wrap = false;
if (PesHasPts(p))
tmp_pts = PesGetPts(p);
if (tmp_pts != 0) {
if ((pts > 0x1ffff0000LL) && (tmp_pts < 0x000100000LL)) {
audio_pts_wrap=true;
}
if (audio_pts_wrap) { tmp_pts+=0x200000000LL; }
}
if (tmp_pts != pts) { pts=tmp_pts; }
}
void cTtxtAudio::PlayTs(const uchar* Data, int Length)
{
// isyslog("ttxtsubs: cTtxtAudio::PlayTs");
tsToPesTtxtAudio.PutTs(Data, Length);
int l;
if (const uchar *p = tsToPesTtxtAudio.GetPes(l)) {
Play(p,l,0);
tsToPesTtxtAudio.Reset();
}
}
|