Re: [FFmpeg-devel] [PATCH] libavformat/movenc: mov: added subtitle codec tags to codec tag list

2019-03-18 Thread Paweł Wegner
On Wed, Mar 13, 2019 at 12:08 PM Paweł Wegner 
wrote:

> On Mon, Mar 4, 2019 at 10:52 AM Paweł Wegner 
> wrote:
>
>> On Mon, Mar 4, 2019 at 10:50 AM Paweł Wegner 
>> wrote:
>>
>>> ping
>>>
>>> On Mon, Feb 25, 2019 at 11:50 AM Paweł Wegner 
>>> wrote:
>>>
>>>> This fixes avformat_query_codec incorrectly returning 0 for
>>>> mov container and mov_text subtitles.
>>>>
>>>> Signed-off-by: Paweł Wegner 
>>>> ---
>>>>  libavformat/movenc.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>>>> index 77943304b5..8969d5b170 100644
>>>> --- a/libavformat/movenc.c
>>>> +++ b/libavformat/movenc.c
>>>> @@ -6858,7 +6858,7 @@ AVOutputFormat ff_mov_muxer = {
>>>>  .deinit= mov_free,
>>>>  .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH |
>>>> AVFMT_TS_NEGATIVE,
>>>>  .codec_tag = (const AVCodecTag* const []){
>>>> -ff_codec_movvideo_tags, ff_codec_movaudio_tags, 0
>>>> +ff_codec_movvideo_tags, ff_codec_movaudio_tags,
>>>> ff_codec_movsubtitle_tags, 0
>>>>  },
>>>>  .check_bitstream   = mov_check_bitstream,
>>>>  .priv_class= _muxer_class,
>>>> --
>>>> 2.17.1
>>>>
>>>> Sorry for top posted ping.
>>
> ping x2
>
ping x3
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/movenc: mov: added subtitle codec tags to codec tag list

2019-03-13 Thread Paweł Wegner
On Mon, Mar 4, 2019 at 10:52 AM Paweł Wegner 
wrote:

> On Mon, Mar 4, 2019 at 10:50 AM Paweł Wegner 
> wrote:
>
>> ping
>>
>> On Mon, Feb 25, 2019 at 11:50 AM Paweł Wegner 
>> wrote:
>>
>>> This fixes avformat_query_codec incorrectly returning 0 for
>>> mov container and mov_text subtitles.
>>>
>>> Signed-off-by: Paweł Wegner 
>>> ---
>>>  libavformat/movenc.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>>> index 77943304b5..8969d5b170 100644
>>> --- a/libavformat/movenc.c
>>> +++ b/libavformat/movenc.c
>>> @@ -6858,7 +6858,7 @@ AVOutputFormat ff_mov_muxer = {
>>>  .deinit= mov_free,
>>>  .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH |
>>> AVFMT_TS_NEGATIVE,
>>>  .codec_tag = (const AVCodecTag* const []){
>>> -ff_codec_movvideo_tags, ff_codec_movaudio_tags, 0
>>> +ff_codec_movvideo_tags, ff_codec_movaudio_tags,
>>> ff_codec_movsubtitle_tags, 0
>>>  },
>>>  .check_bitstream   = mov_check_bitstream,
>>>  .priv_class= _muxer_class,
>>> --
>>> 2.17.1
>>>
>>> Sorry for top posted ping.
>
ping x2
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/movenc: mov: added subtitle codec tags to codec tag list

2019-03-04 Thread Paweł Wegner
ping

On Mon, Feb 25, 2019 at 11:50 AM Paweł Wegner 
wrote:

> This fixes avformat_query_codec incorrectly returning 0 for
> mov container and mov_text subtitles.
>
> Signed-off-by: Paweł Wegner 
> ---
>  libavformat/movenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 77943304b5..8969d5b170 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -6858,7 +6858,7 @@ AVOutputFormat ff_mov_muxer = {
>  .deinit= mov_free,
>  .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH |
> AVFMT_TS_NEGATIVE,
>  .codec_tag = (const AVCodecTag* const []){
> -ff_codec_movvideo_tags, ff_codec_movaudio_tags, 0
> +ff_codec_movvideo_tags, ff_codec_movaudio_tags,
> ff_codec_movsubtitle_tags, 0
>  },
>  .check_bitstream   = mov_check_bitstream,
>  .priv_class= _muxer_class,
> --
> 2.17.1
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/movenc: mov: added subtitle codec tags to codec tag list

2019-03-04 Thread Paweł Wegner
On Mon, Mar 4, 2019 at 10:50 AM Paweł Wegner 
wrote:

> ping
>
> On Mon, Feb 25, 2019 at 11:50 AM Paweł Wegner 
> wrote:
>
>> This fixes avformat_query_codec incorrectly returning 0 for
>> mov container and mov_text subtitles.
>>
>> Signed-off-by: Paweł Wegner 
>> ---
>>  libavformat/movenc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>> index 77943304b5..8969d5b170 100644
>> --- a/libavformat/movenc.c
>> +++ b/libavformat/movenc.c
>> @@ -6858,7 +6858,7 @@ AVOutputFormat ff_mov_muxer = {
>>  .deinit= mov_free,
>>  .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH |
>> AVFMT_TS_NEGATIVE,
>>  .codec_tag = (const AVCodecTag* const []){
>> -ff_codec_movvideo_tags, ff_codec_movaudio_tags, 0
>> +ff_codec_movvideo_tags, ff_codec_movaudio_tags,
>> ff_codec_movsubtitle_tags, 0
>>  },
>>  .check_bitstream   = mov_check_bitstream,
>>  .priv_class= _muxer_class,
>> --
>> 2.17.1
>>
>> Sorry for top posted ping.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavformat/movenc: mov: added subtitle codec tags to codec tag list

2019-02-25 Thread Paweł Wegner
This fixes avformat_query_codec incorrectly returning 0 for
mov container and mov_text subtitles.

Signed-off-by: Paweł Wegner 
---
 libavformat/movenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 77943304b5..8969d5b170 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6858,7 +6858,7 @@ AVOutputFormat ff_mov_muxer = {
 .deinit= mov_free,
 .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | 
AVFMT_TS_NEGATIVE,
 .codec_tag = (const AVCodecTag* const []){
-ff_codec_movvideo_tags, ff_codec_movaudio_tags, 0
+ff_codec_movvideo_tags, ff_codec_movaudio_tags, 
ff_codec_movsubtitle_tags, 0
 },
 .check_bitstream   = mov_check_bitstream,
 .priv_class= _muxer_class,
-- 
2.17.1

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


Re: [FFmpeg-devel] [PATCH 0/1] Seeking disabled unconditionally in DASH demuxer

2019-02-06 Thread Paweł Wegner
On Tue, Feb 5, 2019 at 12:53 AM Carl Eugen Hoyos  wrote:

> 2019-02-04 21:27 GMT+01:00, Paweł Wegner :
>
> > any reason why this commit:
> >
> https://github.com/FFmpeg/FFmpeg/commit/d54ae9b782c85e626a1e49a8ee204728746227d1#diff-ce2d1d31314e57cff2d1f3eb78988c88R1903
> > disables seeking in dash demuxer? Seeking works fine
> > for my dash manifests when I remove the highlighted line.
>
> Looks like a regression since d54ae9b7 to me.
>
So can you merge this: https://patchwork.ffmpeg.org/patch/11967/ ?

>
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/1] libavformat/dashdec: disable seeking only for live streams.

2019-02-04 Thread Paweł Wegner
Signed-off-by: Paweł Wegner 
---
 libavformat/dashdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index f4f4e935de..89acd5807d 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -2000,8 +2000,6 @@ static int dash_read_header(AVFormatContext *s)
 if ((ret = save_avio_options(s)) < 0)
 goto fail;
 
-av_dict_set(>avio_opts, "seekable", "0", 0);
-
 if ((ret = parse_manifest(s, s->url, s->pb)) < 0)
 goto fail;
 
@@ -2009,6 +2007,8 @@ static int dash_read_header(AVFormatContext *s)
  * stream. */
 if (!c->is_live) {
 s->duration = (int64_t) c->media_presentation_duration * AV_TIME_BASE;
+} else {
+av_dict_set(>avio_opts, "seekable", "0", 0);
 }
 
 if(c->n_videos)
-- 
2.17.1

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


[FFmpeg-devel] [PATCH 0/1] Seeking disabled unconditionally in DASH demuxer

2019-02-04 Thread Paweł Wegner
Hello,

any reason why this commit:
https://github.com/FFmpeg/FFmpeg/commit/d54ae9b782c85e626a1e49a8ee204728746227d1#diff-ce2d1d31314e57cff2d1f3eb78988c88R1903
 
disables seeking in dash demuxer? Seeking works fine for my dash manifests 
when I remove the highlighted line.

--
Paweł Wegner

Paweł Wegner (1):
  libavformat/dashdec: disable seeking only for live streams.

 libavformat/dashdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.17.1

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


Re: [FFmpeg-devel] [PATCH] libavfilter/af_atempo: offset output frames' pts by first_frame_pts / tempo

2019-01-24 Thread Paweł Wegner
On Thu, Jan 24, 2019 at 4:01 PM Gyan  wrote:

>
>
> On 24-01-2019 08:18 PM, Paweł Wegner wrote:
> >
> > This fixes seeking when I have video playback sped up in ffplay like
> this:
> > ffplay -vf "setpts=0.5 * PTS" -af "atempo=2" input
>
> The better way to run this is
>
>  ffplay -vf "setpts=0.5 * (PTS - STARTPTS)" -af "atempo=2" input
>
This works fine, thanks; the patch can be discarded.

>
> Gyan
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavfilter/af_atempo: offset output frames' pts by first_frame_pts / tempo

2019-01-24 Thread Paweł Wegner
On Thu, Jan 24, 2019 at 3:43 PM Pavel Koshevoy  wrote:

> On Thu, Jan 24, 2019 at 5:49 AM Paweł Wegner 
> wrote:
> >
> > Signed-off-by: Paweł Wegner 
> > ---
> >  libavfilter/af_atempo.c | 9 +
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
> > index bfdad7d76b..1245eae8c1 100644
> > --- a/libavfilter/af_atempo.c
> > +++ b/libavfilter/af_atempo.c
> > @@ -147,6 +147,8 @@ typedef struct ATempoContext {
> >  uint8_t *dst_end;
> >  uint64_t nsamples_in;
> >  uint64_t nsamples_out;
> > +
> > +int64_t first_frame_pts;
> >  } ATempoContext;
> >
> >  #define YAE_ATEMPO_MIN 0.5
> > @@ -994,6 +996,7 @@ static av_cold int init(AVFilterContext *ctx)
> >  ATempoContext *atempo = ctx->priv;
> >  atempo->format = AV_SAMPLE_FMT_NONE;
> >  atempo->state  = YAE_LOAD_FRAGMENT;
> > +atempo->first_frame_pts = AV_NOPTS_VALUE;
> >  return 0;
> >  }
> >
> > @@ -1069,6 +1072,7 @@ static int push_samples(ATempoContext *atempo,
> >
> >  // adjust the PTS:
> >  atempo->dst_buffer->pts =
> > +(atempo->first_frame_pts == AV_NOPTS_VALUE ? 0 :
> atempo->first_frame_pts / atempo->tempo) +
> >  av_rescale_q(atempo->nsamples_out,
> >   (AVRational){ 1, outlink->sample_rate },
> >   outlink->time_base);
> > @@ -1108,6 +1112,11 @@ static int filter_frame(AVFilterLink *inlink,
> AVFrame *src_buffer)
> >
> >  atempo->dst = atempo->dst_buffer->data[0];
> >  atempo->dst_end = atempo->dst + n_out * atempo->stride;
> > +
> > +if (atempo->first_frame_pts == AV_NOPTS_VALUE)
> > +atempo->first_frame_pts =
> av_rescale_q(atempo->dst_buffer->pts,
> > +
>  inlink->time_base,
> > +
>  outlink->time_base);
> >  }
> >
> >  yae_apply(atempo, , src_end, >dst, atempo->dst_end);
> > --
> > 2.17.1
> >
>
>
> Probably okay. The reason I didn't do this to begin with is because
> this is an audio stream filter... and how the timeline of the stream
> was transformed up to the 1st frame is unknown.  You are making the
> assumption that it should have been transformed using the same tempo
> parameter as current tempo, but (video) tempo can be varied at runtime
> prior to 1st audio frame, so pts_0' = pts_0 / tempo could be wrong.
>
> Anyway, I don't have a use case where this change would break
> something, so if this fixes something for you then it's fine.

This fixes seeking when I have video playback sped up in ffplay like this:
ffplay -vf "setpts=0.5 * PTS" -af "atempo=2" input

>
> Pavel.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavfilter/af_atempo: offset output frames' pts by first_frame_pts / tempo

2019-01-24 Thread Paweł Wegner
Signed-off-by: Paweł Wegner 
---
 libavfilter/af_atempo.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index bfdad7d76b..1245eae8c1 100644
--- a/libavfilter/af_atempo.c
+++ b/libavfilter/af_atempo.c
@@ -147,6 +147,8 @@ typedef struct ATempoContext {
 uint8_t *dst_end;
 uint64_t nsamples_in;
 uint64_t nsamples_out;
+
+int64_t first_frame_pts;
 } ATempoContext;
 
 #define YAE_ATEMPO_MIN 0.5
@@ -994,6 +996,7 @@ static av_cold int init(AVFilterContext *ctx)
 ATempoContext *atempo = ctx->priv;
 atempo->format = AV_SAMPLE_FMT_NONE;
 atempo->state  = YAE_LOAD_FRAGMENT;
+atempo->first_frame_pts = AV_NOPTS_VALUE;
 return 0;
 }
 
@@ -1069,6 +1072,7 @@ static int push_samples(ATempoContext *atempo,
 
 // adjust the PTS:
 atempo->dst_buffer->pts =
+(atempo->first_frame_pts == AV_NOPTS_VALUE ? 0 : 
atempo->first_frame_pts / atempo->tempo) +
 av_rescale_q(atempo->nsamples_out,
  (AVRational){ 1, outlink->sample_rate },
  outlink->time_base);
@@ -1108,6 +1112,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*src_buffer)
 
 atempo->dst = atempo->dst_buffer->data[0];
 atempo->dst_end = atempo->dst + n_out * atempo->stride;
+
+if (atempo->first_frame_pts == AV_NOPTS_VALUE)
+atempo->first_frame_pts = av_rescale_q(atempo->dst_buffer->pts,
+   inlink->time_base,
+   outlink->time_base);
 }
 
 yae_apply(atempo, , src_end, >dst, atempo->dst_end);
-- 
2.17.1

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


Re: [FFmpeg-devel] [PATCH v3 1/1] avcodec: implemented Media Foundation encoder wrapper

2018-11-14 Thread Paweł Wegner
On Tue, Nov 13, 2018 at 6:52 PM Michael Niedermayer 
wrote:

> On Tue, Nov 13, 2018 at 12:23:42PM +0100, Paweł Wegner wrote:
> > On Tue, Nov 13, 2018 at 11:40 AM Michael Niedermayer
> 
> > wrote:
> >
> > > On Tue, Nov 13, 2018 at 09:50:17AM +0100, Paweł Wegner wrote:
> > > > On Tue, Nov 13, 2018 at 12:39 AM Michael Niedermayer
> > > 
> > > > wrote:
> > > >
> > > > > On Mon, Nov 12, 2018 at 02:42:36PM +0100, Paweł Wegner wrote:
> > > > > > Implemented the following encoders:
> > > > > > * ff_h264_mf_encoder
> > > > > > * ff_hevc_mf_encoder
> > > > > > * ff_aac_mf_encoder
> > > > > > * ff_ac3_mf_encoder
> > > > > > * ff_mp3_mf_encoder
> > > > > >
> > > > > > The code is based on the PLEX's FFmpeg fork which can be found
> here:
> > > > > > https://files.plexapp.com/elan/ffmpeg/plex-ffmpeg-2017-12-17.txz
> > > > > >
> > > > > > Signed-off-by: Paweł Wegner 
> > > > > > ---
> > > > > >  configure  |   11 +
> > > > > >  libavcodec/Makefile|1 +
> > > > > >  libavcodec/allcodecs.c |5 +
> > > > > >  libavcodec/mf_utils.c  |  734 
> > > > > >  libavcodec/mf_utils.h  |  207 +++
> > > > > >  libavcodec/mfenc.c | 1242
> > > 
> > > > > >  6 files changed, 2200 insertions(+)
> > > > > >  create mode 100644 libavcodec/mf_utils.c
> > > > > >  create mode 100644 libavcodec/mf_utils.h
> > > > > >  create mode 100644 libavcodec/mfenc.c
> > > > >
> > > > > breaks build for mingw64
> > > >
> > > >
> > > > > CC  libavcodec/mf_utils.o
> > > > > In file included from
> /usr/share/mingw-w64/include/wmcodecdsp.h:613:0,
> > > > >  from src/libavcodec/mf_utils.h:26,
> > > > >  from src/libavcodec/mf_utils.c:24:
> > > > > /usr/share/mingw-w64/include/strmif.h:15380:2: warning: #warning
> COM
> > > > > interfaces layout in this header has not been verified. [-Wcpp]
> > > > >  #warning COM interfaces layout in this header has not been
> verified.
> > > > >   ^
> > > > > /usr/share/mingw-w64/include/strmif.h:15381:2: warning: #warning
> COM
> > > > > interfaces with incorrect layout may not work at all. [-Wcpp]
> > > > >  #warning COM interfaces with incorrect layout may not work at all.
> > > > >   ^
> > > > > /usr/share/mingw-w64/include/strmif.h:15410:2: warning: #warning
> COM
> > > > > interfaces layout in this header has not been verified. [-Wcpp]
> > > > >  #warning COM interfaces layout in this header has not been
> verified.
> > > > >   ^
> > > > > /usr/share/mingw-w64/include/strmif.h:15411:2: warning: #warning
> COM
> > > > > interfaces with incorrect layout may not work at all. [-Wcpp]
> > > > >  #warning COM interfaces with incorrect layout may not work at all.
> > > > >   ^
> > > > >
> > > > I can silence these warnings by doing #undef __GNU_C__ before the MF
> > > > inclusion; but would that really be better?
> > > > This is where this comes from:
> > > >
> > >
> https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-headers/include/mfplay.h#L59
> > > >
> > > >
> > > > > In file included from
> /usr/share/mingw-w64/include/wmcodecdsp.h:613:0,
> > > > >  from src/libavcodec/mf_utils.h:26,
> > > > >  from src/libavcodec/mf_utils.c:24:
> > > > > /usr/share/mingw-w64/include/strmif.h:15382:9: note: #pragma
> message:
> > > > > Interface IAMAsyncReaderTimestampScaling has unverified layout.
> > > > >  __MINGW_BROKEN_INTERFACE(INTERFACE)
> > > > > ...
> > > > >
> > > > This one comes from mingw as well; and can be worked around the same
> way.
> > >
> > > sorry i have cut the compiler output incorrectly
> > > heres the full output, there are multiple real errors, not just
> warnings:
> > >
> > >
> > >
> > > In file included from /usr/share/mingw-w64/include/wmcodecdsp.h:613:0,
> > > 

Re: [FFmpeg-devel] [PATCH v3 1/1] avcodec: implemented Media Foundation encoder wrapper

2018-11-13 Thread Paweł Wegner
On Tue, Nov 13, 2018 at 11:40 AM Michael Niedermayer 
wrote:

> On Tue, Nov 13, 2018 at 09:50:17AM +0100, Paweł Wegner wrote:
> > On Tue, Nov 13, 2018 at 12:39 AM Michael Niedermayer
> 
> > wrote:
> >
> > > On Mon, Nov 12, 2018 at 02:42:36PM +0100, Paweł Wegner wrote:
> > > > Implemented the following encoders:
> > > > * ff_h264_mf_encoder
> > > > * ff_hevc_mf_encoder
> > > > * ff_aac_mf_encoder
> > > > * ff_ac3_mf_encoder
> > > > * ff_mp3_mf_encoder
> > > >
> > > > The code is based on the PLEX's FFmpeg fork which can be found here:
> > > > https://files.plexapp.com/elan/ffmpeg/plex-ffmpeg-2017-12-17.txz
> > > >
> > > > Signed-off-by: Paweł Wegner 
> > > > ---
> > > >  configure  |   11 +
> > > >  libavcodec/Makefile|1 +
> > > >  libavcodec/allcodecs.c |5 +
> > > >  libavcodec/mf_utils.c  |  734 
> > > >  libavcodec/mf_utils.h  |  207 +++
> > > >  libavcodec/mfenc.c | 1242
> 
> > > >  6 files changed, 2200 insertions(+)
> > > >  create mode 100644 libavcodec/mf_utils.c
> > > >  create mode 100644 libavcodec/mf_utils.h
> > > >  create mode 100644 libavcodec/mfenc.c
> > >
> > > breaks build for mingw64
> >
> >
> > > CC  libavcodec/mf_utils.o
> > > In file included from /usr/share/mingw-w64/include/wmcodecdsp.h:613:0,
> > >  from src/libavcodec/mf_utils.h:26,
> > >  from src/libavcodec/mf_utils.c:24:
> > > /usr/share/mingw-w64/include/strmif.h:15380:2: warning: #warning COM
> > > interfaces layout in this header has not been verified. [-Wcpp]
> > >  #warning COM interfaces layout in this header has not been verified.
> > >   ^
> > > /usr/share/mingw-w64/include/strmif.h:15381:2: warning: #warning COM
> > > interfaces with incorrect layout may not work at all. [-Wcpp]
> > >  #warning COM interfaces with incorrect layout may not work at all.
> > >   ^
> > > /usr/share/mingw-w64/include/strmif.h:15410:2: warning: #warning COM
> > > interfaces layout in this header has not been verified. [-Wcpp]
> > >  #warning COM interfaces layout in this header has not been verified.
> > >   ^
> > > /usr/share/mingw-w64/include/strmif.h:15411:2: warning: #warning COM
> > > interfaces with incorrect layout may not work at all. [-Wcpp]
> > >  #warning COM interfaces with incorrect layout may not work at all.
> > >   ^
> > >
> > I can silence these warnings by doing #undef __GNU_C__ before the MF
> > inclusion; but would that really be better?
> > This is where this comes from:
> >
> https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-headers/include/mfplay.h#L59
> >
> >
> > > In file included from /usr/share/mingw-w64/include/wmcodecdsp.h:613:0,
> > >  from src/libavcodec/mf_utils.h:26,
> > >  from src/libavcodec/mf_utils.c:24:
> > > /usr/share/mingw-w64/include/strmif.h:15382:9: note: #pragma message:
> > > Interface IAMAsyncReaderTimestampScaling has unverified layout.
> > >  __MINGW_BROKEN_INTERFACE(INTERFACE)
> > > ...
> > >
> > This one comes from mingw as well; and can be worked around the same way.
>
> sorry i have cut the compiler output incorrectly
> heres the full output, there are multiple real errors, not just warnings:
>
>
>
> In file included from /usr/share/mingw-w64/include/wmcodecdsp.h:613:0,
>  from src/libavcodec/mf_utils.h:26,
>  from src/libavcodec/mf_utils.c:24:
> /usr/share/mingw-w64/include/strmif.h:15380:2: warning: #warning COM
> interfaces layout in this header has not been verified. [-Wcpp]
>  #warning COM interfaces layout in this header has not been verified.
>   ^
> /usr/share/mingw-w64/include/strmif.h:15381:2: warning: #warning COM
> interfaces with incorrect layout may not work at all. [-Wcpp]
>  #warning COM interfaces with incorrect layout may not work at all.
>   ^
> /usr/share/mingw-w64/include/strmif.h:15410:2: warning: #warning COM
> interfaces layout in this header has not been verified. [-Wcpp]
>  #warning COM interfaces layout in this header has not been verified.
>   ^
> /usr/share/mingw-w64/include/strmif.h:15411:2: warning: #warning COM
> interfaces with incorrect layout may not work at all. [-Wcpp]
>  #warning COM interfaces with incorrect layout may not work at all.
>   ^
&g

Re: [FFmpeg-devel] [PATCH v3 1/1] avcodec: implemented Media Foundation encoder wrapper

2018-11-13 Thread Paweł Wegner
On Tue, Nov 13, 2018 at 12:39 AM Michael Niedermayer 
wrote:

> On Mon, Nov 12, 2018 at 02:42:36PM +0100, Paweł Wegner wrote:
> > Implemented the following encoders:
> > * ff_h264_mf_encoder
> > * ff_hevc_mf_encoder
> > * ff_aac_mf_encoder
> > * ff_ac3_mf_encoder
> > * ff_mp3_mf_encoder
> >
> > The code is based on the PLEX's FFmpeg fork which can be found here:
> > https://files.plexapp.com/elan/ffmpeg/plex-ffmpeg-2017-12-17.txz
> >
> > Signed-off-by: Paweł Wegner 
> > ---
> >  configure  |   11 +
> >  libavcodec/Makefile|1 +
> >  libavcodec/allcodecs.c |5 +
> >  libavcodec/mf_utils.c  |  734 
> >  libavcodec/mf_utils.h  |  207 +++
> >  libavcodec/mfenc.c | 1242 
> >  6 files changed, 2200 insertions(+)
> >  create mode 100644 libavcodec/mf_utils.c
> >  create mode 100644 libavcodec/mf_utils.h
> >  create mode 100644 libavcodec/mfenc.c
>
> breaks build for mingw64


> CC  libavcodec/mf_utils.o
> In file included from /usr/share/mingw-w64/include/wmcodecdsp.h:613:0,
>  from src/libavcodec/mf_utils.h:26,
>  from src/libavcodec/mf_utils.c:24:
> /usr/share/mingw-w64/include/strmif.h:15380:2: warning: #warning COM
> interfaces layout in this header has not been verified. [-Wcpp]
>  #warning COM interfaces layout in this header has not been verified.
>   ^
> /usr/share/mingw-w64/include/strmif.h:15381:2: warning: #warning COM
> interfaces with incorrect layout may not work at all. [-Wcpp]
>  #warning COM interfaces with incorrect layout may not work at all.
>   ^
> /usr/share/mingw-w64/include/strmif.h:15410:2: warning: #warning COM
> interfaces layout in this header has not been verified. [-Wcpp]
>  #warning COM interfaces layout in this header has not been verified.
>   ^
> /usr/share/mingw-w64/include/strmif.h:15411:2: warning: #warning COM
> interfaces with incorrect layout may not work at all. [-Wcpp]
>  #warning COM interfaces with incorrect layout may not work at all.
>   ^
>
I can silence these warnings by doing #undef __GNU_C__ before the MF
inclusion; but would that really be better?
This is where this comes from:
https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-headers/include/mfplay.h#L59


> In file included from /usr/share/mingw-w64/include/wmcodecdsp.h:613:0,
>  from src/libavcodec/mf_utils.h:26,
>  from src/libavcodec/mf_utils.c:24:
> /usr/share/mingw-w64/include/strmif.h:15382:9: note: #pragma message:
> Interface IAMAsyncReaderTimestampScaling has unverified layout.
>  __MINGW_BROKEN_INTERFACE(INTERFACE)
> ...
>
This one comes from mingw as well; and can be worked around the same way.

>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Rewriting code that is poorly written but fully understood is good.
> Rewriting code that one doesnt understand is a sign that one is less smart
> then the original author, trying to rewrite it will not make it better.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 1/1] avcodec: implemented Media Foundation encoder wrapper

2018-11-13 Thread Paweł Wegner
On Mon, Nov 12, 2018 at 4:29 PM Carl Eugen Hoyos  wrote:

> 2018-11-12 14:42 GMT+01:00, Paweł Wegner :
> > Implemented the following encoders:
> > * ff_h264_mf_encoder
> > * ff_hevc_mf_encoder
> > * ff_aac_mf_encoder
> > * ff_ac3_mf_encoder
> > * ff_mp3_mf_encoder

>
> > The code is based on the PLEX's FFmpeg fork which can be found here:
> > https://files.plexapp.com/elan/ffmpeg/plex-ffmpeg-2017-12-17.txz
>
> You don't have to remove this link but if you are not the
> original author of this patch, please add the name(s) of
> the original author to the commit message.
>
I don't really know the name of the original author; the archive doesn't
include git history.
I can only guess that the author is the same as for this one:
https://ffmpeg.org/pipermail/ffmpeg-devel/2017-April/209720.html
So, should I put wm4  into the commit message?


>
> Weren't you already told this?
>
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 1/1] avcodec: implemented Media Foundation encoder wrapper

2018-11-12 Thread Paweł Wegner
Implemented the following encoders:
* ff_h264_mf_encoder
* ff_hevc_mf_encoder
* ff_aac_mf_encoder
* ff_ac3_mf_encoder
* ff_mp3_mf_encoder

The code is based on the PLEX's FFmpeg fork which can be found here:
https://files.plexapp.com/elan/ffmpeg/plex-ffmpeg-2017-12-17.txz

Signed-off-by: Paweł Wegner 
---
 configure  |   11 +
 libavcodec/Makefile|1 +
 libavcodec/allcodecs.c |5 +
 libavcodec/mf_utils.c  |  734 
 libavcodec/mf_utils.h  |  207 +++
 libavcodec/mfenc.c | 1242 
 6 files changed, 2200 insertions(+)
 create mode 100644 libavcodec/mf_utils.c
 create mode 100644 libavcodec/mf_utils.h
 create mode 100644 libavcodec/mfenc.c

diff --git a/configure b/configure
index b02b4ccb2e..f50a621ce2 100755
--- a/configure
+++ b/configure
@@ -301,6 +301,7 @@ External library support:
   --enable-mbedtls enable mbedTLS, needed for https support
if openssl, gnutls or libtls is not used [no]
   --enable-mediacodec  enable Android MediaCodec support [no]
+  --enable-mf  enable decoding via MediaFoundation [auto]
   --enable-libmysofa   enable libmysofa, needed for sofalizer filter [no]
   --enable-openal  enable OpenAL 1.1 capture support [no]
   --enable-opencl  enable OpenCL processing [no]
@@ -1651,6 +1652,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
 libxcb_shape
 libxcb_xfixes
 lzma
+mf
 schannel
 sdl2
 securetransport
@@ -2318,6 +2320,7 @@ CONFIG_EXTRA="
 lpc
 lzf
 me_cmp
+mf
 mpeg_er
 mpegaudio
 mpegaudiodsp
@@ -2806,6 +2809,8 @@ zlib_decoder_deps="zlib"
 zlib_encoder_deps="zlib"
 zmbv_decoder_deps="zlib"
 zmbv_encoder_deps="zlib"
+mf_deps="mftransform_h"
+mf_extralibs="-ldxva2 -levr -lmf -lmfplat -lmfuuid -lole32 -lstrmiids -luuid 
-loleaut32 -lshlwapi"
 
 # hardware accelerators
 crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
@@ -3155,6 +3160,11 @@ vapoursynth_demuxer_deps="vapoursynth"
 videotoolbox_suggest="coreservices"
 videotoolbox_deps="corefoundation coremedia corevideo"
 videotoolbox_encoder_deps="videotoolbox 
VTCompressionSessionPrepareToEncodeFrames"
+aac_mf_encoder_deps="mf"
+ac3_mf_encoder_deps="mf"
+h264_mf_encoder_deps="mf"
+hevc_mf_encoder_deps="mf"
+mp3_mf_encoder_deps="mf"
 
 # demuxers / muxers
 ac3_demuxer_select="ac3_parser"
@@ -5910,6 +5920,7 @@ check_headers io.h
 check_headers linux/perf_event.h
 check_headers libcrystalhd/libcrystalhd_if.h
 check_headers malloc.h
+check_headers mftransform.h
 check_headers net/udplite.h
 check_headers poll.h
 check_headers sys/param.h
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 05be02ec7d..684b4cb213 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1002,6 +1002,7 @@ OBJS-$(CONFIG_LIBXAVS_ENCODER)+= libxavs.o
 OBJS-$(CONFIG_LIBXAVS2_ENCODER)   += libxavs2.o
 OBJS-$(CONFIG_LIBXVID_ENCODER)+= libxvid.o
 OBJS-$(CONFIG_LIBZVBI_TELETEXT_DECODER)   += libzvbi-teletextdec.o ass.o
+OBJS-$(CONFIG_MF) += mfenc.o mf_utils.o
 
 # parsers
 OBJS-$(CONFIG_AAC_LATM_PARSER) += latm_parser.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 2c17db5a70..b6777d6537 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -653,7 +653,9 @@ extern AVCodec ff_xsub_decoder;
 /* external libraries */
 extern AVCodec ff_aac_at_encoder;
 extern AVCodec ff_aac_at_decoder;
+extern AVCodec ff_aac_mf_encoder;
 extern AVCodec ff_ac3_at_decoder;
+extern AVCodec ff_ac3_mf_encoder;
 extern AVCodec ff_adpcm_ima_qt_at_decoder;
 extern AVCodec ff_alac_at_encoder;
 extern AVCodec ff_alac_at_decoder;
@@ -665,6 +667,7 @@ extern AVCodec ff_ilbc_at_decoder;
 extern AVCodec ff_mp1_at_decoder;
 extern AVCodec ff_mp2_at_decoder;
 extern AVCodec ff_mp3_at_decoder;
+extern AVCodec ff_mp3_mf_encoder;
 extern AVCodec ff_pcm_alaw_at_encoder;
 extern AVCodec ff_pcm_alaw_at_decoder;
 extern AVCodec ff_pcm_mulaw_at_encoder;
@@ -738,6 +741,7 @@ extern AVCodec ff_h264_qsv_encoder;
 extern AVCodec ff_h264_v4l2m2m_encoder;
 extern AVCodec ff_h264_vaapi_encoder;
 extern AVCodec ff_h264_videotoolbox_encoder;
+extern AVCodec ff_h264_mf_encoder;
 #if FF_API_NVENC_OLD_NAME
 extern AVCodec ff_nvenc_encoder;
 extern AVCodec ff_nvenc_h264_encoder;
@@ -751,6 +755,7 @@ extern AVCodec ff_hevc_qsv_encoder;
 extern AVCodec ff_hevc_v4l2m2m_encoder;
 extern AVCodec ff_hevc_vaapi_encoder;
 extern AVCodec ff_hevc_videotoolbox_encoder;
+extern AVCodec ff_hevc_mf_encoder;
 extern AVCodec ff_libkvazaar_encoder;
 extern AVCodec ff_mjpeg_cuvid_decoder;
 extern AVCodec ff_mjpeg_qsv_encoder;
diff --git a/libavcodec/mf_utils.c b/libavcodec/mf_utils.c
new file mode 100644
index 00..77c2cbcabf
--- /dev/null
+++ b/l

[FFmpeg-devel] [PATCH v3 0/1] avcodec/mf: implemented Media Foundation wrapper

2018-11-12 Thread Paweł Wegner
I renamed mf.c to mfenc.c and left only the encoders for now.
This lowered the line count of the biggest file to 1242, don't 
know how to split this up more for now.

MF is now autodetected.

The commit message now contains the origin of the code.

HWContext stuff removed.

Paweł Wegner (1):
  avcodec: implemented Media Foundation encoder wrapper

 configure  |   11 +
 libavcodec/Makefile|1 +
 libavcodec/allcodecs.c |5 +
 libavcodec/mf_utils.c  |  734 
 libavcodec/mf_utils.h  |  207 +++
 libavcodec/mfenc.c | 1242 
 6 files changed, 2200 insertions(+)
 create mode 100644 libavcodec/mf_utils.c
 create mode 100644 libavcodec/mf_utils.h
 create mode 100644 libavcodec/mfenc.c

-- 
2.17.1

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


Re: [FFmpeg-devel] [PATCH v2 1/1] avcodec/mf: implemented Media Foundation wrapper

2018-11-06 Thread Paweł Wegner
So should I make it auto-detectable or not? For me it can be either way.

On Mon, Oct 29, 2018 at 10:23 PM Paul B Mahol  wrote:

> On 10/29/18, Carl Eugen Hoyos  wrote:
> > 2018-10-29 10:27 GMT+01:00, Paweł Wegner :
> >
> >> +  --enable-mf  enable decoding via MediaFoundation [no]
> >
> > Should be auto-detected.
>
> Why? I do not want this to be auto-enabled on my Windows builds.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 0/1] avcodec/mf: implemented Media Foundation wrapper

2018-10-29 Thread Paweł Wegner
Thanks for the tip; I took Media Foundation support from PLEX's FFmpeg fork.
The newer patch revision contains hw decoding through Media Foundation.

Paweł Wegner (1):
  avcodec/mf: implemented Media Foundation wrapper

 configure  |   48 +-
 fftools/Makefile   |1 +
 fftools/ffmpeg.h   |2 +
 fftools/ffmpeg_mf.c|  116 ++
 fftools/ffmpeg_opt.c   |3 +
 libavcodec/Makefile|1 +
 libavcodec/allcodecs.c |   28 +
 libavcodec/hwaccels.h  |   12 +
 libavcodec/mf.c| 2160 
 libavcodec/mf_utils.c  |  734 +++
 libavcodec/mf_utils.h  |  207 +++
 libavutil/Makefile |3 +
 libavutil/hwcontext.c  |3 +
 libavutil/hwcontext.h  |1 +
 libavutil/hwcontext_internal.h |1 +
 libavutil/hwcontext_mf.c   |  440 +++
 libavutil/hwcontext_mf.h   |  122 ++
 libavutil/pixdesc.c|4 +
 libavutil/pixfmt.h |2 +
 19 files changed, 3887 insertions(+), 1 deletion(-)
 create mode 100644 fftools/ffmpeg_mf.c
 create mode 100644 libavcodec/mf.c
 create mode 100644 libavcodec/mf_utils.c
 create mode 100644 libavcodec/mf_utils.h
 create mode 100644 libavutil/hwcontext_mf.c
 create mode 100644 libavutil/hwcontext_mf.h

-- 
2.17.1

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


[FFmpeg-devel] [PATCH 0/1] avcodec/mf: implemented Media Foundation wrapper

2018-10-26 Thread Paweł Wegner
Hello,

this patch contains wrappers for encoders and decoders available in Media 
Foundation.
The patch is derived from: 
https://ffmpeg.org/pipermail/ffmpeg-devel/2017-April/209720.html
I fixed MinGW link warnings and made the patch apply to master branch.

As discussed earlier on IRC; this patch makes sense because it provides 
encoders 
similar to MacOS specific ones based on videotoolbox; it also provides 
non-gpl software h264 encoder under Windows.

Best regards,
Paweł Wegner

Paweł Wegner (1):
  avcodec/mf: implemented Media Foundation wrapper

 configure  |   34 +
 libavcodec/Makefile|1 +
 libavcodec/allcodecs.c |   28 +
 libavcodec/mf.c| 1967 
 libavcodec/mf_utils.c  |  696 ++
 libavcodec/mf_utils.h  |  199 
 6 files changed, 2925 insertions(+)
 create mode 100644 libavcodec/mf.c
 create mode 100644 libavcodec/mf_utils.c
 create mode 100644 libavcodec/mf_utils.h

-- 
2.17.1

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


[FFmpeg-devel] [PATCH] avformat/tls_schannel: Fix use of uninitialized variable

2018-08-17 Thread Paweł Wegner
Yes, it will work.

Fixes: runtime error: passing uninitialized value to FreeContextBuffer
causes a crash

Signed-off-by: Paweł Wegner 
---
 libavformat/tls_schannel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
index f41b007773..4f0badcb8d 100644
--- a/libavformat/tls_schannel.c
+++ b/libavformat/tls_schannel.c
@@ -148,7 +148,7 @@ static int tls_client_handshake_loop(URLContext *h, int 
initial)
 TLSContext *c = h->priv_data;
 TLSShared *s = >tls_shared;
 SECURITY_STATUS sspi_ret;
-SecBuffer outbuf[3];
+SecBuffer outbuf[3] = { 0 };
 SecBufferDesc outbuf_desc;
 SecBuffer inbuf[2];
 SecBufferDesc inbuf_desc;
-- 
2.17.1

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


Re: [FFmpeg-devel] [PATCH] avformat/tls_schannel: Fix use of uninitialized variable

2018-08-17 Thread Paweł Wegner
Yes, this works as well. I attached fixed patch.

On Fri, Aug 17, 2018 at 11:15 AM Carl Eugen Hoyos 
wrote:

> 2018-08-03 20:28 GMT+02:00, Paweł Wegner :
>
> > One could copy the initialization to the top from the while loop:
> >   init_sec_buffer([0], SECBUFFER_TOKEN, NULL, 0);
> >   init_sec_buffer([1], SECBUFFER_ALERT, NULL, 0);
> >   init_sec_buffer([2], SECBUFFER_EMPTY, NULL, 0);
> >   init_sec_buffer_desc(_desc, outbuf, 3);
>
> I was thinking about "SecBuffer outbuf = { 0 };
> Does that work?
>
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
From 496254b96fe889f7a4aa89817c384ee55afc81d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Wegner?= 
Date: Thu, 2 Aug 2018 21:08:12 +0200
Subject: [PATCH] avformat/tls_schannel: Fix use of uninitialized variable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes: runtime error: passing uninitialized value to FreeContextBuffer
causes a crash

Signed-off-by: Paweł Wegner 
---
 libavformat/tls_schannel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
index f41b007773..4f0badcb8d 100644
--- a/libavformat/tls_schannel.c
+++ b/libavformat/tls_schannel.c
@@ -148,7 +148,7 @@ static int tls_client_handshake_loop(URLContext *h, int initial)
 TLSContext *c = h->priv_data;
 TLSShared *s = >tls_shared;
 SECURITY_STATUS sspi_ret;
-SecBuffer outbuf[3];
+SecBuffer outbuf[3] = { 0 };
 SecBufferDesc outbuf_desc;
 SecBuffer inbuf[2];
 SecBufferDesc inbuf_desc;
-- 
2.17.1

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


Re: [FFmpeg-devel] [PATCH] avformat/tls_schannel: Fix use of uninitialized variable

2018-08-16 Thread Paweł Wegner

Could someone merge it?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/tls_schannel: Fix use of uninitialized variable

2018-08-03 Thread Paweł Wegner

One could copy the initialization to the top from the while loop:
  init_sec_buffer([0], SECBUFFER_TOKEN, NULL, 0);
  init_sec_buffer([1], SECBUFFER_ALERT, NULL, 0);
  init_sec_buffer([2], SECBUFFER_EMPTY, NULL, 0);
  init_sec_buffer_desc(_desc, outbuf, 3);

But memset is shorter. Current code will crash when there is any failure
before this initialization.

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


Re: [FFmpeg-devel] [PATCH] avformat/tls_schannel: Fix use of uninitialized variable

2018-08-03 Thread Paweł Wegner

One could copy the initialization to the top from the while loop:
  init_sec_buffer([0], SECBUFFER_TOKEN, NULL, 0);
  init_sec_buffer([1], SECBUFFER_ALERT, NULL, 0);
  init_sec_buffer([2], SECBUFFER_EMPTY, NULL, 0);
  init_sec_buffer_desc(_desc, outbuf, 3);

But memset is shorter. Current code will crash when there is any failure
before this initialization.

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


[FFmpeg-devel] [PATCH] avformat/tls_schannel: Fix use of uninitialized variable

2018-08-02 Thread Paweł Wegner
Fixes: runtime error: passing uninitialized value to FreeContextBuffer
causes a crash

Signed-off-by: Paweł Wegner 
---
 libavformat/tls_schannel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
index f41b007773..6b51c1f3dc 100644
--- a/libavformat/tls_schannel.c
+++ b/libavformat/tls_schannel.c
@@ -154,6 +154,8 @@ static int tls_client_handshake_loop(URLContext *h, int 
initial)
 SecBufferDesc inbuf_desc;
 int i, ret = 0, read_data = initial;
 
+memset(outbuf, 0, sizeof(outbuf));
+
 if (c->enc_buf == NULL) {
 c->enc_buf_offset = 0;
 ret = av_reallocp(>enc_buf, SCHANNEL_INITIAL_BUFFER_SIZE);
-- 
2.17.1

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


[FFmpeg-devel] [PATCH] avformat/tls_schannel: Fix use of uninitialized variable

2018-08-02 Thread Paweł Wegner
Fixes: runtime error: passing uninitialized value to FreeContextBuffer
causes a crash
---
 libavformat/tls_schannel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
index 065dccb..6953008 100644
--- a/libavformat/tls_schannel.c
+++ b/libavformat/tls_schannel.c
@@ -154,6 +154,8 @@ static int tls_client_handshake_loop(URLContext *h, int
initial)
 SecBufferDesc inbuf_desc;
 int i, ret = 0, read_data = initial;

+memset(outbuf, 0, sizeof(outbuf));
+
 if (c->enc_buf == NULL) {
 c->enc_buf_offset = 0;
 ret = av_reallocp(>enc_buf, SCHANNEL_INITIAL_BUFFER_SIZE);
--
2.10.1
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel