Re: [FFmpeg-devel] [PATCH 1/2] libavformat/hlsenc: Enable HTTP, persistent connections for hls_delete_file

2022-11-28 Thread Basel Sayeh
Please ignore this version and use the other one, as it was sent using 
the wrong email client and the patch is missed up.


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] avformat/mpegtsenc: Always output a minimum of 32 packets.

2022-11-28 Thread Marton Balint




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-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/3] avcodec/mpeg12dec: Check input size

2022-11-28 Thread Michael Niedermayer
On Mon, Nov 28, 2022 at 12:47:32AM +, Kieran Kunhya wrote:
> On Sun, 27 Nov 2022 at 22:34, Michael Niedermayer 
> wrote:
> 
> > Fixes: Timeout
> > Fixes:
> > 53599/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IPU_fuzzer-4950102511058944
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by
> > :
> > Michael Niedermayer 
> > ---
> >  libavcodec/mpeg12dec.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> > index 914516bbd9..c93368e255 100644
> > --- a/libavcodec/mpeg12dec.c
> > +++ b/libavcodec/mpeg12dec.c
> > @@ -2969,6 +2969,9 @@ static int ipu_decode_frame(AVCodecContext *avctx,
> > AVFrame *frame,
> >  GetBitContext *gb = &m->gb;
> >  int ret;
> >
> > +if (avpkt->size*8LL < (avctx->width+15)/16 * ((avctx->height+15)/16)
> > * 2 * 7)
> > +return AVERROR_INVALIDDATA;
> > +
> >  ret = ff_get_buffer(avctx, frame, 0);
> >  if (ret < 0)
> >  return ret;
> >
> 
> Where does this AVPacket limitation come from?
> Are you able to explain in a comment where these numbers come from? In
> particular the "2 * 7".

the ipu format has 2 bits minimum per MB except the first but theres more than
1 bit before so that can be simplified to 2 bits minimum per MB "header"
each MB has 6 blocks
blocks can be mpeg1 intra or mpeg2 intra these will at least contain one DC VLC
and the shortest is 2 bits. We could consider that the luma one is min 3 but i
didnt also we could consider teh AC EOB again i didnt
6 blocks 2 bits + 2 for MB is 7*2
(3*4 + 2*2 + 2) would consider the luma dc seperatly.
we could add a 6*2 for the AC EOBs
so 2 + 3*4 + 2*2 + 6*2 would be closer to the theoretic minimum.
i will change the code to that and add a comment that this is the minimum
MB size considering MB, DC and AC-EOB

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH] avformat/mpegtsenc: Always output a minimum of 32 packets.

2022-11-28 Thread James Almer
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.

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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] mpegts: identify and demux DSMCC-B/MHEG streams

2022-11-28 Thread Scott Theisen

Ping for review.

Thanks in advance,

Scott Theisen

On 11/13/22 18:19, Scott Theisen wrote:

Ping for review.

On 9/17/22 13:08, Scott Theisen wrote:

These changes are from MythTV.
---

The `AV_CODEC_ID`s are probably in the wrong place since these are
data codecs, but that is where they are In MythTV.

There was also a related change to libavformat/demux.c's
avformat_find_stream_info() trying to optimize it for MHEG streams,
but it is unnecessary and was causing FATE to fail.

  libavcodec/codec_desc.c |  12 +++
  libavcodec/codec_id.h   |   6 ++
  libavformat/avformat.h  |   5 +
  libavformat/mpegts.c    | 199 +++-
  libavformat/mpegts.h    |  17 
  5 files changed, 237 insertions(+), 2 deletions(-)

diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 648c518b3c..0e54087863 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -3488,6 +3488,18 @@ static const AVCodecDescriptor 
codec_descriptors[] = {

  .props = AV_CODEC_PROP_TEXT_SUB,
  .profiles  = NULL_IF_CONFIG_SMALL(ff_arib_caption_profiles),
  },
+    {
+    .id    = AV_CODEC_ID_DVB_VBI,
+    .type  = AVMEDIA_TYPE_DATA,
+    .name  = "dvb_vbi",
+    .long_name = NULL_IF_CONFIG_SMALL("dvb teletext"),
+    },
+    {
+    .id    = AV_CODEC_ID_DSMCC_B,
+    .type  = AVMEDIA_TYPE_DATA,
+    .name  = "dsmcc_b",
+    .long_name = NULL_IF_CONFIG_SMALL("DSMCC B"),
+    },
    /* other kind of codecs and pseudo-codecs */
  {
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index bc8226ff07..7e2198a800 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -559,6 +559,12 @@ enum AVCodecID {
  AV_CODEC_ID_TTML,
  AV_CODEC_ID_ARIB_CAPTION,
  +    /* teletext codecs */
+    AV_CODEC_ID_DVB_VBI,
+
+    /* DSMCC codec */
+    AV_CODEC_ID_DSMCC_B,
+
  /* other specific kind of codecs (generally used for 
attachments) */
  AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,   ///< A dummy ID 
pointing at the start of various fake codecs.

  AV_CODEC_ID_TTF = 0x18000,
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 9d46875cce..664a1afa61 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1117,6 +1117,11 @@ typedef struct AVStream {
   *
   */
  int pts_wrap_bits;
+
+    /* MHEG support */
+    int component_tag; ///< Component tag given in PMT
+    int carousel_id;
+    int data_id;
  } AVStream;
    struct AVCodecParserContext *av_stream_get_parser(const AVStream 
*s);

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 8a3436f2be..be8edd9e62 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -46,6 +46,15 @@
  #include 
  #endif
  +typedef struct SectionContext {
+    int pid;
+    int stream_type;
+    int new_packet;
+    MpegTSContext *ts;
+    AVFormatContext *stream;
+    AVStream *st;
+} SectionContext;
+
  /* maximum size in which we look for synchronization if
   * synchronization is lost */
  #define MAX_RESYNC_SIZE 65536
@@ -412,6 +421,8 @@ static int discard_pid(MpegTSContext *ts, 
unsigned int pid)

  return !used && discarded;
  }
  +static void mpegts_push_section(MpegTSFilter *filter, const 
uint8_t *section, int section_len);

+
  /**
   *  Assemble PES packets out of TS packets, and then call the 
"section_cb"

   *  function when they are complete.
@@ -438,6 +449,11 @@ static void write_section_data(MpegTSContext 
*ts, MpegTSFilter *tss1,

  tss->section_index += len;
  }
  +    if (tss->section_cb == mpegts_push_section) {
+    SectionContext *sect = tss->opaque;
+    sect->new_packet = 1;
+    }
+
  offset = 0;
  cur_section_buf = tss->section_buf;
  while (cur_section_buf - tss->section_buf < MAX_SECTION_SIZE && 
cur_section_buf[0] != 0xff) {

@@ -798,6 +814,7 @@ static const StreamType ISO_types[] = {
  { 0x02, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_MPEG2VIDEO },
  { 0x03, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_MP3    },
  { 0x04, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_MP3    },
+    { 0x0b, AVMEDIA_TYPE_DATA,  AV_CODEC_ID_DSMCC_B    }, /* 
DVB_CAROUSEL_ID */

  { 0x0f, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AAC    },
  { 0x10, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_MPEG4  },
  /* Makito encoder sets stream type 0x11 for AAC,
@@ -882,11 +899,20 @@ static const StreamType DESC_types[] = {
  { 0x6a, AVMEDIA_TYPE_AUDIO,    AV_CODEC_ID_AC3  }, /* 
AC-3 descriptor */
  { 0x7a, AVMEDIA_TYPE_AUDIO,    AV_CODEC_ID_EAC3 }, /* 
E-AC-3 descriptor */

  { 0x7b, AVMEDIA_TYPE_AUDIO,    AV_CODEC_ID_DTS  },
+    { 0x13, AVMEDIA_TYPE_DATA, AV_CODEC_ID_DSMCC_B  }, /* 
DVB_CAROUSEL_ID */
+    { 0x45, AVMEDIA_TYPE_DATA, AV_CODEC_ID_DVB_VBI  }, /* 
DVB_VBI_DATA_ID */
+    { 0x46, AVMEDIA_TYPE_DATA, AV_CODEC_ID_DVB_VBI  }, /* 
DVB_VBI_TELETEXT_ID */ //FixMe type subtilte

  { 0x56, AVMEDIA_TYPE_

Re: [FFmpeg-devel] [PATCH] avcodec/pictordec: Remove mid exit branch

2022-11-28 Thread Michael Niedermayer
On Sat, Nov 26, 2022 at 10:43:34AM +1100, Peter Ross wrote:
> On Fri, Nov 25, 2022 at 09:18:33PM +0100, Michael Niedermayer wrote:
> > This causes the RLE decoder to exit before applying the last RLE run
> > All images i tested with are unchanged, this makes the special case
> > for handling the last run unused for non truncated images.
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/pictordec.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c
> > index 09229b94fd..27f5b96571 100644
> > --- a/libavcodec/pictordec.c
> > +++ b/libavcodec/pictordec.c
> > @@ -246,8 +246,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
> > *frame,
> >  run = bytestream2_get_le16(&s->g);
> >  val = bytestream2_get_byte(&s->g);
> >  }
> > -if (!bytestream2_get_bytes_left(&s->g))
> > -break;
> >  
> >  if (bits_per_plane == 8) {
> >  picmemset_8bpp(s, frame, val, run, &x, &y);
> > -- 
> > 2.17.1
> 
> ok

will apply

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 1/3] avcodec/bonk: Use unsigned in predictor_init_state() to avoid undefined behavior

2022-11-28 Thread Michael Niedermayer
On Thu, Nov 17, 2022 at 12:32:18AM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: -5010 * -717450 cannot be represented in type 
> 'int'
> Fixes: 
> 53370/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-4945644204195840
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/bonk.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

will apply remaining patches (1+3) of this patchset

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/tiff: Avoid 0.0/0.0 in camera_xyz_coeff()

2022-11-28 Thread Michael Niedermayer
On Fri, Nov 18, 2022 at 12:14:17AM +0100, Michael Niedermayer wrote:
> Fixes: division by zero
> Fixes: 
> 52230/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5922608915021824
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/tiff.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/h263dec: Avoid parsing extradata repeatedly

2022-11-28 Thread Michael Niedermayer
On Mon, Nov 21, 2022 at 07:53:53PM +0100, Michael Niedermayer wrote:
> On Mon, Nov 21, 2022 at 12:53:26PM +0100, Anton Khirnov wrote:
> > Quoting Michael Niedermayer (2022-11-18 00:14:18)
> > > Fixes: Timeout
> > > Fixes: 
> > > 52329/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-4716563886637056
> > > 
> > > Found-by: continuous fuzzing process 
> > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >  libavcodec/h263dec.c   | 3 ++-
> > >  libavcodec/mpegvideo.h | 1 +
> > >  2 files changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> > > index 71b846ba74..4eab43d939 100644
> > > --- a/libavcodec/h263dec.c
> > > +++ b/libavcodec/h263dec.c
> > > @@ -492,11 +492,12 @@ retry:
> > >  } else if (CONFIG_MSMPEG4DEC && s->msmpeg4_version) {
> > >  ret = ff_msmpeg4_decode_picture_header(s);
> > >  } else if (CONFIG_MPEG4_DECODER && avctx->codec_id == 
> > > AV_CODEC_ID_MPEG4) {
> > > -if (s->avctx->extradata_size && s->picture_number == 0) {
> > > +if (s->avctx->extradata_size && s->picture_number == 0 && 
> > > !s->extradata_parsed) {
> > 
> > Wouldn't it make sense to get rid of the picture_number condition now?
> 
> I was thinking about droping it too. I dont know why i didnt, you are correct

will apply with the picture_number condition removed

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 2/4] avformat/id3v2: Check taglen in read_uslt()

2022-11-28 Thread Michael Niedermayer
On Fri, Nov 18, 2022 at 10:09:16PM +0100, Michael Niedermayer wrote:
> Fixes: Timeout (read mostly the same data repeatly)
> Fixes: 
> 52457/clusterfuzz-testcase-minimized-ffmpeg_dem_ALP_fuzzer-6610706313379840
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/id3v2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 3/4] avcodec/mobiclip: Check input size before (re)allocation

2022-11-28 Thread Michael Niedermayer
On Fri, Nov 18, 2022 at 10:09:17PM +0100, Michael Niedermayer wrote:
> Fixes: Timeout
> Fixes: 
> 52566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-4913160050311168
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/mobiclip.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH 2/2] libavformat/dashenc: Enable HTTP persistent connections for dashenc_delete_file

2022-11-28 Thread Basel Sayeh
Signed-off-by: Basel Sayeh 
---
 libavformat/dashenc.c | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 9c1bcad9e3..ba0eb913a1 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -179,6 +179,7 @@ typedef struct DASHContext {
 int master_playlist_created;
 AVIOContext *mpd_out;
 AVIOContext *m3u8_out;
+AVIOContext *http_delete;
 int streaming;
 int64_t timeout;
 int index_correction;
@@ -642,6 +643,7 @@ static void dash_free(AVFormatContext *s)
 
 ff_format_io_close(s, &c->mpd_out);
 ff_format_io_close(s, &c->m3u8_out);
+ff_format_io_close(s, &c->http_delete);
 }
 
 static void output_segment_list(OutputStream *os, AVIOContext *out, 
AVFormatContext *s,
@@ -1855,18 +1857,22 @@ static void dashenc_delete_file(AVFormatContext *s, 
char *filename) {
 int http_base_proto = ff_is_http_proto(filename);
 
 if (http_base_proto) {
-AVIOContext *out = NULL;
 AVDictionary *http_opts = NULL;
 
 set_http_options(&http_opts, c);
 av_dict_set(&http_opts, "method", "DELETE", 0);
 
-if (dashenc_io_open(s, &out, filename, &http_opts) < 0) {
+if (dashenc_io_open(s, &c->http_delete, filename, &http_opts) < 0) {
 av_log(s, AV_LOG_ERROR, "failed to delete %s\n", filename);
+} else {
+//Nothing to write
+avio_flush(c->http_delete);
+dashenc_io_close(s, &c->http_delete, filename);
 }
-
 av_dict_free(&http_opts);
-ff_format_io_close(s, &out);
+
+if (!c->http_persistent)
+ff_format_io_close(s, &c->http_delete);
 } else {
 int res = ffurl_delete(filename);
 if (res < 0) {
-- 
2.30.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH 1/2] libavformat/hlsenc: Enable HTTP persistent connections for hls_delete_file

2022-11-28 Thread Basel Sayeh
Signed-off-by: Basel Sayeh 
---
 libavformat/hlsenc.c | 17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index a86fc8907f..e4749aad87 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -252,6 +252,7 @@ typedef struct HLSContext {
 int http_persistent;
 AVIOContext *m3u8_out;
 AVIOContext *sub_m3u8_out;
+AVIOContext *http_delete;
 int64_t timeout;
 int ignore_io_errors;
 char *headers;
@@ -569,15 +570,20 @@ static int hls_delete_file(HLSContext *hls, 
AVFormatContext *avf,
 {
 if (hls->method || (proto && !av_strcasecmp(proto, "http"))) {
 AVDictionary *opt = NULL;
-AVIOContext  *out = NULL;
 int ret;
+
 set_http_options(avf, &opt, hls);
 av_dict_set(&opt, "method", "DELETE", 0);
-ret = avf->io_open(avf, &out, path, AVIO_FLAG_WRITE, &opt);
+ret = hlsenc_io_open(avf, &hls->http_delete, path, &opt);
 av_dict_free(&opt);
 if (ret < 0)
 return hls->ignore_io_errors ? 1 : ret;
-ff_format_io_close(avf, &out);
+
+//Nothing to write
+avio_flush(hls->http_delete);
+hlsenc_io_close(avf, &hls->http_delete, path);
+if (!hls->http_persistent)
+ff_format_io_close(avf, &hls->http_delete);
 } else if (unlink(path) < 0) {
 av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n",
path, strerror(errno));
@@ -662,7 +668,7 @@ static int hls_delete_old_segments(AVFormatContext *s, 
HLSContext *hls,
 }
 
 proto = avio_find_protocol_name(s->url);
-if (ret = hls_delete_file(hls, vs->avf, path.str, proto))
+if (ret = hls_delete_file(hls, s, path.str, proto))
 goto fail;
 
 if ((segment->sub_filename[0] != '\0')) {
@@ -679,7 +685,7 @@ static int hls_delete_old_segments(AVFormatContext *s, 
HLSContext *hls,
 goto fail;
 }
 
-if (ret = hls_delete_file(hls, vs->vtt_avf, path.str, proto))
+if (ret = hls_delete_file(hls, s, path.str, proto))
 goto fail;
 }
 av_bprint_clear(&path);
@@ -2707,6 +2713,7 @@ static void hls_deinit(AVFormatContext *s)
 
 ff_format_io_close(s, &hls->m3u8_out);
 ff_format_io_close(s, &hls->sub_m3u8_out);
+ff_format_io_close(s, &hls->http_delete);
 av_freep(&hls->key_basename);
 av_freep(&hls->var_streams);
 av_freep(&hls->cc_streams);
-- 
2.30.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH 1/2] libavformat/hlsenc: Enable HTTP persistent connections for hls_delete_file

2022-11-28 Thread Basel Sayeh

Signed-off-by: Basel Sayeh 
---
 libavformat/hlsenc.c | 17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index a86fc8907f..e4749aad87 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -252,6 +252,7 @@ typedef struct HLSContext {
 int http_persistent;
 AVIOContext *m3u8_out;
 AVIOContext *sub_m3u8_out;
+AVIOContext *http_delete;
 int64_t timeout;
 int ignore_io_errors;
 char *headers;
@@ -569,15 +570,20 @@ static int hls_delete_file(HLSContext *hls, 
AVFormatContext *avf,

 {
 if (hls->method || (proto && !av_strcasecmp(proto, "http"))) {
 AVDictionary *opt = NULL;
-AVIOContext  *out = NULL;
 int ret;
+
 set_http_options(avf, &opt, hls);
 av_dict_set(&opt, "method", "DELETE", 0);
-ret = avf->io_open(avf, &out, path, AVIO_FLAG_WRITE, &opt);
+ret = hlsenc_io_open(avf, &hls->http_delete, path, &opt);
 av_dict_free(&opt);
 if (ret < 0)
 return hls->ignore_io_errors ? 1 : ret;
-ff_format_io_close(avf, &out);
+
+//Nothing to write
+avio_flush(hls->http_delete);
+hlsenc_io_close(avf, &hls->http_delete, path);
+if (!hls->http_persistent)
+ff_format_io_close(avf, &hls->http_delete);
 } else if (unlink(path) < 0) {
 av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n",
path, strerror(errno));
@@ -662,7 +668,7 @@ static int hls_delete_old_segments(AVFormatContext 
*s, HLSContext *hls,

 }
  proto = avio_find_protocol_name(s->url);
-if (ret = hls_delete_file(hls, vs->avf, path.str, proto))
+if (ret = hls_delete_file(hls, s, path.str, proto))
 goto fail;
  if ((segment->sub_filename[0] != '\0')) {
@@ -679,7 +685,7 @@ static int hls_delete_old_segments(AVFormatContext 
*s, HLSContext *hls,

 goto fail;
 }
 -if (ret = hls_delete_file(hls, vs->vtt_avf, path.str, proto))
+if (ret = hls_delete_file(hls, s, path.str, proto))
 goto fail;
 }
 av_bprint_clear(&path);
@@ -2707,6 +2713,7 @@ static void hls_deinit(AVFormatContext *s)
  ff_format_io_close(s, &hls->m3u8_out);
 ff_format_io_close(s, &hls->sub_m3u8_out);
+ff_format_io_close(s, &hls->http_delete);
 av_freep(&hls->key_basename);
 av_freep(&hls->var_streams);
 av_freep(&hls->cc_streams);
--
2.30.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH 2/2] libavformat/dashenc: Enable HTTP persistent connections for dashenc_delete_file

2022-11-28 Thread Basel Sayeh

Signed-off-by: Basel Sayeh 
---
 libavformat/dashenc.c | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 9c1bcad9e3..ba0eb913a1 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -179,6 +179,7 @@ typedef struct DASHContext {
 int master_playlist_created;
 AVIOContext *mpd_out;
 AVIOContext *m3u8_out;
+AVIOContext *http_delete;
 int streaming;
 int64_t timeout;
 int index_correction;
@@ -642,6 +643,7 @@ static void dash_free(AVFormatContext *s)
  ff_format_io_close(s, &c->mpd_out);
 ff_format_io_close(s, &c->m3u8_out);
+ff_format_io_close(s, &c->http_delete);
 }
  static void output_segment_list(OutputStream *os, AVIOContext *out, 
AVFormatContext *s,
@@ -1855,18 +1857,22 @@ static void dashenc_delete_file(AVFormatContext 
*s, char *filename) {

 int http_base_proto = ff_is_http_proto(filename);
  if (http_base_proto) {
-AVIOContext *out = NULL;
 AVDictionary *http_opts = NULL;
  set_http_options(&http_opts, c);
 av_dict_set(&http_opts, "method", "DELETE", 0);
 -if (dashenc_io_open(s, &out, filename, &http_opts) < 0) {
+if (dashenc_io_open(s, &c->http_delete, filename, &http_opts) < 
0) {

 av_log(s, AV_LOG_ERROR, "failed to delete %s\n", filename);
+} else {
+//Nothing to write
+avio_flush(c->http_delete);
+dashenc_io_close(s, &c->http_delete, filename);
 }
-
 av_dict_free(&http_opts);
-ff_format_io_close(s, &out);
+
+if (!c->http_persistent)
+ff_format_io_close(s, &c->http_delete);
 } else {
 int res = ffurl_delete(filename);
 if (res < 0) {
--
2.30.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH 2/2] av1dec: fix typo in logged error

2022-11-28 Thread Tristan Matthews
---
 libavcodec/av1dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 80da0943d4..d83c902f1f 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -567,7 +567,7 @@ static int get_pixel_format(AVCodecContext *avctx)
  * implemented in the future, need remove this check.
  */
 if (!avctx->hwaccel) {
-av_log(avctx, AV_LOG_ERROR, "Your platform doesn't suppport"
+av_log(avctx, AV_LOG_ERROR, "Your platform doesn't support"
" hardware accelerated AV1 decoding.\n");
 return AVERROR(ENOSYS);
 }
-- 
2.34.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/2] av1dec: fix comment typo

2022-11-28 Thread Tristan Matthews
---
 libavcodec/av1dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 0c24eac842..80da0943d4 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -194,7 +194,7 @@ static uint8_t get_shear_params_valid(AV1DecContext *s, int 
idx)
 }
 
 /**
-* update gm type/params, since cbs already implemented part of this funcation,
+* update gm type/params, since cbs already implemented part of this function,
 * so we don't need to full implement spec.
 */
 static void global_motion_params(AV1DecContext *s)
-- 
2.34.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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [EXTERNAL] [PATCH v2 2/2] ibavformat/mov: Add support for exporting poster time.

2022-11-28 Thread Bryce Newman
Hi,
This should address the feedback from a prior change that was not accepted.
Could I please get some eyes on this?
Thank you in advance.
Bryce



Bryce Chester Newman | Principal Developer
 
p: +12069255045 | 



From: Bryce Chester Newman 
Date: Wednesday, October 5, 2022 at 8:25 AM
To: ffmpeg-devel@ffmpeg.org 
Cc: Bryce Newman , Bryce Newman 

Subject: [EXTERNAL] [PATCH v2 2/2] ibavformat/mov: Add support for exporting 
poster time.
From: Bryce Chester Newman 

Change demuxer option name from
poster_time_location
to export_poster_time_location.

Export the poster_time_location if available.
The poster_time_location is calculated using
the poster_time / time_scale = X seconds.
The value of poster_time_location indicates
where in the video the poster frame is.

Addresses feedback
from https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg138122.html.

Signed-off-by: Bryce Chester Newman bryce.new...@gettyimages.com
---
 doc/demuxers.texi  | 4 ++--
 libavformat/isom.h | 2 +-
 libavformat/mov.c  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index b1f4926c40..447287357d 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -750,10 +750,10 @@ cast to int32 are used to adjust onward dts.
 Unit is the track time scale. Range is 0 to UINT_MAX. Default is 
@code{UINT_MAX - 48000*10} which allows upto
 a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% 
of @code{uint32} range.

-@item poster_time_location
+@item export_poster_time_location
 Export the poster_time_location if available.
 The poster_time_location is calculated using the poster_time / time_scale = X 
seconds.
-The value of poster_time_location indicates where in the video the poster 
frame is.
+The value of the poster_time_location key indicates where in the video the 
poster frame is.
 Default is false.
 @end table

diff --git a/libavformat/isom.h b/libavformat/isom.h
index fb3d8d5618..f621abec76 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -326,7 +326,7 @@ typedef struct MOVContext {
 int64_t extent_offset;
 } *avif_info;
 int avif_info_size;
-int poster_time_location;
+int export_poster_time_location;
 } MOVContext;

 int ff_mp4_read_descr_len(AVIOContext *pb);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b914bbc96a..be939f6cc2 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1542,7 +1542,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 avio_rb32(pb); /* current time */
 avio_rb32(pb); /* next track ID */

-if(c->poster_time_location && poster_time && c->time_scale && 
c->time_scale > 0) {
+if(c->export_poster_time_location && poster_time && c->time_scale && 
c->time_scale > 0) {
 av_log(c->fc, AV_LOG_TRACE, "poster_time = %i, time_scale = %i\n", 
poster_time, c->time_scale);
 char buffer[32];
 int poster_time_location = poster_time / c->time_scale;
@@ -9123,7 +9123,7 @@ static const AVOption mov_options[] = {
 { "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), 
AV_OPT_TYPE_BOOL,
 {.i64 = 0}, 0, 1, FLAGS },
 { "max_stts_delta", "treat offsets above this value as invalid", 
OFFSET(max_stts_delta), AV_OPT_TYPE_INT, {.i64 = UINT_MAX-48000*10 }, 0, 
UINT_MAX, .flags = AV_OPT_FLAG_DECODING_PARAM },
-{ "poster_time_location", "Export the poster time location.", 
OFFSET(poster_time_location), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS | 
AV_OPT_FLAG_EXPORT },
+{ "export_poster_time_location", "Export the poster time location.", 
OFFSET(export_poster_time_location), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, 
FLAGS | AV_OPT_FLAG_EXPORT },
 { NULL },
 };

--
ffmpeg-codebot
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH v5 2/2] lavc/vaapi_decode: add support for HWACCEL_CAP_RESET_WITHOUT_UNINIT

2022-11-28 Thread Mark Thompson

On 14/11/2022 01:16, Fei Wang wrote:

This can fix vp9 decode image corruption when the frame size is change,
but the pervious frames still be referenced.

Surfaces don't need to be bound to vaContext only after VAAPI 1.0.0:
https://github.com/intel/libva/commit/492b692005ccd0d8da190209d5b3ae7b7825f4b8

Signed-off-by: Fei Wang 
---
  libavcodec/vaapi_decode.c | 11 ---
  libavcodec/vaapi_decode.h |  1 +
  libavcodec/vaapi_vp9.c|  4 
  3 files changed, 13 insertions(+), 3 deletions(-)


This always segfaults immediately on anything unsupported.  E.g. with 
fate/hevc/paramchange_yuv420p_yuv420p10.hevc:

[hevc @ 0x57c0e7c0] Format vaapi chosen by get_format().
[hevc @ 0x57c0e7c0] Format vaapi requires hwaccel initialisation.
[hevc @ 0x57c0e7c0] Hardware does not support image size 1056x8440 
(constraints: width 0-4096 height 0-4096).

Thread 20 "av:hevc:df0" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffb4ff9700 (LWP 509456)]
ff_vaapi_decode_uninit (avctx=0x57c0e7c0) at 
src/libavcodec/vaapi_decode.c:714
714 vas = vaDestroyContext(ctx->hwctx->display, ctx->va_context);
(gdb) bt
#0  ff_vaapi_decode_uninit (avctx=0x57c0e7c0) at 
src/libavcodec/vaapi_decode.c:714
#1  0x563073d7 in ff_vaapi_decode_init (avctx=0x57c0e7c0) at 
src/libavcodec/vaapi_decode.c:704
#2  0x55e62fee in hwaccel_init (avctx=0x57c0e7c0, 
hw_config=0x5728f770 <__compound_literal.0>) at src/libavcodec/decode.c:1121
#3  0x55e634ec in ff_get_format (avctx=0x57c0e7c0, 
fmt=0x7fffb4ff8ccc) at src/libavcodec/decode.c:1261
#4  0x561ca829 in ff_thread_get_format (avctx=0x57c0e7c0, 
fmt=0x7fffb4ff8ccc) at src/libavcodec/pthread_frame.c:1048
#5  0x55f68f37 in get_format (s=0x57c3e6c0, sps=0x57c21f80) at 
src/libavcodec/hevcdec.c:505
#6  0x55f69621 in hls_slice_header (s=0x57c3e6c0) at 
src/libavcodec/hevcdec.c:618
#7  0x55f7472d in decode_nal_unit (s=0x57c3e6c0, 
nal=0x7fff8802e920) at src/libavcodec/hevcdec.c:3173
#8  0x55f7508a in decode_nal_units (s=0x57c3e6c0, buf=0x7637c010 
"", length=159280) at src/libavcodec/hevcdec.c:3355
#9  0x55f756d6 in hevc_decode_frame (avctx=0x57c0e7c0, 
rframe=0x57c0ecc0, got_output=0x57c0d690, avpkt=0x57c0ef40) at 
src/libavcodec/hevcdec.c:3497
#10 0x561c839c in frame_worker_thread (arg=0x57c0d580) at 
src/libavcodec/pthread_frame.c:241
#11 0x768ccea7 in start_thread (arg=) at 
pthread_create.c:477
#12 0x767ecaef in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb)


Also, I don't see how this is testing whether the driver supports changing the 
resolution at runtime?  The note in libva that you cite allows new switching 
render targets in the context, but I don't see why different resolution would 
be allowed given that it's a parameter passed to vaCreateContext()?

Looking at the Mesa driver it appears that the internally-allocated references 
are not going to allow size changes (where does the template width get 
updated?).  I don't have any hardware to test that, though - are you able to 
try this on recent AMD hardware with VP9 support?

What have you done to verify the METHOD_HW_FRAMES_CTX behaviour?  This has 
changed so that vaapi_decode_make_config() is no longer called, which feels 
possibly-bad though I'm unsure of the exact consequences.

As I said last time, I do think you should only do this in exactly the places 
where it is required, and not change any other behaviour.

Thanks,

- Mark


diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index 134f10eca5..d950471b6d 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -658,9 +658,6 @@ int ff_vaapi_decode_init(AVCodecContext *avctx)
  VAStatus vas;
  int err;
  
-ctx->va_config  = VA_INVALID_ID;

-ctx->va_context = VA_INVALID_ID;
-
  err = ff_decode_get_hw_frames_ctx(avctx, AV_HWDEVICE_TYPE_VAAPI);
  if (err < 0)
  goto fail;
@@ -670,6 +667,12 @@ int ff_vaapi_decode_init(AVCodecContext *avctx)
  ctx->device = ctx->frames->device_ctx;
  ctx->hwctx  = ctx->device->hwctx;
  
+if (ctx->inited)

+return 0;
+
+ctx->va_config  = VA_INVALID_ID;
+ctx->va_context = VA_INVALID_ID;
+
  err = vaapi_decode_make_config(avctx, ctx->frames->device_ref,
 &ctx->va_config, NULL);
  if (err)
@@ -691,6 +694,8 @@ int ff_vaapi_decode_init(AVCodecContext *avctx)
  av_log(avctx, AV_LOG_DEBUG, "Decode context initialised: "
 "%#x/%#x.\n", ctx->va_config, ctx->va_context);
  
+ctx->inited = 1;

+
  return 0;
  
  fail:

diff --git a/libavcodec/vaapi_decode.h b/libavcodec/vaapi_decode.h
index 6beda14e52..62a4f37ed9 100644
--- a/libavcodec/vaapi_decode.h
+++ b/libavcodec/vaapi_decode.h
@@ -61,6 +61,7 @@ typedef struct VAAPIDecodeContext {
  int   surface_count

Re: [FFmpeg-devel] [PATCH] avcodec/pnm: avoid mirroring PFM images vertically

2022-11-28 Thread Leo Izen



On 11/22/22 11:46, Leo Izen wrote:

On 11/16/22 06:43, Leo Izen wrote:

PFM (aka Portable FloatMap) encodes its scanlines from bottom-to-top,
not from top-to-bottom, unlike other NetPBM formats. Without this
patch, FFmpeg ignores this exception and decodes/encodes PFM images
mirrored vertically from their proper orientation.

For reference, see the NetPBM tool pfmtopam, which encodes a .pam
from a .pfm, using the correct orientation (and which FFmpeg reads
correctly). Also compare ffplay to magick display, which shows the
correct orientation as well.

See: http://www.pauldebevec.com/Research/HDR/PFM/ and see:
https://netpbm.sourceforge.net/doc/pfm.html for descriptions of this
image format.

Signed-off-by: Leo Izen 



Bumping for review, thanks.

- Leo Izen


Another bump, thanks.

- Leo Izen (thebombzen)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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