Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: merge mov_read_custom functions

2016-02-29 Thread Michael Niedermayer
On Sun, Feb 28, 2016 at 11:08:59PM +0100, Marton Balint wrote:
> 
> On Sun, 28 Feb 2016, Michael Niedermayer wrote:
> 
> >On Sat, Feb 20, 2016 at 02:11:49AM +0100, Marton Balint wrote:
> >>This also fixes reading gapless metadata when the entries do not start with 
> >>the
> >>mean atom. Such samples can be found here:
> >>https://hydrogenaud.io/index.php/topic,93310.0.html
> >>
> >>Signed-off-by: Marton Balint 
> >>---
> >> libavformat/mov.c | 50 --
> >> 1 file changed, 12 insertions(+), 38 deletions(-)
> >
> >probably ok
> >
> 
> Thanks, I have applied the series.
> 
> >also a fate test for this might make sense ... tell me if i should
> >upload something to fatesamples for that ...
> 
> If you download the .rar file from the URL above, and put
> 102400samples_qt-lc-aac.m4a into the gapless folder, I can add it to
> the gapless test using the fixed aac decoder.

uploaded

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

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras


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


Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: merge mov_read_custom functions

2016-02-28 Thread Marton Balint


On Sun, 28 Feb 2016, Michael Niedermayer wrote:


On Sat, Feb 20, 2016 at 02:11:49AM +0100, Marton Balint wrote:

This also fixes reading gapless metadata when the entries do not start with the
mean atom. Such samples can be found here:
https://hydrogenaud.io/index.php/topic,93310.0.html

Signed-off-by: Marton Balint 
---
 libavformat/mov.c | 50 --
 1 file changed, 12 insertions(+), 38 deletions(-)


probably ok



Thanks, I have applied the series.


also a fate test for this might make sense ... tell me if i should
upload something to fatesamples for that ...


If you download the .rar file from the URL above, and put 
102400samples_qt-lc-aac.m4a into the gapless folder, I can add it to the 
gapless test using the fixed aac decoder.


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


Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: merge mov_read_custom functions

2016-02-28 Thread Michael Niedermayer
On Sat, Feb 20, 2016 at 02:11:49AM +0100, Marton Balint wrote:
> This also fixes reading gapless metadata when the entries do not start with 
> the
> mean atom. Such samples can be found here:
> https://hydrogenaud.io/index.php/topic,93310.0.html
> 
> Signed-off-by: Marton Balint 
> ---
>  libavformat/mov.c | 50 --
>  1 file changed, 12 insertions(+), 38 deletions(-)

probably ok

also a fate test for this might make sense ... tell me if i should
upload something to fatesamples for that ...

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

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


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


Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: merge mov_read_custom functions

2016-02-28 Thread Marton Balint


On Sat, 20 Feb 2016, Marton Balint wrote:


This also fixes reading gapless metadata when the entries do not start with the
mean atom. Such samples can be found here:
https://hydrogenaud.io/index.php/topic,93310.0.html

Signed-off-by: Marton Balint 
---
libavformat/mov.c | 50 --
1 file changed, 12 insertions(+), 38 deletions(-)


Ping?

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


[FFmpeg-devel] [PATCH 1/2] avformat/mov: merge mov_read_custom functions

2016-02-19 Thread Marton Balint
This also fixes reading gapless metadata when the entries do not start with the
mean atom. Such samples can be found here:
https://hydrogenaud.io/index.php/topic,93310.0.html

Signed-off-by: Marton Balint 
---
 libavformat/mov.c | 50 --
 1 file changed, 12 insertions(+), 38 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1d0077e..7d9a3f3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3172,10 +3172,10 @@ static int mov_read_keys(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 return 0;
 }
 
-static int mov_read_custom_2plus(MOVContext *c, AVIOContext *pb, int64_t size)
+static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
-int64_t end = avio_tell(pb) + size;
-uint8_t *key = NULL, *val = NULL;
+int64_t end = avio_tell(pb) + atom.size;
+uint8_t *key = NULL, *val = NULL, *mean = NULL;
 int i;
 AVStream *st;
 MOVStreamContext *sc;
@@ -3185,7 +3185,7 @@ static int mov_read_custom_2plus(MOVContext *c, 
AVIOContext *pb, int64_t size)
 st = c->fc->streams[c->fc->nb_streams-1];
 sc = st->priv_data;
 
-for (i = 0; i < 2; i++) {
+for (i = 0; i < 3; i++) {
 uint8_t **p;
 uint32_t len, tag;
 int ret;
@@ -3201,7 +3201,9 @@ static int mov_read_custom_2plus(MOVContext *c, 
AVIOContext *pb, int64_t size)
 break;
 len -= 12;
 
-if (tag == MKTAG('n', 'a', 'm', 'e'))
+if (tag == MKTAG('m', 'e', 'a', 'n'))
+p = 
+else if (tag == MKTAG('n', 'a', 'm', 'e'))
 p = 
 else if (tag == MKTAG('d', 'a', 't', 'a') && len > 4) {
 avio_skip(pb, 4);
@@ -3221,7 +3223,7 @@ static int mov_read_custom_2plus(MOVContext *c, 
AVIOContext *pb, int64_t size)
 (*p)[len] = 0;
 }
 
-if (key && val) {
+if (mean && key && val) {
 if (strcmp(key, "iTunSMPB") == 0) {
 int priming, remainder, samples;
 if(sscanf(val, "%*X %X %X %X", , , ) == 
3){
@@ -3234,43 +3236,15 @@ static int mov_read_custom_2plus(MOVContext *c, 
AVIOContext *pb, int64_t size)
 AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
 key = val = NULL;
 }
+} else {
+av_log(c->fc, AV_LOG_VERBOSE,
+   "Unhandled or malformed custom metadata of size %"PRId64"\n", 
atom.size);
 }
 
 avio_seek(pb, end, SEEK_SET);
 av_freep();
 av_freep();
-return 0;
-}
-
-static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-int64_t end = avio_tell(pb) + atom.size;
-uint32_t tag, len;
-
-if (atom.size < 8)
-goto fail;
-
-len = avio_rb32(pb);
-tag = avio_rl32(pb);
-
-if (len > atom.size)
-goto fail;
-
-if (tag == MKTAG('m', 'e', 'a', 'n') && len > 12) {
-uint8_t domain[128];
-int domain_len;
-
-avio_skip(pb, 4); // flags
-len -= 12;
-
-domain_len = avio_get_str(pb, len, domain, sizeof(domain));
-avio_skip(pb, len - domain_len);
-return mov_read_custom_2plus(c, pb, end - avio_tell(pb));
-}
-
-fail:
-av_log(c->fc, AV_LOG_VERBOSE,
-   "Unhandled or malformed custom metadata of size %"PRId64"\n", 
atom.size);
+av_freep();
 return 0;
 }
 
-- 
2.6.2

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