From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id C951244EF3 for ; Mon, 28 Nov 2022 22:25:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1EB4D68B815; Tue, 29 Nov 2022 00:25:18 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4E7AB68AE56 for ; Tue, 29 Nov 2022 00:25:11 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 7CC59E7B39 for ; Mon, 28 Nov 2022 23:25:09 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kBDNP2QCUWnI for ; Mon, 28 Nov 2022 23:25:07 +0100 (CET) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 8BB2CE7B0E for ; Mon, 28 Nov 2022 23:25:07 +0100 (CET) Date: Mon, 28 Nov 2022 23:25:07 +0100 (CET) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20221128204551.4441-1-jamrial@gmail.com> Message-ID: <8be53e8-a1e8-1a62-b6af-73194189bf19@passwd.hu> References: <20221128204551.4441-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avformat/mpegtsenc: Always output a minimum of 32 packets. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Mon, 28 Nov 2022, James Almer wrote: > From: Thierry Foucu > > 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 > --- > 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".