mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 15:32:43 +02:00
rename lt_debug => hal_debug; it's not only libtriple debugging
Origin commit data
------------------
Branch: master
Commit: 9654cb09bf
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-12-26 (Wed, 26 Dec 2018)
Origin message was:
------------------
- rename lt_debug => hal_debug; it's not only libtriple debugging
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
#include "dmx_hal.h"
|
||||
#include "audio_td.h"
|
||||
#include "video_td.h"
|
||||
#include "lt_debug.h"
|
||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_PLAYBACK, this, args)
|
||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_PLAYBACK, this, args)
|
||||
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_PLAYBACK, NULL, args)
|
||||
#include "hal_debug.h"
|
||||
#define hal_debug(args...) _hal_debug(HAL_DEBUG_PLAYBACK, this, args)
|
||||
#define hal_info(args...) _hal_info(HAL_DEBUG_PLAYBACK, this, args)
|
||||
#define hal_info_c(args...) _hal_info(HAL_DEBUG_PLAYBACK, NULL, args)
|
||||
|
||||
#include <tddevices.h>
|
||||
#define DVR "/dev/" DEVICE_NAME_PVR
|
||||
@@ -52,7 +52,7 @@ static const char *FILETYPE[] = {
|
||||
|
||||
cPlayback::cPlayback(int)
|
||||
{
|
||||
lt_debug("%s\n", __FUNCTION__);
|
||||
hal_debug("%s\n", __FUNCTION__);
|
||||
thread_started = false;
|
||||
inbuf = NULL;
|
||||
pesbuf = NULL;
|
||||
@@ -64,7 +64,7 @@ cPlayback::cPlayback(int)
|
||||
|
||||
cPlayback::~cPlayback()
|
||||
{
|
||||
lt_debug("%s\n", __FUNCTION__);
|
||||
hal_debug("%s\n", __FUNCTION__);
|
||||
Close();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ bool cPlayback::Open(playmode_t mode)
|
||||
"PLAYMODE_FILE"
|
||||
};
|
||||
|
||||
lt_debug("%s: PlayMode = %s\n", __FUNCTION__, PMODE[mode]);
|
||||
hal_debug("%s: PlayMode = %s\n", __FUNCTION__, PMODE[mode]);
|
||||
thread_started = false;
|
||||
playMode = mode;
|
||||
filetype = FILETYPE_TS;
|
||||
@@ -91,15 +91,15 @@ bool cPlayback::Open(playmode_t mode)
|
||||
//Used by Fileplay
|
||||
void cPlayback::Close(void)
|
||||
{
|
||||
lt_info("%s\n", __FUNCTION__);
|
||||
hal_info("%s\n", __FUNCTION__);
|
||||
playstate = STATE_STOP;
|
||||
if (thread_started)
|
||||
{
|
||||
lt_info("%s: before pthread_join\n", __FUNCTION__);
|
||||
hal_info("%s: before pthread_join\n", __FUNCTION__);
|
||||
pthread_join(thread, NULL);
|
||||
}
|
||||
thread_started = false;
|
||||
lt_info("%s: after pthread_join\n", __FUNCTION__);
|
||||
hal_info("%s: after pthread_join\n", __FUNCTION__);
|
||||
mf_close();
|
||||
filelist.clear();
|
||||
|
||||
@@ -122,30 +122,30 @@ bool cPlayback::Start(char *filename, unsigned short vp, int vtype, unsigned sho
|
||||
vpid = vp;
|
||||
apid = ap;
|
||||
ac3 = _ac3;
|
||||
lt_info("%s name = '%s' vpid 0x%04hx vtype %d apid 0x%04hx ac3 %d filelist.size: %u\n",
|
||||
hal_info("%s name = '%s' vpid 0x%04hx vtype %d apid 0x%04hx ac3 %d filelist.size: %u\n",
|
||||
__FUNCTION__, filename, vpid, vtype, apid, ac3, filelist.size());
|
||||
if (!filelist.empty())
|
||||
{
|
||||
lt_info("filelist not empty?\n");
|
||||
hal_info("filelist not empty?\n");
|
||||
return false;
|
||||
}
|
||||
if (stat(filename, &s))
|
||||
{
|
||||
lt_info("filename does not exist? (%m)\n");
|
||||
hal_info("filename does not exist? (%m)\n");
|
||||
return false;
|
||||
}
|
||||
if (!inbuf)
|
||||
inbuf = (uint8_t *)malloc(INBUF_SIZE); /* 256 k */
|
||||
if (!inbuf)
|
||||
{
|
||||
lt_info("allocating input buffer failed (%m)\n");
|
||||
hal_info("allocating input buffer failed (%m)\n");
|
||||
return false;
|
||||
}
|
||||
if (!pesbuf)
|
||||
pesbuf = (uint8_t *)malloc(PESBUF_SIZE); /* 128 k */
|
||||
if (!pesbuf)
|
||||
{
|
||||
lt_info("allocating PES buffer failed (%m)\n");
|
||||
hal_info("allocating PES buffer failed (%m)\n");
|
||||
return false;
|
||||
}
|
||||
filelist_t file;
|
||||
@@ -165,10 +165,10 @@ bool cPlayback::Start(char *filename, unsigned short vp, int vtype, unsigned sho
|
||||
if (p != std::string::npos)
|
||||
{
|
||||
file.Name.replace(p, std::string::npos, "001.vdr");
|
||||
lt_info("replaced filename with '%s'\n", file.Name.c_str());
|
||||
hal_info("replaced filename with '%s'\n", file.Name.c_str());
|
||||
if (stat(file.Name.c_str(), &s))
|
||||
{
|
||||
lt_info("filename does not exist? (%m)\n");
|
||||
hal_info("filename does not exist? (%m)\n");
|
||||
return false;
|
||||
}
|
||||
file.Size = s.st_size;
|
||||
@@ -179,7 +179,7 @@ bool cPlayback::Start(char *filename, unsigned short vp, int vtype, unsigned sho
|
||||
vpid = 0x40;
|
||||
}
|
||||
|
||||
lt_info("detected (ok, guessed) filetype: %s\n", FILETYPE[filetype]);
|
||||
hal_info("detected (ok, guessed) filetype: %s\n", FILETYPE[filetype]);
|
||||
|
||||
filelist.push_back(file);
|
||||
filelist_auto_add();
|
||||
@@ -236,7 +236,7 @@ bool cPlayback::Start(char *filename, unsigned short vp, int vtype, unsigned sho
|
||||
int duration = (pts_end - pts_start) / 90000;
|
||||
if (duration > 0)
|
||||
bytes_per_second = mf_getsize() / duration;
|
||||
lt_info("start: %lld end %lld duration %d bps %lld\n", pts_start, pts_end, duration, bytes_per_second);
|
||||
hal_info("start: %lld end %lld duration %d bps %lld\n", pts_start, pts_end, duration, bytes_per_second);
|
||||
/* yes, we start in pause mode... */
|
||||
playback_speed = 0;
|
||||
if (pts_start == -1)
|
||||
@@ -245,7 +245,7 @@ bool cPlayback::Start(char *filename, unsigned short vp, int vtype, unsigned sho
|
||||
playstate = STATE_PAUSE;
|
||||
pthread_mutex_lock(&playback_ready_mutex);
|
||||
if (pthread_create(&thread, 0, start_playthread, this) != 0)
|
||||
lt_info("pthread_create failed\n");
|
||||
hal_info("pthread_create failed\n");
|
||||
else
|
||||
pthread_cond_wait(&playback_ready_cond, &playback_ready_mutex);
|
||||
pthread_mutex_unlock(&playback_ready_mutex);
|
||||
@@ -266,7 +266,7 @@ void cPlayback::playthread(void)
|
||||
dvrfd = open(DVR, O_WRONLY);
|
||||
if (dvrfd < 0)
|
||||
{
|
||||
lt_info("%s open tdpvr failed: %m\n", __FUNCTION__);
|
||||
hal_info("%s open tdpvr failed: %m\n", __FUNCTION__);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
fcntl(dvrfd, F_SETFD, FD_CLOEXEC);
|
||||
@@ -333,7 +333,7 @@ void cPlayback::playthread(void)
|
||||
if (!aI->second.ac3)
|
||||
{
|
||||
apid = aI->first;
|
||||
lt_info("%s setting Audio pid to 0x%04hx\n", __FUNCTION__, apid);
|
||||
hal_info("%s setting Audio pid to 0x%04hx\n", __FUNCTION__, apid);
|
||||
SetAPid(apid, 0);
|
||||
break;
|
||||
}
|
||||
@@ -353,7 +353,7 @@ void cPlayback::playthread(void)
|
||||
{
|
||||
if (errno == EAGAIN && playstate != STATE_STOP)
|
||||
goto retry;
|
||||
lt_info("%s write dvr failed: %m\n", __FUNCTION__);
|
||||
hal_info("%s write dvr failed: %m\n", __FUNCTION__);
|
||||
break;
|
||||
}
|
||||
memmove(inbuf, inbuf + ret, inbuf_pos - ret);
|
||||
@@ -367,7 +367,7 @@ void cPlayback::playthread(void)
|
||||
|
||||
static void playthread_cleanup_handler(void *)
|
||||
{
|
||||
lt_info_c("%s\n", __FUNCTION__);
|
||||
hal_info_c("%s\n", __FUNCTION__);
|
||||
ioctl(audioDemux->getFD(), DEMUX_SELECT_SOURCE, INPUT_FROM_CHANNEL0);
|
||||
audioDemux->Stop();
|
||||
videoDemux->Stop();
|
||||
@@ -379,7 +379,7 @@ static void playthread_cleanup_handler(void *)
|
||||
|
||||
bool cPlayback::SetAPid(unsigned short pid, int _ac3)
|
||||
{
|
||||
lt_info("%s pid: 0x%04hx ac3: %d\n", __FUNCTION__, pid, _ac3);
|
||||
hal_info("%s pid: 0x%04hx ac3: %d\n", __FUNCTION__, pid, _ac3);
|
||||
apid = pid;
|
||||
ac3 = _ac3;
|
||||
|
||||
@@ -408,7 +408,7 @@ bool cPlayback::SetAPid(unsigned short pid, int _ac3)
|
||||
|
||||
bool cPlayback::SetSpeed(int speed)
|
||||
{
|
||||
lt_info("%s speed = %d\n", __FUNCTION__, speed);
|
||||
hal_info("%s speed = %d\n", __FUNCTION__, speed);
|
||||
if (speed < 0)
|
||||
speed = 1; /* fast rewind not yet implemented... */
|
||||
if (speed == 1 && playback_speed != 1)
|
||||
@@ -447,7 +447,7 @@ bool cPlayback::SetSpeed(int speed)
|
||||
|
||||
bool cPlayback::GetSpeed(int &speed) const
|
||||
{
|
||||
lt_debug("%s\n", __FUNCTION__);
|
||||
hal_debug("%s\n", __FUNCTION__);
|
||||
speed = playback_speed;
|
||||
return true;
|
||||
}
|
||||
@@ -456,7 +456,7 @@ bool cPlayback::GetSpeed(int &speed) const
|
||||
bool cPlayback::GetPosition(int &position, int &duration)
|
||||
{
|
||||
int64_t tmppts;
|
||||
lt_debug("%s\n", __FUNCTION__);
|
||||
hal_debug("%s\n", __FUNCTION__);
|
||||
off_t currsize = mf_getsize();
|
||||
bool update = false;
|
||||
/* handle a growing file, e.g. for timeshift.
|
||||
@@ -488,7 +488,7 @@ bool cPlayback::GetPosition(int &position, int &duration)
|
||||
tmppts = get_pts(pesbuf + r + s, false, n - r);
|
||||
if (tmppts > -1)
|
||||
{
|
||||
lt_debug("n: %d s: %d endpts %lld size: %lld\n", n, s, tmppts, currsize);
|
||||
hal_debug("n: %d s: %d endpts %lld size: %lld\n", n, s, tmppts, currsize);
|
||||
pts_end = tmppts;
|
||||
_pts_end = tmppts;
|
||||
update = true;
|
||||
@@ -519,7 +519,7 @@ bool cPlayback::GetPosition(int &position, int &duration)
|
||||
if (update && duration >= 4000)
|
||||
{
|
||||
bytes_per_second = currsize / (duration / 1000);
|
||||
lt_debug("%s: updated bps: %lld size: %lld duration %d\n",
|
||||
hal_debug("%s: updated bps: %lld size: %lld duration %d\n",
|
||||
__FUNCTION__, bytes_per_second, currsize, duration);
|
||||
}
|
||||
return true;
|
||||
@@ -531,7 +531,7 @@ bool cPlayback::GetPosition(int &position, int &duration)
|
||||
|
||||
bool cPlayback::SetPosition(int position, bool absolute)
|
||||
{
|
||||
lt_info("%s pos = %d abs = %d\n", __FUNCTION__, position, absolute);
|
||||
hal_info("%s pos = %d abs = %d\n", __FUNCTION__, position, absolute);
|
||||
int currpos, target, duration, oldspeed;
|
||||
bool ret;
|
||||
|
||||
@@ -541,7 +541,7 @@ bool cPlayback::SetPosition(int position, bool absolute)
|
||||
{
|
||||
GetPosition(currpos, duration);
|
||||
target = currpos + position;
|
||||
lt_info("current position %d target %d\n", currpos, target);
|
||||
hal_info("current position %d target %d\n", currpos, target);
|
||||
}
|
||||
|
||||
oldspeed = playback_speed;
|
||||
@@ -567,7 +567,7 @@ bool cPlayback::SetPosition(int position, bool absolute)
|
||||
|
||||
void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language)
|
||||
{
|
||||
lt_info("%s\n", __FUNCTION__);
|
||||
hal_info("%s\n", __FUNCTION__);
|
||||
int i = 0;
|
||||
for (std::map<uint16_t, AStream>::iterator aI = astreams.begin(); aI != astreams.end(); aI++)
|
||||
{
|
||||
@@ -606,14 +606,14 @@ off_t cPlayback::seek_to_pts(int64_t pts)
|
||||
int count = 0;
|
||||
if (pts_start < 0 || pts_end < 0 || bytes_per_second < 0)
|
||||
{
|
||||
lt_info("%s pts_start (%lld) or pts_end (%lld) or bytes_per_second (%lld) not initialized\n",
|
||||
hal_info("%s pts_start (%lld) or pts_end (%lld) or bytes_per_second (%lld) not initialized\n",
|
||||
__FUNCTION__, pts_start, pts_end, bytes_per_second);
|
||||
return -1;
|
||||
}
|
||||
/* sanity check: buffer is without locking, so we must only seek while in pause mode */
|
||||
if (playstate != STATE_PAUSE)
|
||||
{
|
||||
lt_info("%s playstate (%d) != STATE_PAUSE, not seeking\n", __FUNCTION__, playstate);
|
||||
hal_info("%s playstate (%d) != STATE_PAUSE, not seeking\n", __FUNCTION__, playstate);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -627,7 +627,7 @@ off_t cPlayback::seek_to_pts(int64_t pts)
|
||||
count++;
|
||||
ptsdiff = pts - tmppts;
|
||||
newpos += ptsdiff * bytes_per_second / 90000;
|
||||
lt_info("%s try #%d seek from %lldms to %lldms dt %lldms pos %lldk newpos %lldk kB/s %lld\n",
|
||||
hal_info("%s try #%d seek from %lldms to %lldms dt %lldms pos %lldk newpos %lldk kB/s %lld\n",
|
||||
__FUNCTION__, count, tmppts / 90, pts / 90, ptsdiff / 90, curr_pos / 1024, newpos / 1024, bytes_per_second / 1024);
|
||||
if (newpos < 0)
|
||||
newpos = 0;
|
||||
@@ -647,7 +647,7 @@ off_t cPlayback::seek_to_pts(int64_t pts)
|
||||
else
|
||||
tmppts = pts_curr - pts_start;
|
||||
}
|
||||
lt_info("%s end after %d tries, ptsdiff now %lld sec\n", __FUNCTION__, count, (pts - tmppts) / 90000);
|
||||
hal_info("%s end after %d tries, ptsdiff now %lld sec\n", __FUNCTION__, count, (pts - tmppts) / 90000);
|
||||
return newpos;
|
||||
}
|
||||
|
||||
@@ -681,7 +681,7 @@ bool cPlayback::filelist_auto_add()
|
||||
filelist_t file;
|
||||
file.Name = std::string(nextfile);
|
||||
file.Size = s.st_size;
|
||||
lt_info("%s auto-adding '%s' to playlist\n", __FUNCTION__, nextfile);
|
||||
hal_info("%s auto-adding '%s' to playlist\n", __FUNCTION__, nextfile);
|
||||
filelist.push_back(file);
|
||||
} while (true && num < 999);
|
||||
|
||||
@@ -710,7 +710,7 @@ int cPlayback::mf_open(int fileno)
|
||||
int cPlayback::mf_close(void)
|
||||
{
|
||||
int ret = 0;
|
||||
lt_info("%s in_fd = %d curr_fileno = %d\n", __FUNCTION__, in_fd, curr_fileno);
|
||||
hal_info("%s in_fd = %d curr_fileno = %d\n", __FUNCTION__, in_fd, curr_fileno);
|
||||
if (in_fd != -1)
|
||||
ret = close(in_fd);
|
||||
in_fd = curr_fileno = -1;
|
||||
@@ -761,11 +761,11 @@ off_t cPlayback::mf_lseek(off_t pos)
|
||||
|
||||
if ((int)fileno != curr_fileno)
|
||||
{
|
||||
lt_info("%s old fileno: %d new fileno: %d, offset: %lld\n", __FUNCTION__, curr_fileno, fileno, (long long)lpos);
|
||||
hal_info("%s old fileno: %d new fileno: %d, offset: %lld\n", __FUNCTION__, curr_fileno, fileno, (long long)lpos);
|
||||
in_fd = mf_open(fileno);
|
||||
if (in_fd < 0)
|
||||
{
|
||||
lt_info("cannot open file %d:%s (%m)\n", fileno, filelist[fileno].Name.c_str());
|
||||
hal_info("cannot open file %d:%s (%m)\n", fileno, filelist[fileno].Name.c_str());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -867,7 +867,7 @@ ssize_t cPlayback::read_ts()
|
||||
}
|
||||
if (ret < 0)
|
||||
{
|
||||
lt_info("%s failed1: %m\n", __FUNCTION__);
|
||||
hal_info("%s failed1: %m\n", __FUNCTION__);
|
||||
pthread_mutex_unlock(&currpos_mutex);
|
||||
return ret;
|
||||
}
|
||||
@@ -880,7 +880,7 @@ ssize_t cPlayback::read_ts()
|
||||
sync = sync_ts(pesbuf, ret);
|
||||
if (sync != 0)
|
||||
{
|
||||
lt_info("%s out of sync: %d\n", __FUNCTION__, sync);
|
||||
hal_info("%s out of sync: %d\n", __FUNCTION__, sync);
|
||||
if (sync < 0)
|
||||
{
|
||||
pthread_mutex_unlock(&currpos_mutex);
|
||||
@@ -888,7 +888,7 @@ ssize_t cPlayback::read_ts()
|
||||
}
|
||||
memmove(pesbuf, pesbuf + sync, ret - sync);
|
||||
if (pesbuf[0] != 0x47)
|
||||
lt_info("%s:%d??????????????????????????????\n", __FUNCTION__, __LINE__);
|
||||
hal_info("%s:%d??????????????????????????????\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
for (n = 0; n < done / 188 * 188; n += 188)
|
||||
{
|
||||
@@ -921,7 +921,7 @@ ssize_t cPlayback::read_ts()
|
||||
/* the output buffer is full, discard the input :-( */
|
||||
if (done - n > 0)
|
||||
{
|
||||
lt_debug("%s not done: %d, resetting filepos\n",
|
||||
hal_debug("%s not done: %d, resetting filepos\n",
|
||||
__FUNCTION__, done - n);
|
||||
mf_lseek(curr_pos - (done - n));
|
||||
}
|
||||
@@ -953,7 +953,7 @@ ssize_t cPlayback::read_ts()
|
||||
{
|
||||
pthread_mutex_unlock(&currpos_mutex);
|
||||
if (ret < 0)
|
||||
lt_info("%s failed2: %m\n", __FUNCTION__);
|
||||
hal_info("%s failed2: %m\n", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
inbuf_pos += ret;
|
||||
@@ -963,7 +963,7 @@ ssize_t cPlayback::read_ts()
|
||||
sync = sync_ts(inbuf + inbuf_sync, INBUF_SIZE - inbuf_sync);
|
||||
if (sync < 0)
|
||||
{
|
||||
lt_info("%s cannot sync\n", __FUNCTION__);
|
||||
hal_info("%s cannot sync\n", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
inbuf_sync += sync;
|
||||
@@ -983,7 +983,7 @@ ssize_t cPlayback::read_ts()
|
||||
continue;
|
||||
}
|
||||
if (synccnt)
|
||||
lt_info("%s TS went out of sync %d\n", __FUNCTION__, synccnt);
|
||||
hal_info("%s TS went out of sync %d\n", __FUNCTION__, synccnt);
|
||||
synccnt = 0;
|
||||
if (!(buf[1] & 0x40)) /* PUSI */
|
||||
{
|
||||
@@ -1006,7 +1006,7 @@ ssize_t cPlayback::read_ts()
|
||||
pts_curr = pts;
|
||||
if (pts_start < 0)
|
||||
{
|
||||
lt_info("%s updating pts_start to %lld ", __FUNCTION__, pts);
|
||||
hal_info("%s updating pts_start to %lld ", __FUNCTION__, pts);
|
||||
pts_start = pts;
|
||||
if (pts_end > -1)
|
||||
{
|
||||
@@ -1041,7 +1041,7 @@ ssize_t cPlayback::read_ts()
|
||||
tmp.ac3 = false;
|
||||
tmp.lang = "";
|
||||
astreams.insert(std::make_pair(pid, tmp));
|
||||
lt_info("%s found apid #%d 0x%04hx ac3:%d\n", __func__, astreams.size(), pid, tmp.ac3);
|
||||
hal_info("%s found apid #%d 0x%04hx ac3:%d\n", __func__, astreams.size(), pid, tmp.ac3);
|
||||
break;
|
||||
}
|
||||
i += 188;
|
||||
@@ -1062,7 +1062,7 @@ ssize_t cPlayback::read_mpeg()
|
||||
|
||||
if (INBUF_SIZE - inbuf_pos < toread)
|
||||
{
|
||||
lt_info("%s inbuf full, setting toread to %d (old: %zd)\n", __FUNCTION__, INBUF_SIZE - inbuf_pos, toread);
|
||||
hal_info("%s inbuf full, setting toread to %d (old: %zd)\n", __FUNCTION__, INBUF_SIZE - inbuf_pos, toread);
|
||||
toread = INBUF_SIZE - inbuf_pos;
|
||||
}
|
||||
pthread_mutex_lock(&currpos_mutex);
|
||||
@@ -1080,7 +1080,7 @@ ssize_t cPlayback::read_mpeg()
|
||||
if (ret < 0)
|
||||
{
|
||||
pthread_mutex_unlock(&currpos_mutex);
|
||||
lt_info("%s failed: %m, pesbuf_pos: %zd, toread: %zd\n", __FUNCTION__, pesbuf_pos, toread);
|
||||
hal_info("%s failed: %m, pesbuf_pos: %zd, toread: %zd\n", __FUNCTION__, pesbuf_pos, toread);
|
||||
return ret;
|
||||
}
|
||||
pesbuf_pos += ret;
|
||||
@@ -1098,12 +1098,12 @@ ssize_t cPlayback::read_mpeg()
|
||||
if (sync < 0)
|
||||
{
|
||||
if (pesbuf_pos - count - 10 > 4)
|
||||
lt_info("%s cannot sync (count=%d, pesbuf_pos=%zd)\n",
|
||||
hal_info("%s cannot sync (count=%d, pesbuf_pos=%zd)\n",
|
||||
__FUNCTION__, count, pesbuf_pos);
|
||||
break;
|
||||
}
|
||||
if (sync)
|
||||
lt_info("%s needed sync %zd\n", __FUNCTION__, sync);
|
||||
hal_info("%s needed sync %zd\n", __FUNCTION__, sync);
|
||||
count += sync;
|
||||
}
|
||||
uint8_t *ppes = pesbuf + count;
|
||||
@@ -1125,7 +1125,7 @@ ssize_t cPlayback::read_mpeg()
|
||||
}
|
||||
else
|
||||
{
|
||||
lt_info("%s weird pack header: 0x%2x\n", __FUNCTION__, ppes[4]);
|
||||
hal_info("%s weird pack header: 0x%2x\n", __FUNCTION__, ppes[4]);
|
||||
count++;
|
||||
}
|
||||
resync = true;
|
||||
@@ -1140,7 +1140,7 @@ ssize_t cPlayback::read_mpeg()
|
||||
// if (offset == 0x24 && subid == 0x10 ) // TTX?
|
||||
if (subid < 0x80 || subid > 0x87)
|
||||
break;
|
||||
lt_debug("AC3: ofs 0x%02x subid 0x%02x\n", off, subid);
|
||||
hal_debug("AC3: ofs 0x%02x subid 0x%02x\n", off, subid);
|
||||
//subid -= 0x60; // normalize to 32...39 (hex 0x20..0x27)
|
||||
|
||||
if (astreams.find(subid) == astreams.end())
|
||||
@@ -1149,7 +1149,7 @@ ssize_t cPlayback::read_mpeg()
|
||||
tmp.ac3 = true;
|
||||
tmp.lang = "";
|
||||
astreams.insert(std::make_pair(subid, tmp));
|
||||
lt_info("%s found aid: %02x\n", __FUNCTION__, subid);
|
||||
hal_info("%s found aid: %02x\n", __FUNCTION__, subid);
|
||||
}
|
||||
pid = subid;
|
||||
av = 2;
|
||||
@@ -1174,7 +1174,7 @@ ssize_t cPlayback::read_mpeg()
|
||||
tmp.ac3 = false;
|
||||
tmp.lang = "";
|
||||
astreams.insert(std::make_pair(id, tmp));
|
||||
lt_info("%s found aid: %02x\n", __FUNCTION__, id);
|
||||
hal_info("%s found aid: %02x\n", __FUNCTION__, id);
|
||||
}
|
||||
pid = id;
|
||||
av = 2;
|
||||
@@ -1193,7 +1193,7 @@ ssize_t cPlayback::read_mpeg()
|
||||
break;
|
||||
case 0xb9:
|
||||
case 0xbc:
|
||||
lt_debug("%s:%d %s\n", __FUNCTION__, __LINE__,
|
||||
hal_debug("%s:%d %s\n", __FUNCTION__, __LINE__,
|
||||
(ppes[3] == 0xb9) ? "program_end_code" : "program_stream_map");
|
||||
//resync = true;
|
||||
// fallthrough. TODO: implement properly.
|
||||
@@ -1209,14 +1209,14 @@ ssize_t cPlayback::read_mpeg()
|
||||
int pesPacketLen = ((ppes[4] << 8) | ppes[5]) + 6;
|
||||
if (count + pesPacketLen >= pesbuf_pos)
|
||||
{
|
||||
lt_debug("buffer len: %ld, pesPacketLen: %d :-(\n", pesbuf_pos - count, pesPacketLen);
|
||||
hal_debug("buffer len: %ld, pesPacketLen: %d :-(\n", pesbuf_pos - count, pesPacketLen);
|
||||
break;
|
||||
}
|
||||
|
||||
int tsPacksCount = pesPacketLen / 184;
|
||||
if ((tsPacksCount + 1) * 188 > INBUF_SIZE - inbuf_pos)
|
||||
{
|
||||
lt_info("not enough size in inbuf (needed %d, got %d)\n", (tsPacksCount + 1) * 188, INBUF_SIZE - inbuf_pos);
|
||||
hal_info("not enough size in inbuf (needed %d, got %d)\n", (tsPacksCount + 1) * 188, INBUF_SIZE - inbuf_pos);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1279,7 +1279,7 @@ off_t cPlayback::mp_seekSync(off_t pos)
|
||||
pthread_mutex_lock(&currpos_mutex);
|
||||
ret = mf_lseek(npos);
|
||||
if (ret < 0)
|
||||
lt_info("%s:%d lseek ret < 0 (%m)\n", __FUNCTION__, __LINE__);
|
||||
hal_info("%s:%d lseek ret < 0 (%m)\n", __FUNCTION__, __LINE__);
|
||||
|
||||
if (filetype != FILETYPE_TS)
|
||||
{
|
||||
@@ -1292,7 +1292,7 @@ off_t cPlayback::mp_seekSync(off_t pos)
|
||||
r = read(in_fd, &pkt[offset], 1024 - offset);
|
||||
if (r < 0)
|
||||
{
|
||||
lt_info("%s read failed: %m\n", __FUNCTION__);
|
||||
hal_info("%s read failed: %m\n", __FUNCTION__);
|
||||
break;
|
||||
}
|
||||
if (r == 0) // EOF?
|
||||
@@ -1301,7 +1301,7 @@ off_t cPlayback::mp_seekSync(off_t pos)
|
||||
break;
|
||||
if (mf_lseek(npos) < 0) /* next file in list? */
|
||||
{
|
||||
lt_info("%s:%d lseek ret < 0 (%m)\n", __FUNCTION__, __LINE__);
|
||||
hal_info("%s:%d lseek ret < 0 (%m)\n", __FUNCTION__, __LINE__);
|
||||
break;
|
||||
}
|
||||
retry = true;
|
||||
@@ -1320,17 +1320,17 @@ off_t cPlayback::mp_seekSync(off_t pos)
|
||||
else
|
||||
{
|
||||
npos += s;
|
||||
lt_info("%s sync after %lld\n", __FUNCTION__, npos - pos);
|
||||
hal_info("%s sync after %lld\n", __FUNCTION__, npos - pos);
|
||||
ret = mf_lseek(npos);
|
||||
pthread_mutex_unlock(&currpos_mutex);
|
||||
if (ret < 0)
|
||||
lt_info("%s:%d lseek ret < 0 (%m)\n", __FUNCTION__, __LINE__);
|
||||
hal_info("%s:%d lseek ret < 0 (%m)\n", __FUNCTION__, __LINE__);
|
||||
return ret;
|
||||
}
|
||||
if (npos > (pos + 0x20000)) /* 128k enough? */
|
||||
break;
|
||||
}
|
||||
lt_info("%s could not sync to PES offset: %d r: %zd\n", __FUNCTION__, offset, r);
|
||||
hal_info("%s could not sync to PES offset: %d r: %zd\n", __FUNCTION__, offset, r);
|
||||
ret = mf_lseek(pos);
|
||||
pthread_mutex_unlock(&currpos_mutex);
|
||||
return ret;
|
||||
@@ -1351,14 +1351,14 @@ off_t cPlayback::mp_seekSync(off_t pos)
|
||||
ret = mf_lseek(npos - 1); // assume sync ok
|
||||
pthread_mutex_unlock(&currpos_mutex);
|
||||
if (ret < 0)
|
||||
lt_info("%s:%d lseek ret < 0 (%m)\n", __FUNCTION__, __LINE__);
|
||||
hal_info("%s:%d lseek ret < 0 (%m)\n", __FUNCTION__, __LINE__);
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = mf_lseek(npos); // oops, next pkt doesn't start with sync
|
||||
if (ret < 0)
|
||||
lt_info("%s:%d lseek ret < 0 (%m)\n", __FUNCTION__, __LINE__);
|
||||
hal_info("%s:%d lseek ret < 0 (%m)\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1495,7 +1495,7 @@ static int mp_syncPES(uint8_t *buf, int len, bool quiet)
|
||||
}
|
||||
|
||||
if (!quiet && len > 5) /* only warn if enough space was available... */
|
||||
lt_info_c("%s No valid PES signature found. %d Bytes deleted.\n", __FUNCTION__, ret);
|
||||
hal_info_c("%s No valid PES signature found. %d Bytes deleted.\n", __FUNCTION__, ret);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user