[FFmpeg-devel] [PATCH] libavformat: forced PCR pid in mpegts muxer

Moritz Barsnick barsnick at gmx.net
Tue Apr 23 15:20:20 EEST 2019


On Tue, Apr 23, 2019 at 12:03:11 +0000, Andreas HÃ¥kon wrote:
> In addition, one correction regarding the initialization.
> Sorry, but first version has an error. This is clean!

I had seen that the option got initialized to 0x0000, but checked that
that is never a legally assigned pid (there's a "< 16" check
somewhere), so figured it would be okay as a default.

>          ts_st->discontinuity   = ts->flags & MPEGTS_FLAG_DISCONT;
> -        /* update PCR pid by using the first video stream */
> -        if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
> -            service->pcr_pid == 0x1fff) {
> +        /* update PCR pid by: forced pid or using the first video stream */
> +        if ((ts->pcr_forced_pid != 0x0010 && ts_st->pid == ts->pcr_forced_pid) ||
> +            (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && service->pcr_pid == 0x1fff)) {
>              service->pcr_pid = ts_st->pid;

Okay if pid 0x0010 shall actually never carry the PCR. (Probably
0x0010-0x001F if I guess by Wikipedia's list of PIDs properly, but
then, the article isn't very well written for my understanding, and I
have no idea about PIDs.)

Cheers,
Moritz


More information about the ffmpeg-devel mailing list