You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
Export PCR pid
This commit is contained in:
committed by
Michael Niedermayer
parent
24adef142f
commit
5501afa6ee
@@ -650,6 +650,7 @@ typedef struct AVProgram {
|
|||||||
|
|
||||||
int program_num;
|
int program_num;
|
||||||
int pmt_pid;
|
int pmt_pid;
|
||||||
|
int pcr_pid;
|
||||||
} AVProgram;
|
} AVProgram;
|
||||||
|
|
||||||
#define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present
|
#define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present
|
||||||
|
@@ -221,6 +221,17 @@ static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid, unsigned i
|
|||||||
p->pids[p->nb_pids++] = pid;
|
p->pids[p->nb_pids++] = pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void set_pcr_pid(AVFormatContext *s, unsigned int programid, unsigned int pid)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(i=0; i<s->nb_programs; i++) {
|
||||||
|
if(s->programs[i]->id == programid) {
|
||||||
|
s->programs[i]->pcr_pid = pid;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief discard_pid() decides if the pid is to be discarded according
|
* \brief discard_pid() decides if the pid is to be discarded according
|
||||||
* to caller's programs selection
|
* to caller's programs selection
|
||||||
@@ -1039,6 +1050,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
|
|||||||
if (pcr_pid < 0)
|
if (pcr_pid < 0)
|
||||||
return;
|
return;
|
||||||
add_pid_to_pmt(ts, h->id, pcr_pid);
|
add_pid_to_pmt(ts, h->id, pcr_pid);
|
||||||
|
set_pcr_pid(ts->stream, h->id, pcr_pid);
|
||||||
|
|
||||||
av_dlog(ts->stream, "pcr_pid=0x%x\n", pcr_pid);
|
av_dlog(ts->stream, "pcr_pid=0x%x\n", pcr_pid);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user