Re: [FFmpeg-devel] PATCH: Make -copyts a tri-state

2014-10-21 Thread Rodger Combs

 On Oct 20, 2014, at 20:42, Michael Niedermayer michae...@gmx.at wrote:
 
 On Mon, Oct 20, 2014 at 06:50:12PM -0500, Rodger Combs wrote:
 
 On Oct 17, 2014, at 03:19, Rodger Combs rodger.co...@gmail.com wrote:
 
 
 On Oct 15, 2014, at 06:00, Rodger Combs rodger.co...@gmail.com 
 mailto:rodger.co...@gmail.com wrote:
 
 
 On Oct 15, 2014, at 05:37, Nicolas George geo...@nsup.org wrote:
 
 Le quartidi 24 vendémiaire, an CCXXIII, Rodger Combs a écrit :
 Discussed this briefly on IRC; decided this was a good idea. I'm not sure
 if the commit message explains it well enough; please poke me here or on
 IRC if it doesn't.
 
 From 617b532c8a403c1cf06e60c99e9f36c787553b43 Mon Sep 17 00:00:00 2001
 From: Rodger Combs rodger.co...@gmail.com
 Date: Wed, 15 Oct 2014 05:00:02 -0500
 Subject: [PATCH] Make copyts a tri-state, with `no` normalizing input
 timestamps.
 
 This doesn't change the default or `-copyts` behavior, but allows
 `-nocopyts` to make e.g. `-ss 50` have timestamps starting at 50 seconds,
 even if the input file's timestamps start at a value other than zero.
 ---
 ffmpeg.c | 6 +++---
 ffmpeg_opt.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
 
 It looks like you forgot to update the documentation too.
 
 Regards,
 
 -- 
 Nicolas George
 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 
 Indeed I did. Here you go:
 0001-Make-copyts-a-tri-state-with-no-normalizing-input-ti.patch
 
 It occurs to me that it might be more useful in some cases to have one 
 master input file (the first one?) be shifted so its timestamps start at 
 zero, and the rest be shifted by the same amount as the master. That might 
 be a good argument for making this its own option, instead of making 
 copyts a tri-state.
 
 I'm not particularly attached to the naming or implementation here, so 
 suggestions are plenty welcome :)
 
 
 Upon some further testing, this seems to create some unusual and undesired 
 behavior in some cases, and I'm not sure exactly why. The patch is 
 definitely not ready, but I'd appreciate it if anyone could help work out a 
 better design for the feature.
 
 My previous patch was awkward and had some unintended side-effects; this 
 version just adds a separate option instead of hacking -copyts.
 
 From 88eb820b701c7eea11d60dd75faa2cefe57bbfe0 Mon Sep 17 00:00:00 2001
 From: Rodger Combs rodger.co...@gmail.com
 Date: Mon, 20 Oct 2014 18:31:18 -0500
 Subject: [PATCH] Add -start_at_zero option.
 
 This automatically shifts input timestamps to start at 0 instead of the 
 file's
 starting timestamp when using -copyts.
 
 applied
 
 please add some documentation for this
 
 thanks
 
 -- 
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
 
 Awnsering whenever a program halts or runs forever is
 On a turing machine, in general impossible (turings halting problem).
 On any real computer, always possible as a real computer has a finite number
 of states N, and will either halt in less than N cycles or never halt.
 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Documentation patch:

From 4fa599b322e5b5c172854eaf32de1ef25e9ec7f5 Mon Sep 17 00:00:00 2001
From: Rodger Combs rodger.co...@gmail.com
Date: Tue, 21 Oct 2014 01:22:16 -0500
Subject: [PATCH] doc/ffmpeg.texi: document the new -start_at_zero option

---
 doc/ffmpeg.texi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 4fc7682..38dca86 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -1016,6 +1016,12 @@ processing (e.g. in case the format option 
@option{avoid_negative_ts}
 is enabled) the output timestamps may mismatch with the input
 timestamps even when this option is selected.
 
+@item -start_at_zero
+When used with @option{copyts}, shift input timestamps so they start at zero.
+
+This means that using e.g. @code{-ss 50} will make output timestamps start at
+50 seconds, regardless of what timestamp the input file started at.
+
 @item -copytb @var{mode}
 Specify how to set the encoder timebase when stream copying.  @var{mode} is an
 integer numeric value, and can assume one of the following values:
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] matroskadec: execute seekheads recursively

2014-10-21 Thread Rodger Combs

 On Oct 19, 2014, at 23:34, Rodger Combs rodger.co...@gmail.com wrote:
 
 
 On Oct 17, 2014, at 17:40, Michael Niedermayer michae...@gmx.at 
 mailto:michae...@gmx.at wrote:
 
 On Fri, Oct 17, 2014 at 03:27:49PM +0200, Michael Niedermayer wrote:
 On Fri, Oct 17, 2014 at 01:55:35AM -0500, Rodger Combs wrote:
 
 On Oct 17, 2014, at 01:52, Rodger Combs rodger.co...@gmail.com 
 mailto:rodger.co...@gmail.com wrote:
 
 
 On Oct 17, 2014, at 01:16, Rodger Combs rodger.co...@gmail.com 
 mailto:rodger.co...@gmail.com mailto:rodger.co...@gmail.com 
 mailto:rodger.co...@gmail.com wrote:
 
 This fixes https://trac.ffmpeg.org/ticket/3934 
 https://trac.ffmpeg.org/ticket/3934 
 https://trac.ffmpeg.org/ticket/3934 
 https://trac.ffmpeg.org/ticket/3934, but I'm not sure if there was a 
 good reason for this to be here to begin with. Perhaps a protection 
 against infinite recursion (though I believe EBML_MAX_DEPTH serves that 
 purpose to some degree)?
 0001-matroskadec-execute-seekheads-recursively.patch
 
 Evidently either I or my mail client screwed up and the patch didn't get 
 attached. Whoops.
 0001-matroskadec-execute-seekheads-recursively.patch
 Let's try that again...
 
 Welp, apparently my email client's borked badly in some way. Here's a gist 
 link instead: https://gist.github.com/08f111e72b8b5ddba078 
 https://gist.github.com/08f111e72b8b5ddba078
 
 copy and pasted so our archives dont depend on external links as well
 as for easy revieweing
 
 From 4cf14a9d117da69b64c267e6f982931cfa60a300 Mon Sep 17 00:00:00 2001
 From: Rodger Combs rodger.co...@gmail.com mailto:rodger.co...@gmail.com
 Date: Fri, 17 Oct 2014 00:35:12 -0500
 Subject: [PATCH] matroskadec: execute seekheads recursively
 
 Fixes https://trac.ffmpeg.org/ticket/3934 
 https://trac.ffmpeg.org/ticket/3934
 ---
 libavformat/matroskadec.c | 1 -
 1 file changed, 1 deletion(-)
 
 diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
 index b742319..b437e74 100644
 --- a/libavformat/matroskadec.c
 +++ b/libavformat/matroskadec.c
 @@ -1368,7 +1368,6 @@ static int 
 matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska,
 int ret = 0;
 
 if (idx = seekhead_list-nb_elem||
 -seekhead[idx].id == MATROSKA_ID_SEEKHEAD ||
 seekhead[idx].id == MATROSKA_ID_CLUSTER)
 return 0;
 
 ebml_parse() that gets called as a result of this change does not
 succeed and causes the one and only seekhead entry to return failure
 so i think this doesnt execute seekheads recursively
 
 [...]
 
 -- 
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
 
 It is dangerous to be right in matters on which the established authorities
 are wrong. -- Voltaire
 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org mailto:ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel 
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 Just stepped through this; I also see ebml_parse() failing with the clip I 
 originally uploaded, but not with the original source file, which I've 
 uploaded to Dropbox: 
 https://www.dropbox.com/s/32ve4hp567ukikt/Maken-Ki%21%20-%20S01E02.mkv?dl=0 
 https://www.dropbox.com/s/32ve4hp567ukikt/Maken-Ki%21%20-%20S01E02.mkv?dl=0
 
 

On IRC, the consensus seems to be:
1. This works as expected
2. We're not sure if it could lead to an infinite loop if a SeekHead pointed at 
itself, or at another SeekHead pointing to it; could someone with more 
experience with matroskadec.c confirm?
3. matroska_read_seek currently returns 0 and fails to seek if the file has no 
Cues; it should return -1 and let libavformat fallback on legacy behavior (as 
it does if it encounters an invalid SeekHead or Cues). This is fixed by this 
patch:

From acd730174bbbc2f95be1e697ed4fb6bf33c30f05 Mon Sep 17 00:00:00 2001
From: Rodger Combs rodger.co...@gmail.com
Date: Tue, 21 Oct 2014 01:33:08 -0500
Subject: [PATCH] matroskadec: fail matroska_read_seek if no index was parsed

---
 libavformat/matroskadec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index b742319..a50e9ea 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2917,7 +2917,7 @@ static int matroska_read_seek(AVFormatContext *s, int 
stream_index,
 matroska_parse_cues(matroska);
 }
 
-if (!st-nb_index_entries)
+if (!st-nb_index_entries || !matroska-index.nb_elem)
 goto err;
 timestamp = FFMAX(timestamp, st-index_entries[0].timestamp);
 
-- 
1.9.1


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


[FFmpeg-devel] [PATCH] lavd/v4l2: don't use avpriv_ prefix for internal functions

2014-10-21 Thread James Almer
No need to keep the old symbols around until a major bump since lavd functions 
with the avpriv_ prefix were never exposed.

Signed-off-by: James Almer jamr...@gmail.com
---
avpriv_*; can be added to libavdevice.v after this patch, but personally I'd 
say 
to wait until it's needed rather than adding it right now.

 libavdevice/v4l2-common.c | 30 +++---
 libavdevice/v4l2-common.h |  8 
 libavdevice/v4l2.c| 20 ++--
 libavdevice/v4l2enc.c |  2 +-
 4 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/libavdevice/v4l2-common.c b/libavdevice/v4l2-common.c
index c4c75d7..966b9a1 100644
--- a/libavdevice/v4l2-common.c
+++ b/libavdevice/v4l2-common.c
@@ -18,7 +18,7 @@
 
 #include v4l2-common.h
 
-const struct fmt_map avpriv_fmt_conversion_table[] = {
+const struct fmt_map ff_fmt_conversion_table[] = {
 //ff_fmt  codec_id  v4l2_fmt
 { AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420  },
 { AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU420  },
@@ -58,43 +58,43 @@ const struct fmt_map avpriv_fmt_conversion_table[] = {
 { AV_PIX_FMT_NONE,AV_CODEC_ID_NONE, 0},
 };
 
-uint32_t avpriv_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id)
+uint32_t ff_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id)
 {
 int i;
 
-for (i = 0; avpriv_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; 
i++) {
+for (i = 0; ff_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
 if ((codec_id == AV_CODEC_ID_NONE ||
- avpriv_fmt_conversion_table[i].codec_id == codec_id) 
+ ff_fmt_conversion_table[i].codec_id == codec_id) 
 (pix_fmt == AV_PIX_FMT_NONE ||
- avpriv_fmt_conversion_table[i].ff_fmt == pix_fmt)) {
-return avpriv_fmt_conversion_table[i].v4l2_fmt;
+ ff_fmt_conversion_table[i].ff_fmt == pix_fmt)) {
+return ff_fmt_conversion_table[i].v4l2_fmt;
 }
 }
 
 return 0;
 }
 
-enum AVPixelFormat avpriv_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID 
codec_id)
+enum AVPixelFormat ff_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id)
 {
 int i;
 
-for (i = 0; avpriv_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; 
i++) {
-if (avpriv_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt 
-avpriv_fmt_conversion_table[i].codec_id == codec_id) {
-return avpriv_fmt_conversion_table[i].ff_fmt;
+for (i = 0; ff_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
+if (ff_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt 
+ff_fmt_conversion_table[i].codec_id == codec_id) {
+return ff_fmt_conversion_table[i].ff_fmt;
 }
 }
 
 return AV_PIX_FMT_NONE;
 }
 
-enum AVCodecID avpriv_fmt_v4l2codec(uint32_t v4l2_fmt)
+enum AVCodecID ff_fmt_v4l2codec(uint32_t v4l2_fmt)
 {
 int i;
 
-for (i = 0; avpriv_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; 
i++) {
-if (avpriv_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt) {
-return avpriv_fmt_conversion_table[i].codec_id;
+for (i = 0; ff_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
+if (ff_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt) {
+return ff_fmt_conversion_table[i].codec_id;
 }
 }
 
diff --git a/libavdevice/v4l2-common.h b/libavdevice/v4l2-common.h
index 8aef234..40c7164 100644
--- a/libavdevice/v4l2-common.h
+++ b/libavdevice/v4l2-common.h
@@ -53,10 +53,10 @@ struct fmt_map {
 uint32_t v4l2_fmt;
 };
 
-extern av_export const struct fmt_map avpriv_fmt_conversion_table[];
+extern const struct fmt_map ff_fmt_conversion_table[];
 
-uint32_t avpriv_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID 
codec_id);
-enum AVPixelFormat avpriv_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID 
codec_id);
-enum AVCodecID avpriv_fmt_v4l2codec(uint32_t v4l2_fmt);
+uint32_t ff_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id);
+enum AVPixelFormat ff_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id);
+enum AVCodecID ff_fmt_v4l2codec(uint32_t v4l2_fmt);
 
 #endif /* AVDEVICE_V4L2_COMMON_H */
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index cf7a92c..e2994d8 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -270,8 +270,8 @@ static void list_formats(AVFormatContext *ctx, int type)
 struct v4l2_fmtdesc vfd = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE };
 
 while(!v4l2_ioctl(s-fd, VIDIOC_ENUM_FMT, vfd)) {
-enum AVCodecID codec_id = avpriv_fmt_v4l2codec(vfd.pixelformat);
-enum AVPixelFormat pix_fmt = avpriv_fmt_v4l2ff(vfd.pixelformat, 
codec_id);
+enum AVCodecID codec_id = ff_fmt_v4l2codec(vfd.pixelformat);
+enum AVPixelFormat pix_fmt = ff_fmt_v4l2ff(vfd.pixelformat, codec_id);
 
 vfd.index++;
 
@@ -763,7 +763,7 @@ static int device_try_init(AVFormatContext *ctx,
 {
   

Re: [FFmpeg-devel] Help with writing an RMS-LMS decoder

2014-10-21 Thread Thilo Borgmann
Hi,

 I was of the impression that even though the time for submitting patches is
 running out, any propective OPW applicant could still continue working on
 her tasks even after the application period is over right up to the
 selections are announced for the OPW?

I think this is correct.

And of course, any contributions within the OPW or not are very welcome!

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


Re: [FFmpeg-devel] Help with writing an RMS-LMS decoder

2014-10-21 Thread Thilo Borgmann
Am 20.10.14 um 13:30 schrieb Ngassa Finjap:
 Thilo, Please can we have an IRC chat about this. I can still implement the
 RLS-LMS decoder

I'm usually not in IRC - I cannot stay there during my every day job and I can't
plan my free time as much as I want to.

So mail is my preferred channel of communication.

As already mentioned, you're welcome to work on the decoder aka your
qualification task. And I think the deadline tomorrow does not hurt if you've
met the OPW requirements already - which would be to the best of my knowledge to
have submitted a formal application to OPW.

 On Mon, Oct 20, 2014 at 7:25 AM, Thilo Borgmann thilo.borgm...@mail.de
 wrote:
 
 Am 20.10.14 13:00, schrieb Michael Niedermayer:
 On Mon, Oct 20, 2014 at 06:32:59AM -0400, Ngassa Finjap wrote:
 Hi,

 On Mon, Oct 20, 2014 at 6:20 AM, Michael Niedermayer michae...@gmx.at
 wrote:


 I see this has somewhat been awnsered on IRC
 maybe thilo can elabrate on this, though I do not think its possible
 to write such decoder in the remaining time before Wednesday unless
 one knows what to do already and is quick.


 I did a git grep and found ffmpeg/libavcodec/alsdec.c. I am trying to
 see
 this ALS decoder is different from the RLS-LMS decoder.

 if you dont know the difference between LPC and RLS-LMS
 maybe ftp://cs.uef.fi/franti/papers/RLS-LMS_TIP2008.pdf
 could help. But note iam no ALS expert, thilo knows all this better

 I don't think it matters anymore since you will most likely not be able to
 finish work on that.

 -Thilo


 ___
 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 mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavf/mov.c: Prevent memory leak in case of invalid metadata reads.

2014-10-21 Thread Thilo Borgmann
Hi,

the last commit to lavf/mov.c might leave the metadata buffer allocated in
certain error conditions. This patch fixes it.

-Thilo
From a2fabe107796cf0af5cd18310fad178c5650b168 Mon Sep 17 00:00:00 2001
From: Thilo Borgmann thilo.borgm...@mail.de
Date: Tue, 21 Oct 2014 10:10:55 +0200
Subject: [PATCH] lavf/mov.c: Prevent memory leak in case of invalid metadata
 reads.

---
 libavformat/mov.c | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index a7ec910..80549ec 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -355,16 +355,16 @@ static int mov_read_udta_string(MOVContext *c, 
AVIOContext *pb, MOVAtom atom)
 }
 #endif
 
-str_size_alloc = str_size  1; // worst-case requirement for output 
string in case of utf8 coded input
-str = av_malloc(str_size_alloc);
-if (!str)
-return AVERROR(ENOMEM);
-
 if (!key)
 return 0;
 if (atom.size  0)
 return AVERROR_INVALIDDATA;
 
+str_size_alloc = str_size  1; // worst-case requirement for output 
string in case of utf8 coded input
+str = av_malloc(str_size_alloc);
+if (!str)
+return AVERROR(ENOMEM);
+
 if (parse)
 parse(c, pb, str_size, key);
 else {
@@ -372,8 +372,10 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 mov_read_mac_string(c, pb, str_size, str, str_size_alloc);
 } else {
 int ret = avio_read(pb, str, str_size);
-if (ret != str_size)
+if (ret != str_size) {
+av_freep(str);
 return ret  0 ? ret : AVERROR_INVALIDDATA;
+}
 str[str_size] = 0;
 }
 c-fc-event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED;
-- 
1.9.3 (Apple Git-50)

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


[FFmpeg-devel] [PATCH] lavfi/afade: fix cur_sample computation

2014-10-21 Thread Stefano Sabatini
Use the correct timebase conversion.
---
 libavfilter/af_afade.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
index fbf9802..35b2a84 100644
--- a/libavfilter/af_afade.c
+++ b/libavfilter/af_afade.c
@@ -221,6 +221,8 @@ static int config_input(AVFilterLink *inlink)
 if (s-start_time)
 s-start_sample = av_rescale(s-start_time, inlink-sample_rate, 
AV_TIME_BASE);
 
+av_log(s, AV_LOG_DEBUG, nb_samples=%d start_sample=%d type=%d\n, 
s-nb_samples, s-start_sample, s-type);
+
 return 0;
 }
 
@@ -230,7 +232,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
 AVFilterLink *outlink   = inlink-dst-outputs[0];
 int nb_samples  = buf-nb_samples;
 AVFrame *out_buf;
-int64_t cur_sample = av_rescale_q(buf-pts, (AVRational){1, 
outlink-sample_rate}, outlink-time_base);
+int64_t cur_sample = av_rescale_q(buf-pts, inlink-time_base, 
(AVRational){1, inlink-sample_rate});
 
 if ((!s-type  (s-start_sample + s-nb_samples  cur_sample)) ||
 ( s-type  (cur_sample + s-nb_samples  s-start_sample)))
-- 
1.8.3.2

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


[FFmpeg-devel] [PATCH] lavfi/concat: accept a single segment

2014-10-21 Thread Stefano Sabatini
Simplify scripting operations, so that n=1 is not to be considered as a
special case.
---
 libavfilter/avf_concat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/avf_concat.c b/libavfilter/avf_concat.c
index 18f373c..fa9e6b9 100644
--- a/libavfilter/avf_concat.c
+++ b/libavfilter/avf_concat.c
@@ -59,7 +59,7 @@ typedef struct {
 
 static const AVOption concat_options[] = {
 { n, specify the number of segments, OFFSET(nb_segments),
-  AV_OPT_TYPE_INT, { .i64 = 2 }, 2, INT_MAX, V|A|F},
+  AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, V|A|F},
 { v, specify the number of video streams,
   OFFSET(nb_streams[AVMEDIA_TYPE_VIDEO]),
   AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, V|F },
-- 
1.8.3.2

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


Re: [FFmpeg-devel] [PATCH] configure: add build tree's directories to rpath

2014-10-21 Thread Derek Buitenhuis
On 10/21/2014 8:21 AM, Carl Eugen Hoyos wrote:
 This sounds like a very bad idea to me

I agree. It's not nice to have remnants of the build process in the
installed binaries.

If you need to run them during development, use LD_LIBRARY_PATH or
or build statically.

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


Re: [FFmpeg-devel] [PATCH] lavfi/afade: fix cur_sample computation

2014-10-21 Thread Derek Buitenhuis
On 10/21/2014 10:47 AM, Stefano Sabatini wrote:
 -int64_t cur_sample = av_rescale_q(buf-pts, (AVRational){1, 
 outlink-sample_rate}, outlink-time_base);
 +int64_t cur_sample = av_rescale_q(buf-pts, inlink-time_base, 
 (AVRational){1, inlink-sample_rate});

Probably OK.

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


Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Prevent memory leak in case of invalid metadata reads.

2014-10-21 Thread Derek Buitenhuis
On 10/21/2014 9:12 AM, Thilo Borgmann wrote:
 Subject: [PATCH] lavf/mov.c: Prevent memory leak in case of invalid metadata
  reads.
 
 ---
  libavformat/mov.c | 14 --
  1 file changed, 8 insertions(+), 6 deletions(-)

LGTM.

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


Re: [FFmpeg-devel] [PATCH]Mention in the documentation that fieldmatch needs cfr input

2014-10-21 Thread Derek Buitenhuis
On 10/21/2014 8:32 AM, Carl Eugen Hoyos wrote:
 +The filter only works for strictly constant frame rate input. If your input
 +has variable frame rate, try the @ref{pullup} filter.

Perhaps the filter should output a warning as well?

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


Re: [FFmpeg-devel] [PATCH] lavd/v4l2: don't use avpriv_ prefix for internal functions

2014-10-21 Thread Derek Buitenhuis
On 10/21/2014 7:56 AM, James Almer wrote:
 No need to keep the old symbols around until a major bump since lavd 
 functions 
 with the avpriv_ prefix were never exposed.

lol.

 Signed-off-by: James Almer jamr...@gmail.com
 ---
 avpriv_*; can be added to libavdevice.v after this patch, but personally 
 I'd say 
 to wait until it's needed rather than adding it right now.
 
  libavdevice/v4l2-common.c | 30 +++---
  libavdevice/v4l2-common.h |  8 
  libavdevice/v4l2.c| 20 ++--
  libavdevice/v4l2enc.c |  2 +-
  4 files changed, 30 insertions(+), 30 deletions(-)

+1 from me.

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


Re: [FFmpeg-devel] [PATCH 1/4] ffserver: move configuration code to separate file

2014-10-21 Thread Stefano Sabatini
On date Monday 2014-10-20 23:56:59 +0200, Lukasz Marek encoded:
 This commit doesn't change any existing logic.
 It moves ffserver configuration related code to separate file.
 It intends to make maintaining easier.

I'm not opposed, but please tell why you think it's better this way. I
still hate the ffmpeg.c/ffmpeg_opt.c split, since it makes debugging
and browsing the code much harder for me, also it increases the
complexity since you have to declare otherwise static functions.

 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
  Makefile  |1 +
  ffserver.c| 1214 
 +
  ffserver_config.c |  986 +++
  ffserver_config.h |  118 ++
  4 files changed, 1201 insertions(+), 1118 deletions(-)
  create mode 100644 ffserver_config.c
  create mode 100644 ffserver_config.h
-- 
FFmpeg = Furious Fascinating Multimedia Ponderous Enhancing Gigant
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi/concat: accept a single segment

2014-10-21 Thread Derek Buitenhuis
On 10/21/2014 10:47 AM, Stefano Sabatini wrote:
 -  AV_OPT_TYPE_INT, { .i64 = 2 }, 2, INT_MAX, V|A|F},
 +  AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, V|A|F},

I'm not sure I follow how this 'allows' n=1? Doesn't this just
change the default?

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


Re: [FFmpeg-devel] [PATCH 2/4] ffserver_config: clean up variable initialization

2014-10-21 Thread Stefano Sabatini
On date Monday 2014-10-20 23:57:00 +0200, Lukasz Marek encoded:
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
  ffserver_config.c | 16 +---
  1 file changed, 5 insertions(+), 11 deletions(-)
 
 diff --git a/ffserver_config.c b/ffserver_config.c
 index 927b6fe..351c4e9 100644
 --- a/ffserver_config.c
 +++ b/ffserver_config.c
 @@ -341,11 +341,11 @@ int ffserver_parse_ffconfig(const char *filename, 
 FFServerConfig *config)
  char cmd[64];
  char arg[1024], arg2[1024];
  const char *p;
 -int val, errors, warnings, line_num;
 -FFServerStream **last_stream, *stream, *redirect;
 -FFServerStream **last_feed, *feed, *s;
 +int val, errors = 0, warnings = 0, line_num = 0;
 +FFServerStream **last_stream, *stream = NULL, *redirect = NULL;
 +FFServerStream **last_feed, *feed = NULL;
  AVCodecContext audio_enc, video_enc;
 -enum AVCodecID audio_id, video_id;
 +enum AVCodecID audio_id = AV_CODEC_ID_NONE, video_id = AV_CODEC_ID_NONE;
  int ret = 0;
  
  av_assert0(config);
 @@ -357,17 +357,10 @@ int ffserver_parse_ffconfig(const char *filename, 
 FFServerConfig *config)
  return ret;
  }
  
 -errors = warnings = 0;
 -line_num = 0;
  config-first_stream = NULL;
  last_stream = config-first_stream;
  config-first_feed = NULL;
  last_feed = config-first_feed;
 -stream = NULL;
 -feed = NULL;
 -redirect = NULL;
 -audio_id = AV_CODEC_ID_NONE;
 -video_id = AV_CODEC_ID_NONE;
  #define ERROR(...)   report_config_error(filename, line_num, AV_LOG_ERROR,   
 errors,   __VA_ARGS__)
  #define WARNING(...) report_config_error(filename, line_num, AV_LOG_WARNING, 
 warnings, __VA_ARGS__)
  
 @@ -448,6 +441,7 @@ int ffserver_parse_ffconfig(const char *filename, 
 FFServerConfig *config)
  if (stream || feed) {
  ERROR(Already in a tag\n);
  } else {
 +FFServerStream *s;
  feed = av_mallocz(sizeof(FFServerStream));
  if (!feed) {
  ret = AVERROR(ENOMEM);

LGTM.
-- 
FFmpeg = Fast and Fast Miracolous Powerful Ecumenical Genius
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/4] ffserver_conf: factorize parse function per config tag

2014-10-21 Thread Stefano Sabatini
On date Monday 2014-10-20 23:57:01 +0200, Lukasz Marek encoded:
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
  ffserver.c|6 +
  ffserver_config.c | 1138 
 ++---
  ffserver_config.h |7 +
  3 files changed, 566 insertions(+), 585 deletions(-)
 
 diff --git a/ffserver.c b/ffserver.c
 index af6e8e1..22560ce 100644
 --- a/ffserver.c
 +++ b/ffserver.c
 @@ -208,6 +208,12 @@ static FFServerConfig config = {
  .logfilename = {0},
  .http_addr = {0},
  .rtsp_addr = {0},
 +.errors = 0,
 +.warnings = 0,
 +.audio_id = AV_CODEC_ID_NONE,
 +.video_id = AV_CODEC_ID_NONE,
 +.audio_enc = {0},
 +.video_enc = {0},
  };

Probably good, also I like the idea to split the big parsing function.

[...]
-- 
FFmpeg = Forgiving Frenzy Miracolous Perfectionist Evanescent Gadget
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 0/4] FFserver configuration

2014-10-21 Thread Stefano Sabatini
On date Monday 2014-10-20 23:56:58 +0200, Lukasz Marek encoded:
 Some time ago I wanted to setup internet camera streaming via ffserver
 and I faced the same probalem as #1275.
 It was over a year ago, so I don't remember correctly, but a conclusion
 from debugging was that codec's private data are not initialized to their
 defaults. As I remember I was cased by allocating it on stack and
 calling avcodec_get_context_defaults3 without codec.

The other problem is related to the fact that currently it's not
possible to set private options. Ideally we should replace all
hardcoded codec option with a single option AVCodecOption KEY VAL (or
AVVideoOption or AVAudioOption) which would require to extend the
protocol.

[...]
-- 
FFmpeg = Foolish and Fundamental Maxi Peaceful Emblematic Gospel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi/concat: accept a single segment

2014-10-21 Thread Stefano Sabatini
On date Tuesday 2014-10-21 11:08:47 +0100, Derek Buitenhuis encoded:
 On 10/21/2014 10:47 AM, Stefano Sabatini wrote:
  -  AV_OPT_TYPE_INT, { .i64 = 2 }, 2, INT_MAX, V|A|F},
  +  AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, V|A|F},
 
 I'm not sure I follow how this 'allows' n=1? Doesn't this just
 change the default?

I noticed that after I sent the patch. Patch tested with n=1.
-- 
FFmpeg = Fierce Forgiving Mastering Peaceless Elitarian Geisha
From c3396eab5ef727d2b09c14e4bc47248c12d1c343 Mon Sep 17 00:00:00 2001
From: Stefano Sabatini stefa...@gmail.com
Date: Tue, 21 Oct 2014 11:45:30 +0200
Subject: [PATCH] lavfi/concat: accept a single segment

Simplify scripting operations, so that n=1 is not to be considered as a
special case.
---
 libavfilter/avf_concat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/avf_concat.c b/libavfilter/avf_concat.c
index 18f373c..266bb36 100644
--- a/libavfilter/avf_concat.c
+++ b/libavfilter/avf_concat.c
@@ -59,7 +59,7 @@ typedef struct {
 
 static const AVOption concat_options[] = {
 { n, specify the number of segments, OFFSET(nb_segments),
-  AV_OPT_TYPE_INT, { .i64 = 2 }, 2, INT_MAX, V|A|F},
+  AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, V|A|F},
 { v, specify the number of video streams,
   OFFSET(nb_streams[AVMEDIA_TYPE_VIDEO]),
   AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, V|F },
-- 
1.8.3.2

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


Re: [FFmpeg-devel] [PATCH] lavd/v4l2: don't use avpriv_ prefix for internal functions

2014-10-21 Thread Stefano Sabatini
On date Tuesday 2014-10-21 03:56:06 -0300, James Almer encoded:
 No need to keep the old symbols around until a major bump since lavd 
 functions 
 with the avpriv_ prefix were never exposed.
 
 Signed-off-by: James Almer jamr...@gmail.com

LGTM.

[...]
-- 
FFmpeg = Fast and Faithless Multimedia Political Eager Ghost
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi/concat: accept a single segment

2014-10-21 Thread Derek Buitenhuis
On 10/21/2014 11:22 AM, Stefano Sabatini wrote:
 -  AV_OPT_TYPE_INT, { .i64 = 2 }, 2, INT_MAX, V|A|F},
 +  AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, V|A|F},

OK.

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


Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Prevent memory leak in case of invalid metadata reads.

2014-10-21 Thread Michael Niedermayer
On Tue, Oct 21, 2014 at 11:04:28AM +0100, Derek Buitenhuis wrote:
 On 10/21/2014 9:12 AM, Thilo Borgmann wrote:
  Subject: [PATCH] lavf/mov.c: Prevent memory leak in case of invalid metadata
   reads.
  
  ---
   libavformat/mov.c | 14 --
   1 file changed, 8 insertions(+), 6 deletions(-)
 
 LGTM.

applied

thanks

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

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


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


Re: [FFmpeg-devel] [PATCH] tools/crypto_bench: add CAST5 support

2014-10-21 Thread Michael Niedermayer
On Sat, Oct 18, 2014 at 06:10:39PM -0300, James Almer wrote:
 Signed-off-by: James Almer jamr...@gmail.com
 ---
  tools/crypto_bench.c | 45 +
  1 file changed, 45 insertions(+)

LGTM

[...]
-- 
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


[FFmpeg-devel] Finding residuals in h264 decoding in ffmpeg

2014-10-21 Thread Norbert Schmitt

Hello,

I am trying to understand how the H.264 Decoder in ffmpeg works and  
saving data (Macroblock types and motion vectors for example) from the  
decoding of a H.264 video. I also want to save the residuals for each  
frame but I cant seem to find them. There is something I am missing.  
It goes directly from CABAC/CAVLC decoding to pre-loop-filter values  
as far as I understand it. I already looked in the H264Context struct  
because most of the other information I want can be found there. If  
the residuals or the prediction values are stored in a H264Context  
struct I cannot find out which variable or pointer referes to them.


Can someone please point me in the right direction where the residuals  
and or the predicted values for each frame are stored?


Thanks for your help in advance.

Best Regards
Norbert Schmitt

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


Re: [FFmpeg-devel] [PATCH 1/4] ffserver: move configuration code to separate file

2014-10-21 Thread Lukasz Marek
On 21 October 2014 12:08, Stefano Sabatini stefa...@gmail.com wrote:

 On date Monday 2014-10-20 23:56:59 +0200, Lukasz Marek encoded:
  This commit doesn't change any existing logic.
  It moves ffserver configuration related code to separate file.
  It intends to make maintaining easier.

 I'm not opposed, but please tell why you think it's better this way. I
 still hate the ffmpeg.c/ffmpeg_opt.c split, since it makes debugging
 and browsing the code much harder for me, also it increases the
 complexity since you have to declare otherwise static functions.


ffserver.c has almost 5k lines now. The Commit moves 1k to separate file
and there are only 2 calls in ffserver.c to moved code now.
Is it a matter of personal preferences, but handling 5k lines file is not
easy in general I think.
Especially when there is still some work to be done in parsing code so it
will grow a bit probably.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi/concat: accept a single segment

2014-10-21 Thread Stefano Sabatini
On date Tuesday 2014-10-21 11:33:54 +0100, Derek Buitenhuis encoded:
 On 10/21/2014 11:22 AM, Stefano Sabatini wrote:
  -  AV_OPT_TYPE_INT, { .i64 = 2 }, 2, INT_MAX, V|A|F},
  +  AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, V|A|F},
 
 OK.

Applied.
-- 
FFmpeg = Fierce and Foolish Moronic Power Empowered Gangster
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] configure: add build tree's directories to rpath

2014-10-21 Thread Lukasz Marek
On 21 October 2014 12:01, Derek Buitenhuis derek.buitenh...@gmail.com
wrote:

 On 10/21/2014 8:21 AM, Carl Eugen Hoyos wrote:
  This sounds like a very bad idea to me

 I agree. It's not nice to have remnants of the build process in the
 installed binaries.

 If you need to run them during development, use LD_LIBRARY_PATH or
 or build statically.


Building with static link is much slower.
I agree patch is wrong,  it could be controlled by separate option, just
 for devel, but nvm.
Thx for pointing an issue.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] PATCH: Make -copyts a tri-state

2014-10-21 Thread Michael Niedermayer
On Tue, Oct 21, 2014 at 01:23:55AM -0500, Rodger Combs wrote:
 
  On Oct 20, 2014, at 20:42, Michael Niedermayer michae...@gmx.at wrote:
  
  On Mon, Oct 20, 2014 at 06:50:12PM -0500, Rodger Combs wrote:
  
  On Oct 17, 2014, at 03:19, Rodger Combs rodger.co...@gmail.com wrote:
  
  
  On Oct 15, 2014, at 06:00, Rodger Combs rodger.co...@gmail.com 
  mailto:rodger.co...@gmail.com wrote:
  
  
  On Oct 15, 2014, at 05:37, Nicolas George geo...@nsup.org wrote:
  
  Le quartidi 24 vendémiaire, an CCXXIII, Rodger Combs a écrit :
  Discussed this briefly on IRC; decided this was a good idea. I'm not 
  sure
  if the commit message explains it well enough; please poke me here or 
  on
  IRC if it doesn't.
  
  From 617b532c8a403c1cf06e60c99e9f36c787553b43 Mon Sep 17 00:00:00 2001
  From: Rodger Combs rodger.co...@gmail.com
  Date: Wed, 15 Oct 2014 05:00:02 -0500
  Subject: [PATCH] Make copyts a tri-state, with `no` normalizing input
  timestamps.
  
  This doesn't change the default or `-copyts` behavior, but allows
  `-nocopyts` to make e.g. `-ss 50` have timestamps starting at 50 
  seconds,
  even if the input file's timestamps start at a value other than zero.
  ---
  ffmpeg.c | 6 +++---
  ffmpeg_opt.c | 4 ++--
  2 files changed, 5 insertions(+), 5 deletions(-)
  
  It looks like you forgot to update the documentation too.
  
  Regards,
  
  -- 
  Nicolas George
  ___
  ffmpeg-devel mailing list
  ffmpeg-devel@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
  
  Indeed I did. Here you go:
  0001-Make-copyts-a-tri-state-with-no-normalizing-input-ti.patch
  
  It occurs to me that it might be more useful in some cases to have one 
  master input file (the first one?) be shifted so its timestamps start at 
  zero, and the rest be shifted by the same amount as the master. That 
  might be a good argument for making this its own option, instead of 
  making copyts a tri-state.
  
  I'm not particularly attached to the naming or implementation here, so 
  suggestions are plenty welcome :)
  
  
  Upon some further testing, this seems to create some unusual and 
  undesired behavior in some cases, and I'm not sure exactly why. The patch 
  is definitely not ready, but I'd appreciate it if anyone could help work 
  out a better design for the feature.
  
  My previous patch was awkward and had some unintended side-effects; this 
  version just adds a separate option instead of hacking -copyts.
  
  From 88eb820b701c7eea11d60dd75faa2cefe57bbfe0 Mon Sep 17 00:00:00 2001
  From: Rodger Combs rodger.co...@gmail.com
  Date: Mon, 20 Oct 2014 18:31:18 -0500
  Subject: [PATCH] Add -start_at_zero option.
  
  This automatically shifts input timestamps to start at 0 instead of the 
  file's
  starting timestamp when using -copyts.
  
  applied
  
  please add some documentation for this
  
  thanks
  
  -- 
  Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
  
  Awnsering whenever a program halts or runs forever is
  On a turing machine, in general impossible (turings halting problem).
  On any real computer, always possible as a real computer has a finite number
  of states N, and will either halt in less than N cycles or never halt.
  ___
  ffmpeg-devel mailing list
  ffmpeg-devel@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 
 
 Documentation patch:
 
 From 4fa599b322e5b5c172854eaf32de1ef25e9ec7f5 Mon Sep 17 00:00:00 2001
 From: Rodger Combs rodger.co...@gmail.com
 Date: Tue, 21 Oct 2014 01:22:16 -0500
 Subject: [PATCH] doc/ffmpeg.texi: document the new -start_at_zero option

applied
thanks

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

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


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


[FFmpeg-devel] [PATCH] mov.c: reasonable bitrate for fragmented mp4

2014-10-21 Thread Mika Raento
If using MFRA for timestamps, the stream may start from a large offset
and/or have gaps. With this change we calculate the bitrate based on
frames we've seen.
---
 libavformat/mov.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 80549ec..1444bce 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3943,6 +3943,17 @@ static int mov_read_header(AVFormatContext *s)
 }
 }
 
+if (mov-use_mfra_for  0) {
+for (i = 0; i  s-nb_streams; i++) {
+AVStream *st = s-streams[i];
+MOVStreamContext *sc = st-priv_data;
+if (sc-duration_for_fps  0) {
+st-codec-bit_rate = sc-data_size * 8 * sc-time_scale /
+sc-duration_for_fps;
+}
+}
+}
+
 for (i = 0; i  mov-bitrates_count  i  s-nb_streams; i++) {
 if (mov-bitrates[i]) {
 s-streams[i]-codec-bit_rate = mov-bitrates[i];
-- 
1.9.3 (Apple Git-50)

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


Re: [FFmpeg-devel] [PATCH 1/4] ffserver: move configuration code to separate file

2014-10-21 Thread Stefano Sabatini
On date Tuesday 2014-10-21 13:18:01 +0200, Lukasz Marek encoded:
 On 21 October 2014 12:08, Stefano Sabatini stefa...@gmail.com wrote:
 
  On date Monday 2014-10-20 23:56:59 +0200, Lukasz Marek encoded:
   This commit doesn't change any existing logic.
   It moves ffserver configuration related code to separate file.
   It intends to make maintaining easier.
 
  I'm not opposed, but please tell why you think it's better this way. I
  still hate the ffmpeg.c/ffmpeg_opt.c split, since it makes debugging
  and browsing the code much harder for me, also it increases the
  complexity since you have to declare otherwise static functions.
 
 

 ffserver.c has almost 5k lines now. The Commit moves 1k to separate file
 and there are only 2 calls in ffserver.c to moved code now.
 Is it a matter of personal preferences, but handling 5k lines file is not
 easy in general I think.
 Especially when there is still some work to be done in parsing code so it
 will grow a bit probably.

I'm fine with whatever the maintainer will decide.
-- 
FFmpeg = Faithful Frightening Majestic Ponderous Extreme Guru
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [RFC] How to deal with libavfilter buffer overflows?

2014-10-21 Thread Stefano Sabatini
$ ffmpeg -f lavfi -i testsrc=d=10, split[t0][t1]; 
[t0]select='gte(t,5)',setpts=PTS-STARTPTS[s0]; [t1] select='lt(t,5)', 
setpts=PTS-STARTPTS[s1]; [s0][s1] concat -y outtest.mp4
[...]
Input #0, lavfi, from 'testsrc=d=10, split[t0][t1]; 
[t0]select='gte(t,5)',setpts=PTS-STARTPTS[s0]; [t1] select='lt(t,5)', 
setpts=PTS-STARTPTS[s1]; [s0][s1] concat':
  Duration: N/A, start: 0.00, bitrate: N/A
Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 320x240 [SAR 
1:1 DAR 4:3], 25 fps, 25 tbr, 1000k tbn, 1000k tbc
[...]
Output #0, mp4, to 'outtest.mp4':
  Metadata:
encoder : Lavf56.9.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 
320x240 [SAR 1:1 DAR 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
  encoder : Lavc56.8.102 libx264
Stream mapping:
  Stream #0:0 - #0:0 (rawvideo (native) - h264 (libx264))
Press [q] to stop, [?] for help
[out @ 0x3140560] 100 buffers queued in out, something may be wrong.
frame=  125 fps=0.0 q=-1.0 Lsize=  25kB time=00:00:04.92 bitrate=  
42.4kbits/s
video:23kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing 
overhead: 9.620967%

I frequently stumble upon situations when buffer overflows happen, and
they are usually a showstopper in many applications. For example when
recombining streams with the concat filter, or when overlaying. The
output is usually playable but misses audio or video frames.  For
example in the case above, the command is trying to switch order of
the two input parts, but only the second part is displayed and the
user is left with the vague message something may be wrong.

So the current buffering system sometimes fails, and the user has no
clue to understand where the problem lies. I want at least to improve
diagnostics, but I want to listen about other developers experience
first, and if you have ideas to tackle such issues.

I can provide more use cases if required.
-- 
FFmpeg = Foolish and Fanciful Multimedia Powerful Elected Gladiator
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Facebook page

2014-10-21 Thread Thomas Volkert

 Please, vote for a Facebook url here:
 http://goo.gl/forms/AHVFvPxp8X

 This will show us the community opinion about this.
   Does this mean that just ffmpeg is used by someone else?


Yes, ffmpeg is already used by someone else.

Best regards,
Thomas.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Facebook page

2014-10-21 Thread Thomas Volkert
Am 15.10.2014 10:49, schrieb Thomas Volkert:
 On 10/05/2014 09:09 PM, compn wrote:
 On Sun, 05 Oct 2014 20:19:49 +0200
 Thomas Volkert si...@gmx.net wrote:

 http://www.facebook.com/ffmpeg.devel,
 http://www.facebook.com/ffmpeg.framework,
 http://www.facebook.com/multimedia.framework, ...
 @all: What is your opinion about these alternative solutions?

 maybe http://www.facebook.com/ffmpeg.org ?
 or http://www.facebook.com/ffmpeg.official ?
 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

 Please, vote for a Facebook url here:
 http://goo.gl/forms/AHVFvPxp8X

 This will show us the community opinion about this.

 Best regards,
 Thomas.

The result is:

ffmpeg.official:
19 %
ffmpeg.framework:   
0 %
ffmpeg.org: 
81 %
ffmpeg.devel:   
0 %
ffmpeg.project: 
0 %
ffmpegproject:  
0 %


Best regards,
Thomas.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH]Addedd Kate demuxer and decoder

2014-10-21 Thread Hima Dangi
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 86064ea..4d41283 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -433,6 +433,7 @@ OBJS-$(CONFIG_VOBSUB_DEMUXER)+= subtitles.o
# mpeg demuxer is in the
 OBJS-$(CONFIG_VOC_DEMUXER)   += vocdec.o voc.o
 OBJS-$(CONFIG_VOC_MUXER) += vocenc.o voc.o
 OBJS-$(CONFIG_VPLAYER_DEMUXER)   += vplayerdec.o subtitles.o
+OBJS-$(CONFIG_KATE_DEMUXER)  += katedec.o subtitles.o
 OBJS-$(CONFIG_VQF_DEMUXER)   += vqf.o
 OBJS-$(CONFIG_W64_DEMUXER)   += wavdec.o w64.o pcm.o
 OBJS-$(CONFIG_W64_MUXER) += wavenc.o w64.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index d54ed9b..6e16031 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -320,7 +320,7 @@ void av_register_all(void)
 REGISTER_DEMUXER (XWMA, xwma);
 REGISTER_DEMUXER (YOP,  yop);
 REGISTER_MUXDEMUX(YUV4MPEGPIPE, yuv4mpegpipe);
-
+REGISTER_DEMUXER (KATE, kate);
 /* image demuxers */
 REGISTER_DEMUXER (IMAGE_BMP_PIPE,image_bmp_pipe);
 REGISTER_DEMUXER (IMAGE_DPX_PIPE,image_dpx_pipe);
diff --git a/libavformat/katedec.c b/libavformat/katedec.c
new file mode 100644
index 000..7b4ced3
--- /dev/null
+++ b/libavformat/katedec.c
@@ -0,0 +1,158 @@
+
+
+/**
+ * @file
+ * Kate subtitles format demuxer
+ */
+
+#include avformat.h
+#include internal.h
+#include subtitles.h
+#include libavutil/bprint.h
+#include libavutil/intreadwrite.h
+
+
+typedef struct {
+FFDemuxSubtitlesQueue q;
+} KateContext;
+
+static int kate_probe(AVProbeData *p)
+{
+int v1,v2,v3,v4,v5,v6;
+const char *ptr = p-buf;
+const char *find;
+if(strstr(ptr,kate {))
+{
+
+  find=strstr(ptr,event {);
+  while(strcmp(find,\n)==0 || strcmp(find, )==0)
+   find++;
+  if (  sscanf(find, %2d:%2d:%2d --
%2d:%2d:%2d,v1,v2,v3,v4,v5,v6 )=4)
+  return AVPROBE_SCORE_MAX;
+  else
+  return 0;
+ }
+ else
+ return 0;
+}
+
+static int64_t get_pts_start(const char **buf)
+{
+
+int hh1, mm1, ss1;
+int hh2, mm2, ss2;
+const char *find = strstr(*buf,event);
+while(strcmp(find,\n)|| strcmp(find, ))
+find++;
+if(sscanf(find,  %2d:%2d:%2d -- %2d:%2d:%2d,hh1, mm1,
ss1,hh2, mm2, ss2)=6)
+{
+int64_t start = (hh1*3600LL + mm1*60LL + ss1) * 1000LL;
+*buf += ff_subtitles_next_line(*buf);
+return start;
+}
+   *buf += ff_subtitles_next_line(*buf);
+  return AV_NOPTS_VALUE;
+}
+
+static int64_t get_pts_end(const char **buf)
+{
+
+int hh1, mm1, ss1;
+int hh2, mm2, ss2;
+const char *find = strstr(*buf,event);
+while(strcmp(find,\n) || strcmp(find, ))
+find++;
+if(sscanf(find,  %2d:%2d:%2d -- %2d:%2d:%2d,hh1, mm1,
ss1,hh2, mm2, ss2)=6)
+{
+int64_t end = (hh2*3600LL + mm2*60LL + ss2) * 1000LL;

+*buf += ff_subtitles_next_line(*buf);
+return end;
+}
+   *buf += ff_subtitles_next_line(*buf);
+  return AV_NOPTS_VALUE;
+}
+
+static int kate_read_header(AVFormatContext *s)
+{
+KateContext *kate = s-priv_data;
+AVStream *st = avformat_new_stream(s, NULL);
+ int64_t pts_start;
+int64_t pts_end;
+int64_t duration;
+if (!st)
+return AVERROR(ENOMEM);
+avpriv_set_pts_info(st, 64, 1, 100);
+st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE;
+st-codec-codec_id   = AV_CODEC_ID_TEXT;
+
+
+
+while (!avio_feof(s-pb))
+ {
+char line[4096];
+const char *p = line;
+const int64_t pos = avio_tell(s-pb);
+int len = ff_get_line(s-pb, line, sizeof(line));
+
+AVPacket *sub;
+
+
+
+if (!len)
+break;
+
+line[strcspn(line, \r\n)] = 0;
+
+pts_start = get_pts_start(p);
+pts_end = get_pts_end(p);
+if (pts_start != AV_NOPTS_VALUE  pts_end !=AV_NOPTS_VALUE)
+{
+duration= pts_end- pts_start;
+
+
+sub = ff_subtitles_queue_insert(kate-q, p, strlen(p), 0);
+if (!sub)
+return AVERROR(ENOMEM);
+sub-pos = pos;
+sub-pts = pts_start;
+sub-duration = duration;
+
+}
+}
+
+ff_subtitles_queue_finalize(kate-q);
+return 0;
+}
+
+static int kate_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+KateContext *kate = s-priv_data;
+return ff_subtitles_queue_read_packet(kate-q, pkt);
+}
+
+static int kate_read_seek(AVFormatContext *s, int stream_index,
+ int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
+{
+KateContext *kate = s-priv_data;
+return ff_subtitles_queue_seek(kate-q, s, stream_index,
+   min_ts, ts, max_ts, flags);
+}
+
+static int kate_read_close(AVFormatContext *s)
+{
+

Re: [FFmpeg-devel] Facebook page

2014-10-21 Thread Thomas Volkert
Am 21.10.2014 18:12, schrieb James Almer:
 ffmpeg is a registered trademark. I'm sure Facebook can solve this is asked.


There was also no response from Facebook within the last days.

Best regards,
Thomas.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mov.c: reasonable bitrate for fragmented mp4

2014-10-21 Thread Michael Niedermayer
On Tue, Oct 21, 2014 at 03:04:10PM +0300, Mika Raento wrote:
 If using MFRA for timestamps, the stream may start from a large offset
 and/or have gaps. With this change we calculate the bitrate based on
 frames we've seen.
 ---
  libavformat/mov.c | 11 +++
  1 file changed, 11 insertions(+)

applied

btw this mayb could be factored with the previous loop

thanks

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

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


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


Re: [FFmpeg-devel] [PATCH 3/4] ffserver_conf: factorize parse function per config tag

2014-10-21 Thread Reimar Döffinger
On 21.10.2014, at 12:15, Stefano Sabatini stefa...@gmail.com wrote:
 On date Monday 2014-10-20 23:57:01 +0200, Lukasz Marek encoded:
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
 ffserver.c|6 +
 ffserver_config.c | 1138 
 ++---
 ffserver_config.h |7 +
 3 files changed, 566 insertions(+), 585 deletions(-)
 
 diff --git a/ffserver.c b/ffserver.c
 index af6e8e1..22560ce 100644
 --- a/ffserver.c
 +++ b/ffserver.c
 @@ -208,6 +208,12 @@ static FFServerConfig config = {
 .logfilename = {0},
 .http_addr = {0},
 .rtsp_addr = {0},
 +.errors = 0,
 +.warnings = 0,
 +.audio_id = AV_CODEC_ID_NONE,
 +.video_id = AV_CODEC_ID_NONE,
 +.audio_enc = {0},
 +.video_enc = {0},
 };
 
 Probably good, also I like the idea to split the big parsing function.

I was going to ask if it wouldn't me better to use memset or just a single {0} 
to ensure that the whole struct is initialized at least and then assign the 
values for which you want something else.
Though since it is static variable all that is kind of pointless since it 
defaults to 0 initialization.
I which case I'd prefer if all the explicit initialization 0 was removed, it 
feels like a lot of clutter to do effectively nothing.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libutvideo: remove libutvideo wrapper

2014-10-21 Thread Lou Logan
On Fri, 17 Oct 2014 05:02:55 +0200, Michael Niedermayer wrote:

 this removes the possibility to easily test our decoder against
 libutvideo.

Ok.

Just thought I'd throw it out there/generate some discussion.

Anyway, patch dropped.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Facebook page

2014-10-21 Thread Lou Logan
On Tue, 21 Oct 2014 19:30:39 +0200, Thomas Volkert wrote:

 There was also no response from Facebook within the last days.

The behemoth is probably slow to respond. Let's give them some more
time then perhaps prod them again after not hearing from them for a
week.

I'd rather have ffmpeg or nothing. Easy for me to say though since I
haven't done a damned thing to help.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavd/alsa: implement get_device_list callbacks

2014-10-21 Thread Lukasz Marek

On 19.10.2014 16:27, wm4 wrote:

On Sat, 18 Oct 2014 20:36:22 +0200
Lukasz Marek lukasz.m.lu...@gmail.com wrote:


---
  libavdevice/alsa-audio-common.c | 60 +
  libavdevice/alsa-audio-dec.c|  6 +
  libavdevice/alsa-audio-enc.c|  6 +
  libavdevice/alsa-audio.h|  2 ++
  4 files changed, 74 insertions(+)

diff --git a/libavdevice/alsa-audio-common.c b/libavdevice/alsa-audio-common.c
index 4e63397..1061917 100644
--- a/libavdevice/alsa-audio-common.c
+++ b/libavdevice/alsa-audio-common.c
@@ -343,3 +343,63 @@ int ff_alsa_extend_reorder_buf(AlsaData *s, int min_size)
  s-reorder_buf_size = size;
  return 0;
  }
+
+/* ported from alsa-utils/aplay.c */
+int ff_alsa_get_device_list(AVDeviceInfoList *device_list, snd_pcm_stream_t 
stream_type)
+{
+int ret;
+void **hints, **n;
+char *name = NULL, *descr = NULL, *io = NULL, *tmp;
+AVDeviceInfo *new_device = NULL;
+const char *filter = stream_type == SND_PCM_STREAM_PLAYBACK ? Output : 
Input;
+
+av_log(NULL, AV_LOG_INFO, %s\n, filter);
+
+if (snd_device_name_hint(-1, pcm, hints)  0)
+return AVERROR_EXTERNAL;
+n = hints;
+while (*n) {
+name = snd_device_name_get_hint(*n, NAME);
+descr = snd_device_name_get_hint(*n, DESC);
+io = snd_device_name_get_hint(*n, IOID);
+if (!io || !strcmp(io, filter)) {
+new_device = av_mallocz(sizeof(AVDeviceInfo));
+if (!new_device) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
+new_device-device_name = name;
+name = NULL;
+if ((tmp = strrchr(descr, '\n'))  tmp[1]) {
+new_device-device_description = av_strdup(tmp[1]);
+if (!new_device-device_description) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
+} else {
+new_device-device_description = descr;
+descr = NULL;
+}
+if ((ret = av_dynarray_add_nofree(device_list-devices,
+  device_list-nb_devices, 
new_device))  0) {
+goto fail;
+}
+new_device = NULL;
+}
+av_freep(io);
+av_freep(name);
+av_freep(descr);
+n++;
+}
+  fail:
+av_free(io);
+av_free(name);
+av_free(descr);
+if (new_device) {
+av_free(new_device-device_description);
+av_free(new_device-device_name);
+av_free(new_device);
+}
+snd_device_name_free_hint(hints);
+return ret;
+}
diff --git a/libavdevice/alsa-audio-dec.c b/libavdevice/alsa-audio-dec.c
index 2cdf356..7f8f8cd 100644
--- a/libavdevice/alsa-audio-dec.c
+++ b/libavdevice/alsa-audio-dec.c
@@ -132,6 +132,11 @@ static int audio_read_packet(AVFormatContext *s1, AVPacket 
*pkt)
  return 0;
  }


This will list all pseudo-devices. I concluded that this doesn't really
work. The device name also controls the channel layout, and listing the
device hints includes those multichannel pseudo-devies (e.g
surround51:CARD=Intel,DEV=0). But shouldn't you select the device
name based on the input audio channel layout you get? There are other
reasons to change the device name, e.g. adding the plug converter
plugin.


I don't understand you clearly here.


So I'm not sure what would be the best. Maybe enumerate raw devices
only?


Well, I have doubts about that too. I will change that when no other 
comments.

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


Re: [FFmpeg-devel] [PATCH 1/2] lavd/fbdev_common: report error during probing fbdev device

2014-10-21 Thread Lukasz Marek

On 19.10.2014 00:28, Michael Niedermayer wrote:

On Sat, Oct 18, 2014 at 08:25:29PM +0200, Lukasz Marek wrote:

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavdevice/fbdev_common.c | 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)


LGTM


Pushed

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


Re: [FFmpeg-devel] [PATCH] lavd/fbdev_dec: use default device when not provided

2014-10-21 Thread Lukasz Marek

On 19.10.2014 00:27, Michael Niedermayer wrote:

On Sat, Oct 18, 2014 at 07:38:16PM +0200, Lukasz Marek wrote:

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavdevice/fbdev_dec.c | 10 --
  1 file changed, 8 insertions(+), 2 deletions(-)


LGTM


Pushed.

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


Re: [FFmpeg-devel] [PATCH] Added STL demuxer and decoder

2014-10-21 Thread Clément Bœsch
On Tue, Oct 21, 2014 at 02:17:51AM +0530, Eejya Singh wrote:
 Updated sample test after rebasing. Please find the patch attached.
 

I did the little tweak below:

[...]
 From 798bc500b2df2c90d4fe42b8418059ab1b51fb8a Mon Sep 17 00:00:00 2001
 From: Eejya Singh singh.ee...@gmail.com
 Date: Tue, 21 Oct 2014 01:55:39 +0530
 Subject: [PATCH] Added STL demuxer and decoder
 
 ---
  Changelog|   2 +-
  doc/general.texi |   1 +
  libavcodec/Makefile  |   1 +
  libavcodec/allcodecs.c   |   1 +
  libavcodec/avcodec.h |   1 +
  libavcodec/codec_desc.c  |   7 +++
  libavcodec/textdec.c |  18 +-
  libavformat/Makefile |   1 +
  libavformat/allformats.c |   1 +
  libavformat/stldec.c | 141 
 +++
  tests/fate/subtitles.mak |   3 +
  tests/ref/fate/sub-stl   |  29 ++
  12 files changed, 204 insertions(+), 2 deletions(-)
  create mode 100644 libavformat/stldec.c
  create mode 100644 tests/ref/fate/sub-stl
 
 diff --git a/Changelog b/Changelog
 index 1ab4364..99c4c71 100644
 --- a/Changelog
 +++ b/Changelog
 @@ -6,7 +6,7 @@ version next:
  - SUP/PGS subtitle demuxer
  - ffprobe -show_pixel_formats option
  - CAST128 symmetric block cipher, ECB mode
 -
 +- STL subtitle demuxer and decoder

restored the line dropped

  version 2.4:
  - Icecast protocol
  - ported lenscorrection filter from frei0r filter
 diff --git a/doc/general.texi b/doc/general.texi
 index 2252f7b..0e79279 100644
 --- a/doc/general.texi
 +++ b/doc/general.texi
 @@ -1032,6 +1032,7 @@ performance on systems without hardware floating point 
 support).
  @item RealText @tab   @tab X @tab   @tab X
  @item SAMI @tab   @tab X @tab   @tab X
  @item SSA/ASS  @tab X @tab X @tab X @tab X
 +@item Spruce format(STL)@tab   @tab X @tab   @tab X

Fixed spacing and order.

[...]

Also bumped libavcodec and libavformat versions/

So the patch is now queue and will be pushed soon.

I would have pushed it right away, but the sample and test were updated
not to endup with trailing whitespaces in the reference (because some git
hooks reject it). So I have to wait for another 24 hours before pushing.

But anyway, consider it as if it was upstream.

Thank you and good work.

-- 
Clément B.


pgpA4UnvAyDfV.pgp
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] opts: add list device sources/sinks options

2014-10-21 Thread Lukasz Marek

On 19.10.2014 00:20, Michael Niedermayer wrote:

On Sat, Oct 18, 2014 at 08:25:30PM +0200, Lukasz Marek wrote:

Allows to list sources/sinks of the devices that implement
that functionality.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com

[...]

+int show_sinks(void *optctx, const char *opt, const char *arg)
+{
+#if CONFIG_AVDEVICE
+AVOutputFormat *fmt = NULL;
+char *dev = NULL;
+AVDictionary *opts = NULL;
+int ret = 0;
+int error_level = av_log_get_level();
+
+av_log_set_level(AV_LOG_ERROR);
+
+if ((ret = show_sinks_sources_parse_arg(arg, dev, opts))  0)
+goto fail;
+
+do {
+fmt = av_output_audio_device_next(fmt);


av_* functions are not exported from libavdevice
see libavdevice/libavdevice.v


It is fixed now, do you have any other comments?

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


Re: [FFmpeg-devel] [PATCH] lavd: export all symbols with av prefix

2014-10-21 Thread Lukasz Marek

On 21.10.2014 08:59, James Almer wrote:

On 20/10/14 5:03 PM, Lukasz Marek wrote:

On 20.10.2014 14:55, Michael Niedermayer wrote:

On Mon, Oct 20, 2014 at 12:14:14PM +0200, Lukasz Marek wrote:

On 20 October 2014 08:47, Reimar Döffinger reimar.doeffin...@gmx.de wrote:


On 19.10.2014, at 13:39, Lukasz Marek lukasz.m.lu...@gmail.com wrote:


Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
libavdevice/libavdevice.v | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/libavdevice.v b/libavdevice/libavdevice.v
index 663af85..d7c86ba 100644
--- a/libavdevice/libavdevice.v
+++ b/libavdevice/libavdevice.v
@@ -1,4 +1,4 @@
LIBAVDEVICE_$MAJOR {
-global: avdevice_*;
+global: av*;


I'd prefer if we'd keep the explicit _ termination and explicitly list all
prefixes that get exported.
I admit that luckily av is uncommon in English to start a word so it
probably won't matter much though.



I checked libavformat and libavcodec and they export av*, but I agree in
general so I have changed according to your suggestion.



   libavdevice.v |2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
5722720606edb454d2b64edb06299b1a37099827  
0001-lavd-export-all-symbols-with-av_-prefix.patch
  From ea5b124b9eac8a4e07f41860fba646c6bc55f5bd Mon Sep 17 00:00:00 2001
From: Lukasz Marek lukasz.m.lu...@gmail.com
Date: Mon, 20 Oct 2014 12:12:20 +0200
Subject: [PATCH] lavd: export all symbols with av_ prefix


LGTM


Pushed.


Should this be backported to ffmpeg 2.2 and 2.3? The four av_ functions 
declared in avdevice.h
were never exposed before this.


Only to 2.3 (these symbols are not present in 2.2)
Michael, could you backport it?

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


Re: [FFmpeg-devel] [PATCH]Addedd Kate demuxer and decoder

2014-10-21 Thread Clément Bœsch
On Tue, Oct 21, 2014 at 10:02:35PM +0530, Hima Dangi wrote:
 diff --git a/libavformat/Makefile b/libavformat/Makefile
 index 86064ea..4d41283 100644
 --- a/libavformat/Makefile
 +++ b/libavformat/Makefile

A git format-patch is prefered because it includes authorship, commit
message, commit description, ...

 @@ -433,6 +433,7 @@ OBJS-$(CONFIG_VOBSUB_DEMUXER)+= subtitles.o
 # mpeg demuxer is in the
  OBJS-$(CONFIG_VOC_DEMUXER)   += vocdec.o voc.o
  OBJS-$(CONFIG_VOC_MUXER) += vocenc.o voc.o
  OBJS-$(CONFIG_VPLAYER_DEMUXER)   += vplayerdec.o subtitles.o
 +OBJS-$(CONFIG_KATE_DEMUXER)  += katedec.o subtitles.o
  OBJS-$(CONFIG_VQF_DEMUXER)   += vqf.o

This is not the correct order

  OBJS-$(CONFIG_W64_DEMUXER)   += wavdec.o w64.o pcm.o
  OBJS-$(CONFIG_W64_MUXER) += wavenc.o w64.o
 diff --git a/libavformat/allformats.c b/libavformat/allformats.c
 index d54ed9b..6e16031 100644
 --- a/libavformat/allformats.c
 +++ b/libavformat/allformats.c
 @@ -320,7 +320,7 @@ void av_register_all(void)
  REGISTER_DEMUXER (XWMA, xwma);
  REGISTER_DEMUXER (YOP,  yop);
  REGISTER_MUXDEMUX(YUV4MPEGPIPE, yuv4mpegpipe);
 -
 +REGISTER_DEMUXER (KATE, kate);

kate should be along its subtitles peers

  /* image demuxers */
  REGISTER_DEMUXER (IMAGE_BMP_PIPE,image_bmp_pipe);
  REGISTER_DEMUXER (IMAGE_DPX_PIPE,image_dpx_pipe);
 diff --git a/libavformat/katedec.c b/libavformat/katedec.c
 new file mode 100644
 index 000..7b4ced3
 --- /dev/null
 +++ b/libavformat/katedec.c
 @@ -0,0 +1,158 @@

First, before I start. All the indentation in the file is completely
broken. See the other code source files for a reference, and
http://ffmpeg.org/developer.html#Coding-Rules-1

 +
 +
 +/**
 + * @file
 + * Kate subtitles format demuxer
 + */
 +
 +#include avformat.h
 +#include internal.h
 +#include subtitles.h
 +#include libavutil/bprint.h
 +#include libavutil/intreadwrite.h
 +
 +
 +typedef struct {
 +FFDemuxSubtitlesQueue q;
 +} KateContext;
 +
 +static int kate_probe(AVProbeData *p)
 +{
 +int v1,v2,v3,v4,v5,v6;
 +const char *ptr = p-buf;
 +const char *find;
 +if(strstr(ptr,kate {))
 +{
 +
 +  find=strstr(ptr,event {);

What happens if you have event and the timestamp just after?

 +  while(strcmp(find,\n)==0 || strcmp(find, )==0)

This can not work, it was not tested.

Also, you can use a simple equality since it's only single characters.

 +   find++;
 +  if (  sscanf(find, %2d:%2d:%2d --
 %2d:%2d:%2d,v1,v2,v3,v4,v5,v6 )=4)

Why = 4?

Also, your mail is mangled (lines are wrapped), you didn't send it
properly. Use git-send-email or configure your mailer.

 +  return AVPROBE_SCORE_MAX;
 +  else
 +  return 0;
 + }
 + else
 + return 0;
 +}
 +
 +static int64_t get_pts_start(const char **buf)
 +{
 +
 +int hh1, mm1, ss1;
 +int hh2, mm2, ss2;
 +const char *find = strstr(*buf,event);
 +while(strcmp(find,\n)|| strcmp(find, ))
 +find++;
 +if(sscanf(find,  %2d:%2d:%2d -- %2d:%2d:%2d,hh1, mm1,
 ss1,hh2, mm2, ss2)=6)
 +{
 +int64_t start = (hh1*3600LL + mm1*60LL + ss1) * 1000LL;
 +*buf += ff_subtitles_next_line(*buf);
 +return start;
 +}
 +   *buf += ff_subtitles_next_line(*buf);
 +  return AV_NOPTS_VALUE;
 +}
 +
 +static int64_t get_pts_end(const char **buf)
 +{

This function is almost identical to get_pts_start(), they should be
refactored.

 +
 +int hh1, mm1, ss1;
 +int hh2, mm2, ss2;
 +const char *find = strstr(*buf,event);
 +while(strcmp(find,\n) || strcmp(find, ))
 +find++;
 +if(sscanf(find,  %2d:%2d:%2d -- %2d:%2d:%2d,hh1, mm1,
 ss1,hh2, mm2, ss2)=6)
 +{
 +int64_t end = (hh2*3600LL + mm2*60LL + ss2) * 1000LL;
 
 +*buf += ff_subtitles_next_line(*buf);
 +return end;
 +}
 +   *buf += ff_subtitles_next_line(*buf);
 +  return AV_NOPTS_VALUE;
 +}
 +
 +static int kate_read_header(AVFormatContext *s)
 +{
 +KateContext *kate = s-priv_data;
 +AVStream *st = avformat_new_stream(s, NULL);
 + int64_t pts_start;
 +int64_t pts_end;
 +int64_t duration;
 +if (!st)
 +return AVERROR(ENOMEM);
 +avpriv_set_pts_info(st, 64, 1, 100);
 +st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE;
 +st-codec-codec_id   = AV_CODEC_ID_TEXT;
 +
 +
 +
 +while (!avio_feof(s-pb))
 + {
 +char line[4096];
 +const char *p = line;
 +const int64_t pos = avio_tell(s-pb);

 +int len = ff_get_line(s-pb, line, sizeof(line));
 +

Since you're reading line per line, how can this work with multiline
events.

And typically, I'd be surprised if your code works with this:

kate {
  event
{
   01:02:03 -- 04:05:06
 foo bar
}
}

 +

Re: [FFmpeg-devel] [PATCH]Addedd Kate demuxer and decoder

2014-10-21 Thread Carl Eugen Hoyos
Hima Dangi hima.dangi565 at gmail.com writes:

 --- /dev/null
 +++ b/libavformat/katedec.c
  at  at  -0,0 +1,158  at  at 
 +
 +
 +/**
 + *  at file
 + * Kate subtitles format demuxer
 + */

Please add a license header, copy it from another 
file.

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH]Mention in the documentation that fieldmatch needs cfr input

2014-10-21 Thread Carl Eugen Hoyos
Derek Buitenhuis derek.buitenhuis at gmail.com writes:

 On 10/21/2014 8:32 AM, Carl Eugen Hoyos wrote:
  +The filter only works for strictly constant frame rate input. 

I removed strictly locally.

  If your input 
  +has variable frame rate, try the  at ref{pullup} filter.
 
 Perhaps the filter should output a warning as well?

I have no opinion, but this sounds unrelated to me.

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH 2/2] opts: add list device sources/sinks options

2014-10-21 Thread Michael Niedermayer
On Sat, Oct 18, 2014 at 08:25:30PM +0200, Lukasz Marek wrote:
 Allows to list sources/sinks of the devices that implement
 that functionality.
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
  cmdutils.c | 191 
 +
  cmdutils.h |  12 
  cmdutils_common_opts.h |   6 ++
  3 files changed, 209 insertions(+)
[...]
 +int show_sources(void *optctx, const char *opt, const char *arg)
 +{
 +#if CONFIG_AVDEVICE
 +AVInputFormat *fmt = NULL;
 +char *dev = NULL;
 +AVDictionary *opts = NULL;
 +int ret = 0;
 +int error_level = av_log_get_level();
 +
 +av_log_set_level(AV_LOG_ERROR);
 +
 +if ((ret = show_sinks_sources_parse_arg(arg, dev, opts))  0)
 +goto fail;
 +
 +do {
 +fmt = av_input_audio_device_next(fmt);
 +if (fmt) {
 +if (!strcmp(fmt-name, lavfi))
 +continue; //it's pointless to probe lavfi
 +if (dev  strcmp(fmt-name, dev))
 +continue;
 +print_device_sources(fmt, opts);
 +}
 +} while (fmt);
 +do {
 +fmt = av_input_video_device_next(fmt);
 +if (fmt) {
 +if (dev  strcmp(fmt-name, dev))
 +continue;
 +print_device_sources(fmt, opts);
 +}
 +} while (fmt);
 +  fail:
 +av_dict_free(opts);
 +av_free(dev);
 +av_log_set_level(error_level);
 +return ret;
 +#else
 +printf(Configured without libavdevice\n);
 +return AVERROR(ENOSYS);
 +#endif

it seems the only use of this function is under #if CONFIG_AVDEVICE
so the fallback shouldnt be needed
same for the other function

also mising documentation and example in docs

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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable


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


Re: [FFmpeg-devel] [PATCH] lavd: export all symbols with av prefix

2014-10-21 Thread James Almer
On 21/10/14 6:05 PM, Lukasz Marek wrote:
 On 21.10.2014 08:59, James Almer wrote:
 On 20/10/14 5:03 PM, Lukasz Marek wrote:
 On 20.10.2014 14:55, Michael Niedermayer wrote:
 On Mon, Oct 20, 2014 at 12:14:14PM +0200, Lukasz Marek wrote:
 On 20 October 2014 08:47, Reimar Döffinger reimar.doeffin...@gmx.de 
 wrote:

 On 19.10.2014, at 13:39, Lukasz Marek lukasz.m.lu...@gmail.com wrote:

 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
 libavdevice/libavdevice.v | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/libavdevice/libavdevice.v b/libavdevice/libavdevice.v
 index 663af85..d7c86ba 100644
 --- a/libavdevice/libavdevice.v
 +++ b/libavdevice/libavdevice.v
 @@ -1,4 +1,4 @@
 LIBAVDEVICE_$MAJOR {
 -global: avdevice_*;
 +global: av*;

 I'd prefer if we'd keep the explicit _ termination and explicitly list 
 all
 prefixes that get exported.
 I admit that luckily av is uncommon in English to start a word so it
 probably won't matter much though.


 I checked libavformat and libavcodec and they export av*, but I agree in
 general so I have changed according to your suggestion.

libavdevice.v |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
 5722720606edb454d2b64edb06299b1a37099827  
 0001-lavd-export-all-symbols-with-av_-prefix.patch
   From ea5b124b9eac8a4e07f41860fba646c6bc55f5bd Mon Sep 17 00:00:00 2001
 From: Lukasz Marek lukasz.m.lu...@gmail.com
 Date: Mon, 20 Oct 2014 12:12:20 +0200
 Subject: [PATCH] lavd: export all symbols with av_ prefix

 LGTM

 Pushed.

 Should this be backported to ffmpeg 2.2 and 2.3? The four av_ functions 
 declared in avdevice.h
 were never exposed before this.
 
 Only to 2.3 (these symbols are not present in 2.2)
 Michael, could you backport it?

Mmh, you're right.
That means doc/APIChanges is wrong. The FFmpeg 2.2 was cut here line is above 
the ones mentioning 
the addition of these four av_ functions to avdevice.h

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


Re: [FFmpeg-devel] [PATCH] matroskadec: execute seekheads recursively

2014-10-21 Thread Carl Eugen Hoyos
Rodger Combs rodger.combs at gmail.com writes:

 This fixes https://trac.ffmpeg.org/ticket/3934 but I'm
 not sure if there was a good reason for this to be 
 here to begin with. Perhaps a protection against 
 infinite recursion (though I believe EBML_MAX_DEPTH 
 serves that purpose to some degree)?

Is all this related to ticket #2263?

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] lavd: export all symbols with av prefix

2014-10-21 Thread Michael Niedermayer
On Tue, Oct 21, 2014 at 11:05:40PM +0200, Lukasz Marek wrote:
 On 21.10.2014 08:59, James Almer wrote:
 On 20/10/14 5:03 PM, Lukasz Marek wrote:
 On 20.10.2014 14:55, Michael Niedermayer wrote:
 On Mon, Oct 20, 2014 at 12:14:14PM +0200, Lukasz Marek wrote:
 On 20 October 2014 08:47, Reimar Döffinger reimar.doeffin...@gmx.de 
 wrote:
 
 On 19.10.2014, at 13:39, Lukasz Marek lukasz.m.lu...@gmail.com wrote:
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
 libavdevice/libavdevice.v | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavdevice/libavdevice.v b/libavdevice/libavdevice.v
 index 663af85..d7c86ba 100644
 --- a/libavdevice/libavdevice.v
 +++ b/libavdevice/libavdevice.v
 @@ -1,4 +1,4 @@
 LIBAVDEVICE_$MAJOR {
 -global: avdevice_*;
 +global: av*;
 
 I'd prefer if we'd keep the explicit _ termination and explicitly list 
 all
 prefixes that get exported.
 I admit that luckily av is uncommon in English to start a word so it
 probably won't matter much though.
 
 
 I checked libavformat and libavcodec and they export av*, but I agree in
 general so I have changed according to your suggestion.
 
libavdevice.v |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
 5722720606edb454d2b64edb06299b1a37099827  
 0001-lavd-export-all-symbols-with-av_-prefix.patch
   From ea5b124b9eac8a4e07f41860fba646c6bc55f5bd Mon Sep 17 00:00:00 2001
 From: Lukasz Marek lukasz.m.lu...@gmail.com
 Date: Mon, 20 Oct 2014 12:12:20 +0200
 Subject: [PATCH] lavd: export all symbols with av_ prefix
 
 LGTM
 
 Pushed.
 
 Should this be backported to ffmpeg 2.2 and 2.3? The four av_ functions 
 declared in avdevice.h
 were never exposed before this.
 
 Only to 2.3 (these symbols are not present in 2.2)
 Michael, could you backport it?

backported to 2.3
in the future please always tell me the git hash of teh commit to
backport, so theres no misunderstandings on what it is

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


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


Re: [FFmpeg-devel] [PATCH] tools/crypto_bench: add CAST5 support

2014-10-21 Thread James Almer
On 21/10/14 8:02 AM, Michael Niedermayer wrote:
 On Sat, Oct 18, 2014 at 06:10:39PM -0300, James Almer wrote:
 Signed-off-by: James Almer jamr...@gmail.com
 ---
  tools/crypto_bench.c | 45 +
  1 file changed, 45 insertions(+)
 
 LGTM

Pushed, thanks.

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


Re: [FFmpeg-devel] Fix bug for POWER LE:libswscale/ppc/swscale_altivec.c

2014-10-21 Thread rongyan
Michael,
Do you have any suggestion on this patch?
Thanks.


Rong Yan
--
The world has enough for everyone's need, but not enough for everyone's greed.


 




-- Original --
From:  michaelni;michae...@gmx.at;
Date:  Fri, Oct 17, 2014 11:26 PM
To:  FFmpeg development discussions and patchesffmpeg-devel@ffmpeg.org; 

Subject:  Re: [FFmpeg-devel] Fix bug for POWER 
LE:libswscale/ppc/swscale_altivec.c



___
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] matroskadec: execute seekheads recursively

2014-10-21 Thread Michael Niedermayer
On Tue, Oct 21, 2014 at 01:34:16AM -0500, Rodger Combs wrote:
 
  On Oct 19, 2014, at 23:34, Rodger Combs rodger.co...@gmail.com wrote:
  
  
  On Oct 17, 2014, at 17:40, Michael Niedermayer michae...@gmx.at 
  mailto:michae...@gmx.at wrote:
  
  On Fri, Oct 17, 2014 at 03:27:49PM +0200, Michael Niedermayer wrote:
  On Fri, Oct 17, 2014 at 01:55:35AM -0500, Rodger Combs wrote:
  
  On Oct 17, 2014, at 01:52, Rodger Combs rodger.co...@gmail.com 
  mailto:rodger.co...@gmail.com wrote:
  
  
  On Oct 17, 2014, at 01:16, Rodger Combs rodger.co...@gmail.com 
  mailto:rodger.co...@gmail.com mailto:rodger.co...@gmail.com 
  mailto:rodger.co...@gmail.com wrote:
  
  This fixes https://trac.ffmpeg.org/ticket/3934 
  https://trac.ffmpeg.org/ticket/3934 
  https://trac.ffmpeg.org/ticket/3934 
  https://trac.ffmpeg.org/ticket/3934, but I'm not sure if there was 
  a good reason for this to be here to begin with. Perhaps a protection 
  against infinite recursion (though I believe EBML_MAX_DEPTH serves 
  that purpose to some degree)?
  0001-matroskadec-execute-seekheads-recursively.patch
  
  Evidently either I or my mail client screwed up and the patch didn't 
  get attached. Whoops.
  0001-matroskadec-execute-seekheads-recursively.patch
  Let's try that again...
  
  Welp, apparently my email client's borked badly in some way. Here's a 
  gist link instead: https://gist.github.com/08f111e72b8b5ddba078 
  https://gist.github.com/08f111e72b8b5ddba078
  
  copy and pasted so our archives dont depend on external links as well
  as for easy revieweing
  
  From 4cf14a9d117da69b64c267e6f982931cfa60a300 Mon Sep 17 00:00:00 2001
  From: Rodger Combs rodger.co...@gmail.com 
  mailto:rodger.co...@gmail.com
  Date: Fri, 17 Oct 2014 00:35:12 -0500
  Subject: [PATCH] matroskadec: execute seekheads recursively
  
  Fixes https://trac.ffmpeg.org/ticket/3934 
  https://trac.ffmpeg.org/ticket/3934
  ---
  libavformat/matroskadec.c | 1 -
  1 file changed, 1 deletion(-)
  
  diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
  index b742319..b437e74 100644
  --- a/libavformat/matroskadec.c
  +++ b/libavformat/matroskadec.c
  @@ -1368,7 +1368,6 @@ static int 
  matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska,
  int ret = 0;
  
  if (idx = seekhead_list-nb_elem||
  -seekhead[idx].id == MATROSKA_ID_SEEKHEAD ||
  seekhead[idx].id == MATROSKA_ID_CLUSTER)
  return 0;
  
  ebml_parse() that gets called as a result of this change does not
  succeed and causes the one and only seekhead entry to return failure
  so i think this doesnt execute seekheads recursively
  
  [...]
  
  -- 
  Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
  
  It is dangerous to be right in matters on which the established authorities
  are wrong. -- Voltaire
  ___
  ffmpeg-devel mailing list
  ffmpeg-devel@ffmpeg.org mailto:ffmpeg-devel@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-devel 
  http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
  Just stepped through this; I also see ebml_parse() failing with the clip I 
  originally uploaded, but not with the original source file, which I've 
  uploaded to Dropbox: 
  https://www.dropbox.com/s/32ve4hp567ukikt/Maken-Ki%21%20-%20S01E02.mkv?dl=0 
  https://www.dropbox.com/s/32ve4hp567ukikt/Maken-Ki%21%20-%20S01E02.mkv?dl=0
  
  
 
 On IRC, the consensus seems to be:
 1. This works as expected
 2. We're not sure if it could lead to an infinite loop if a SeekHead pointed 
 at itself, or at another SeekHead pointing to it; could someone with more 
 experience with matroskadec.c confirm?
 3. matroska_read_seek currently returns 0 and fails to seek if the file has 
 no Cues; it should return -1 and let libavformat fallback on legacy behavior 
 (as it does if it encounters an invalid SeekHead or Cues). This is fixed by 
 this patch:
 
 From acd730174bbbc2f95be1e697ed4fb6bf33c30f05 Mon Sep 17 00:00:00 2001
 From: Rodger Combs rodger.co...@gmail.com
 Date: Tue, 21 Oct 2014 01:33:08 -0500
 Subject: [PATCH] matroskadec: fail matroska_read_seek if no index was parsed
 
 ---
  libavformat/matroskadec.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
 index b742319..a50e9ea 100644
 --- a/libavformat/matroskadec.c
 +++ b/libavformat/matroskadec.c
 @@ -2917,7 +2917,7 @@ static int matroska_read_seek(AVFormatContext *s, int 
 stream_index,
  matroska_parse_cues(matroska);
  }
  
 -if (!st-nb_index_entries)
 +if (!st-nb_index_entries || !matroska-index.nb_elem)
  goto err;
  timestamp = FFMAX(timestamp, st-index_entries[0].timestamp);

posted a different patch to fix this, please review/comment

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates


signature.asc

Re: [FFmpeg-devel] Fix bug for POWER LE:libswscale/ppc/swscale_altivec.c

2014-10-21 Thread Michael Niedermayer
On Wed, Oct 22, 2014 at 09:23:43AM +0800, rongyan wrote:
 Michael,
 Do you have any suggestion on this patch?

yes, please remove the code duplication (this also applies to already
commited code)


instead of

#if X
 code a
 b1(abc)
 code c
#else
 code a
 b2(abc)
 code c
#endif

you can write

#if X
#define B b1
#else
#define B b2
#endif

 code a
 B(abc)
 code c


You can also take a look at our x86 asm, which also generates
code for different cpu feature sets, 32 and 64bit from single
implementations generally without any duplication of code

code duplication makes maintaince harder as bug fixes and updates
need to be done to all copies
code duplication also makes reading the code harder as its not
immedeatly obvious what parts are identical and what differences
there are

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


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