Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Marton Balint <cus@passwd.hu>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avformat/mpegtsenc: Always output a minimum of 32 packets.
Date: Mon, 28 Nov 2022 23:25:07 +0100 (CET)
Message-ID: <8be53e8-a1e8-1a62-b6af-73194189bf19@passwd.hu> (raw)
In-Reply-To: <20221128204551.4441-1-jamrial@gmail.com>



On Mon, 28 Nov 2022, James Almer wrote:

> From: Thierry Foucu <tfoucu@gmail.com>
>
> Otherwise, if you just output a PAT/PMT and a single TS packets, the
> demuxer will not be able to detect TS.

This looks like a demuxer bug, which should be fixed in the demuxer, and 
not in the muxer.

Regards,
Marton

>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> libavformat/mpegtsenc.c | 11 ++++-------
> tests/ref/acodec/s302m  |  4 ++--
> tests/ref/lavf/ts       |  4 ++--
> 3 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> index 48d39e6a7d..760e5fd8c6 100644
> --- a/libavformat/mpegtsenc.c
> +++ b/libavformat/mpegtsenc.c
> @@ -2147,8 +2147,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
>
> static void mpegts_write_flush(AVFormatContext *s)
> {
> -    MpegTSWrite *ts = s->priv_data;
> -    int i;
> +    int packets, i;
>
>     /* flush current packets */
>     for (i = 0; i < s->nb_streams; i++) {
> @@ -2163,11 +2162,9 @@ static void mpegts_write_flush(AVFormatContext *s)
>         }
>     }
>
> -    if (ts->m2ts_mode) {
> -        int packets = (avio_tell(s->pb) / (TS_PACKET_SIZE + 4)) % 32;
> -        while (packets++ < 32)
> -            mpegts_insert_null_packet(s);
> -    }
> +    packets = (avio_tell(s->pb) / (TS_PACKET_SIZE + 4)) % 32;
> +    while (packets++ < 32)
> +        mpegts_insert_null_packet(s);
> }
>
> static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
> diff --git a/tests/ref/acodec/s302m b/tests/ref/acodec/s302m
> index 2919ed6e55..5c12d5ff69 100644
> --- a/tests/ref/acodec/s302m
> +++ b/tests/ref/acodec/s302m
> @@ -1,4 +1,4 @@
> -0bf5457fd41a22fc5cdd99ae5ad4e273 *tests/data/fate/acodec-s302m.mpegts
> -1527688 tests/data/fate/acodec-s302m.mpegts
> +51fdac8dddb34b067f458b8114e3a32c *tests/data/fate/acodec-s302m.mpegts
> +1529944 tests/data/fate/acodec-s302m.mpegts
> 31f25a0020fd9017de9c3c608316854b *tests/data/fate/acodec-s302m.out.wav
> stddev:  986.94 PSNR: 36.44 MAXDIFF:18571 bytes:  1058400/  1056708
> diff --git a/tests/ref/lavf/ts b/tests/ref/lavf/ts
> index b004fc1b1c..cb5395abbc 100644
> --- a/tests/ref/lavf/ts
> +++ b/tests/ref/lavf/ts
> @@ -1,3 +1,3 @@
> -371dc016eb3155116bea27e3b4eeb928 *tests/data/lavf/lavf.ts
> -389160 tests/data/lavf/lavf.ts
> +cf342532317c4ae802c4f95f7d1f2459 *tests/data/lavf/lavf.ts
> +393296 tests/data/lavf/lavf.ts
> tests/data/lavf/lavf.ts CRC=0x71287e25
> -- 
> 2.38.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2022-11-28 22:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 20:45 James Almer
2022-11-28 22:25 ` Marton Balint [this message]
2022-11-29 22:21   ` Derek Buitenhuis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8be53e8-a1e8-1a62-b6af-73194189bf19@passwd.hu \
    --to=cus@passwd.hu \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git