Re: [FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms, so apps can have flexibility to use moov atom not in free atoms as default.

2016-11-02 Thread Zhenni Huang
On Tue, Nov 1, 2016 at 5:45 PM, Carl Eugen Hoyos  wrote:

> 2016-10-31 21:33 GMT+01:00 Zhenni Huang  ffmpeg.org>:
>
> > Thanks Carl, I think setting strict_std_compliance is fine. Could please
> > you apply the change?
>
> Done.
>
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

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


Re: [FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms, so apps can have flexibility to use moov atom not in free atoms as default.

2016-11-01 Thread Carl Eugen Hoyos
2016-10-31 21:33 GMT+01:00 Zhenni Huang :

> Thanks Carl, I think setting strict_std_compliance is fine. Could please
> you apply the change?

Done.

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


Re: [FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms, so apps can have flexibility to use moov atom not in free atoms as default.

2016-10-31 Thread Zhenni Huang
On Mon, Oct 24, 2016 at 4:48 PM, Carl Eugen Hoyos 
wrote:

> 2016-10-25 1:23 GMT+02:00 Zhenni Huang  peg.org>:
>
> > Thanks for your reply. Setting strict_std_compliance to 2 could
> > help in this case. However, as it is a global flag, it could influence
> > other parts in demuxers.
>
> Yes, this is intended: If you don't want to read invalid mov files, it
> seems logical that you don't want to read other invalid files.
>
> Or do you have another use case?
>
> > It is preferable if we can have control of whether to use
> > moov in free with one separate flag.
>
> I disagree.
>
> Please do not top-post here, Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Thanks Carl, I think setting strict_std_compliance is fine. Could please
you apply the change?

Sorry about the top-post, Zhenni
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms, so apps can have flexibility to use moov atom not in free atoms as default.

2016-10-24 Thread Zhenni Huang
Hi Carl,

Thanks for your reply. Setting strict_std_compliance to 2 could help in
this case. However, as it is a global flag, it could influence other parts
in demuxers. It is preferable if we can have control of whether to use moov
in free with one separate flag.

Thanks,
Zhenni

On Mon, Oct 24, 2016 at 2:54 PM, Carl Eugen Hoyos 
wrote:

> 2016-10-24 23:11 GMT+02:00 Zhenni Huang  ffmpeg.org>:
>
> [...]
>
> Does the following inlined patch help you?
>
> Carl Eugen
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 357d800..ed099fc 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -4884,6 +4884,7 @@
>  a.type = avio_rl32(pb);
>  if (a.type == MKTAG('f','r','e','e') &&
>  a.size >= 8 &&
> +c->fc->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT
> &&
>  c->moov_retry) {
>  uint8_t buf[8];
>  uint32_t *type = (uint32_t *)buf + 1;
> ___
> 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] mov: add option to ignore moov atoms which are detected in free atoms, so apps can have flexibility to use moov atom not in free atoms as default.

2016-10-24 Thread Carl Eugen Hoyos
2016-10-24 23:11 GMT+02:00 Zhenni Huang :

[...]

Does the following inlined patch help you?

Carl Eugen

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 357d800..ed099fc 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4884,6 +4884,7 @@
 a.type = avio_rl32(pb);
 if (a.type == MKTAG('f','r','e','e') &&
 a.size >= 8 &&
+c->fc->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT &&
 c->moov_retry) {
 uint8_t buf[8];
 uint32_t *type = (uint32_t *)buf + 1;
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms, so apps can have flexibility to use moov atom not in free atoms as default.

2016-10-24 Thread Zhenni Huang
From: liangsi 

---
 libavformat/isom.h | 1 +
 libavformat/mov.c  | 5 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 2246fed..6824f7e 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -214,6 +214,7 @@ typedef struct MOVContext {
 int use_absolute_path;
 int ignore_editlist;
 int ignore_chapters;
+int ignore_moov_atom_in_free;
 int seek_individually;
 int64_t next_root_atom; ///< offset of the next root atom
 int export_all;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a15c8d1..1d80c09 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4848,7 +4848,8 @@ static int mov_read_default(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 if (atom.size >= 8) {
 a.size = avio_rb32(pb);
 a.type = avio_rl32(pb);
-if (a.type == MKTAG('f','r','e','e') &&
+if (!c->ignore_moov_atom_in_free && 
+a.type == MKTAG('f','r','e','e') &&
 a.size >= 8 &&
 c->moov_retry) {
 uint8_t buf[8];
@@ -5926,6 +5927,8 @@ static const AVOption mov_options[] = {
 0, 1, FLAGS},
 {"ignore_chapters", "", OFFSET(ignore_chapters), AV_OPT_TYPE_BOOL, {.i64 = 
0},
 0, 1, FLAGS},
+{"ignore_moov_atom_in_free", "", OFFSET(ignore_moov_atom_in_free), 
AV_OPT_TYPE_BOOL, 
+{.i64 = 0}, 0, 1, FLAGS},
 {"use_mfra_for",
 "use mfra for fragment timestamps",
 OFFSET(use_mfra_for), AV_OPT_TYPE_INT, {.i64 = FF_MOV_FLAG_MFRA_AUTO},
-- 
2.8.0.rc3.226.g39d4020

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


Re: [FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms.

2016-10-13 Thread Zhenni Huang
Sorry about the second patch I sent.

This option is for flexibility since some apps may not want to use the
hidden atoms.

On Thu, Oct 13, 2016 at 1:44 PM, Robert Krüger 
wrote:

> On Thu, Oct 13, 2016 at 9:54 PM, Dave Rice  wrote:
>
> >
> > > On Oct 13, 2016, at 1:56 PM, Hendrik Leppkes 
> > wrote:
> > >
> > > Am 13.10.2016 19:03 schrieb "liangsi" :
> > >>
> > >> ---
> > >> libavformat/isom.h | 1 +
> > >> libavformat/mov.c  | 5 -
> > >> 2 files changed, 5 insertions(+), 1 deletion(-)
> > >>
> > >
> > > Can you elaborate on the reasons of why someone would want this?
> > Preferably
> > > in the commit message for future consideration.
> >
> > Shouldn't using the moov atom that is not detected within a free atom be
> > the default? Can you elaborate on the reasons of why someone wouldn't
> want
> > this?
> > Dave
> >
> > +1
> ___
> 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] mov: add option to ignore moov atoms which are detected in free atoms.

2016-10-13 Thread Dave Rice

> On Oct 13, 2016, at 1:56 PM, Hendrik Leppkes  wrote:
> 
> Am 13.10.2016 19:03 schrieb "liangsi" :
>> 
>> ---
>> libavformat/isom.h | 1 +
>> libavformat/mov.c  | 5 -
>> 2 files changed, 5 insertions(+), 1 deletion(-)
>> 
> 
> Can you elaborate on the reasons of why someone would want this? Preferably
> in the commit message for future consideration.

Shouldn't using the moov atom that is not detected within a free atom be the 
default? Can you elaborate on the reasons of why someone wouldn't want this?
Dave
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms.

2016-10-13 Thread liangsi
---
 libavformat/isom.h | 1 +
 libavformat/mov.c  | 5 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 2246fed..6824f7e 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -214,6 +214,7 @@ typedef struct MOVContext {
 int use_absolute_path;
 int ignore_editlist;
 int ignore_chapters;
+int ignore_moov_atom_in_free;
 int seek_individually;
 int64_t next_root_atom; ///< offset of the next root atom
 int export_all;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a15c8d1..1d80c09 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4848,7 +4848,8 @@ static int mov_read_default(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 if (atom.size >= 8) {
 a.size = avio_rb32(pb);
 a.type = avio_rl32(pb);
-if (a.type == MKTAG('f','r','e','e') &&
+if (!c->ignore_moov_atom_in_free && 
+a.type == MKTAG('f','r','e','e') &&
 a.size >= 8 &&
 c->moov_retry) {
 uint8_t buf[8];
@@ -5926,6 +5927,8 @@ static const AVOption mov_options[] = {
 0, 1, FLAGS},
 {"ignore_chapters", "", OFFSET(ignore_chapters), AV_OPT_TYPE_BOOL, {.i64 = 
0},
 0, 1, FLAGS},
+{"ignore_moov_atom_in_free", "", OFFSET(ignore_moov_atom_in_free), 
AV_OPT_TYPE_BOOL, 
+{.i64 = 0}, 0, 1, FLAGS},
 {"use_mfra_for",
 "use mfra for fragment timestamps",
 OFFSET(use_mfra_for), AV_OPT_TYPE_INT, {.i64 = FF_MOV_FLAG_MFRA_AUTO},
-- 
2.8.0.rc3.226.g39d4020

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


Re: [FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms.

2016-10-13 Thread Hendrik Leppkes
Am 13.10.2016 19:03 schrieb "liangsi" :
>
> ---
>  libavformat/isom.h | 1 +
>  libavformat/mov.c  | 5 -
>  2 files changed, 5 insertions(+), 1 deletion(-)
>

Can you elaborate on the reasons of why someone would want this? Preferably
in the commit message for future consideration.

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


[FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms.

2016-10-13 Thread liangsi
---
 libavformat/isom.h | 1 +
 libavformat/mov.c  | 5 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 2246fed..6824f7e 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -214,6 +214,7 @@ typedef struct MOVContext {
 int use_absolute_path;
 int ignore_editlist;
 int ignore_chapters;
+int ignore_moov_atom_in_free;
 int seek_individually;
 int64_t next_root_atom; ///< offset of the next root atom
 int export_all;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a15c8d1..1d80c09 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4848,7 +4848,8 @@ static int mov_read_default(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 if (atom.size >= 8) {
 a.size = avio_rb32(pb);
 a.type = avio_rl32(pb);
-if (a.type == MKTAG('f','r','e','e') &&
+if (!c->ignore_moov_atom_in_free && 
+a.type == MKTAG('f','r','e','e') &&
 a.size >= 8 &&
 c->moov_retry) {
 uint8_t buf[8];
@@ -5926,6 +5927,8 @@ static const AVOption mov_options[] = {
 0, 1, FLAGS},
 {"ignore_chapters", "", OFFSET(ignore_chapters), AV_OPT_TYPE_BOOL, {.i64 = 
0},
 0, 1, FLAGS},
+{"ignore_moov_atom_in_free", "", OFFSET(ignore_moov_atom_in_free), 
AV_OPT_TYPE_BOOL, 
+{.i64 = 0}, 0, 1, FLAGS},
 {"use_mfra_for",
 "use mfra for fragment timestamps",
 OFFSET(use_mfra_for), AV_OPT_TYPE_INT, {.i64 = FF_MOV_FLAG_MFRA_AUTO},
-- 
2.8.0.rc3.226.g39d4020

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