mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Improved clearing the MTD buffer and syncing on TS packets
This commit is contained in:
11
remux.h
11
remux.h
@@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: remux.h 4.2 2017/02/27 16:11:57 kls Exp $
|
||||
* $Id: remux.h 4.3 2017/03/26 13:06:37 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __REMUX_H
|
||||
@@ -144,6 +144,15 @@ inline int64_t TsGetPcr(const uchar *p)
|
||||
void TsHidePayload(uchar *p);
|
||||
void TsSetPcr(uchar *p, int64_t Pcr);
|
||||
|
||||
// Helper macro and function to quickly check whether Data points to the beginning
|
||||
// of a TS packet. The return value is the number of bytes that need to be skipped
|
||||
// to synchronize on the next TS packet (zero if already sync'd). TsSync() can be
|
||||
// called directly, the macro just performs the initial check inline and adds some
|
||||
// debug information for logging.
|
||||
|
||||
#define TS_SYNC(Data, Length) (*Data == TS_SYNC_BYTE ? 0 : TsSync(Data, Length, __FILE__, __FUNCTION__, __LINE__))
|
||||
int TsSync(const uchar *Data, int Length, const char *File = NULL, const char *Function = NULL, int Line = 0);
|
||||
|
||||
// The following functions all take a pointer to a sequence of complete TS packets.
|
||||
|
||||
int64_t TsGetPts(const uchar *p, int l);
|
||||
|
||||
Reference in New Issue
Block a user