[FFmpeg-cvslog] avformat/movenc: Check packet in mov_write_single_packet() too

2016-09-16 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Sep 15 23:52:54 2016 +0200| [28343139330f557e00293933a4697c7d0fc19c56] | 
committer: Michael Niedermayer

avformat/movenc: Check packet in mov_write_single_packet() too

Fixes assertion failure

Found-by: durandal117
Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=28343139330f557e00293933a4697c7d0fc19c56
---

 libavformat/movenc.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2d8fc48..b704f49 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4971,6 +4971,10 @@ static int mov_write_single_packet(AVFormatContext *s, 
AVPacket *pkt)
 int64_t frag_duration = 0;
 int size = pkt->size;
 
+int ret = check_pkt(s, pkt);
+if (ret < 0)
+return ret;
+
 if (mov->flags & FF_MOV_FLAG_FRAG_DISCONT) {
 int i;
 for (i = 0; i < s->nb_streams; i++)

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


[FFmpeg-cvslog] avformat/movenc: Factor check_pkt() out

2016-09-16 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Sep 15 23:52:42 2016 +0200| [deabcd2c05b2b01689d91394bbf3908da17234ed] | 
committer: Michael Niedermayer

avformat/movenc: Factor check_pkt() out

Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=deabcd2c05b2b01689d91394bbf3908da17234ed
---

 libavformat/movenc.c | 24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 319ff57..2d8fc48 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4662,15 +4662,10 @@ static int mov_auto_flush_fragment(AVFormatContext *s, 
int force)
 return ret;
 }
 
-int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
+static int check_pkt(AVFormatContext *s, AVPacket *pkt)
 {
 MOVMuxContext *mov = s->priv_data;
-AVIOContext *pb = s->pb;
 MOVTrack *trk = &mov->tracks[pkt->stream_index];
-AVCodecParameters *par = trk->par;
-unsigned int samples_in_chunk = 0;
-int size = pkt->size, ret = 0;
-uint8_t *reformatted_data = NULL;
 
 if (trk->entry) {
 int64_t duration = pkt->dts - trk->cluster[trk->entry - 1].dts;
@@ -4694,6 +4689,23 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is 
invalid\n", pkt->duration);
 return AVERROR(EINVAL);
 }
+return 0;
+}
+
+int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
+{
+MOVMuxContext *mov = s->priv_data;
+AVIOContext *pb = s->pb;
+MOVTrack *trk = &mov->tracks[pkt->stream_index];
+AVCodecParameters *par = trk->par;
+unsigned int samples_in_chunk = 0;
+int size = pkt->size, ret = 0;
+uint8_t *reformatted_data = NULL;
+
+ret = check_pkt(s, pkt);
+if (ret < 0)
+return ret;
+
 if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
 int ret;
 if (mov->moov_written || mov->flags & FF_MOV_FLAG_EMPTY_MOOV) {

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


[FFmpeg-cvslog] avformat/movenc: Make the packet check more tolerant

2016-09-16 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Sep 16 01:48:36 2016 +0200| [51000b994514e64a6c5039e179f20c9e24f87c45] | 
committer: Michael Niedermayer

avformat/movenc: Make the packet check more tolerant

Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=51000b994514e64a6c5039e179f20c9e24f87c45
---

 libavformat/movenc.c | 31 ---
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b704f49..aa4a076 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4666,25 +4666,26 @@ static int check_pkt(AVFormatContext *s, AVPacket *pkt)
 {
 MOVMuxContext *mov = s->priv_data;
 MOVTrack *trk = &mov->tracks[pkt->stream_index];
+int64_t ref;
+uint64_t duration;
 
 if (trk->entry) {
-int64_t duration = pkt->dts - trk->cluster[trk->entry - 1].dts;
-if (duration < 0 || duration > INT_MAX) {
-av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" 
/ timestamp: %"PRId64" is out of range for mov/mp4 format\n",
-duration, pkt->dts
-);
-
-pkt->dts = trk->cluster[trk->entry - 1].dts + 1;
-pkt->pts = AV_NOPTS_VALUE;
-}
-} else if (pkt->dts <= INT_MIN || pkt->dts >= INT_MAX) {
-av_log(s, AV_LOG_ERROR, "Application provided initial timestamp: 
%"PRId64" is out of range for mov/mp4 format\n",
-pkt->dts
-);
+ref = trk->cluster[trk->entry - 1].dts;
+} else if (trk->start_dts != AV_NOPTS_VALUE) {
+ref = trk->start_dts + trk->track_duration;
+} else
+ref = pkt->dts; // Skip tests for the first packet
 
-pkt->dts = 0;
-pkt->pts = AV_NOPTS_VALUE;
+duration = pkt->dts - ref;
+if (pkt->dts < ref || duration >= INT_MAX) {
+av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" / 
timestamp: %"PRId64" is out of range for mov/mp4 format\n",
+duration, pkt->dts
+);
+
+pkt->dts = ref + 1;
+pkt->pts = AV_NOPTS_VALUE;
 }
+
 if (pkt->duration < 0 || pkt->duration > INT_MAX) {
 av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is 
invalid\n", pkt->duration);
 return AVERROR(EINVAL);

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


[FFmpeg-cvslog] avfilter/vf_lut2: also export video input bit depth

2016-09-16 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Fri Sep 16 12:35:55 
2016 +0200| [5b509fafb07abe7f344fe33de64fa386289e965e] | committer: Paul B Mahol

avfilter/vf_lut2: also export video input bit depth

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b509fafb07abe7f344fe33de64fa386289e965e
---

 doc/filters.texi  | 6 ++
 libavfilter/vf_lut2.c | 6 ++
 2 files changed, 12 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index ff0ac50..c7a015b 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -9352,6 +9352,12 @@ The first input value for the pixel component.
 
 @item y
 The second input value for the pixel component.
+
+@item bdx
+The first input video bit depth.
+
+@item bdy
+The second input video bit depth.
 @end table
 
 All expressions default to "x".
diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c
index 550edec..85b1053 100644
--- a/libavfilter/vf_lut2.c
+++ b/libavfilter/vf_lut2.c
@@ -35,6 +35,8 @@ static const char *const var_names[] = {
 "h",///< height of the input video
 "x",///< input value for the pixel from input #1
 "y",///< input value for the pixel from input #2
+"bdx",  ///< input #1 video bitdepth
+"bdy",  ///< input #2 video bitdepth
 NULL
 };
 
@@ -43,6 +45,8 @@ enum var_name {
 VAR_H,
 VAR_X,
 VAR_Y,
+VAR_BITDEPTHX,
+VAR_BITDEPTHY,
 VAR_VARS_NB
 };
 
@@ -127,6 +131,7 @@ static int config_inputx(AVFilterLink *inlink)
 s->var_values[VAR_W] = inlink->w;
 s->var_values[VAR_H] = inlink->h;
 s->depthx = desc->comp[0].depth;
+s->var_values[VAR_BITDEPTHX] = s->depthx;
 
 return 0;
 }
@@ -138,6 +143,7 @@ static int config_inputy(AVFilterLink *inlink)
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
 
 s->depthy = desc->comp[0].depth;
+s->var_values[VAR_BITDEPTHY] = s->depthy;
 
 return 0;
 }

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


[FFmpeg-cvslog] swscale: fix for sliced scaling artifacts

2016-09-16 Thread Pedro Arthur
ffmpeg | branch: master | Pedro Arthur  | Thu Sep  8 
15:57:40 2016 -0300| [8433d953e4f13b515b80f7d20c61a44efc6a448f] | committer: 
Pedro Arthur

swscale: fix for sliced scaling artifacts

Signed-off-by: Pedro Arthur 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8433d953e4f13b515b80f7d20c61a44efc6a448f
---

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

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 0874556..c3a8d0e 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -440,7 +440,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
 firstPosY = FFMAX(firstLumSrcY, posY);
 lastPosY = FFMIN(firstLumSrcY + 
hout_slice->plane[0].available_lines - 1, srcSliceY + srcSliceH - 1);
 } else {
-firstPosY = lastInLumBuf + 1;
+firstPosY = posY;
 lastPosY = lastLumSrcY;
 }
 
@@ -449,7 +449,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
 firstCPosY = FFMAX(firstChrSrcY, cPosY);
 lastCPosY = FFMIN(firstChrSrcY + 
hout_slice->plane[1].available_lines - 1, AV_CEIL_RSHIFT(srcSliceY + srcSliceH, 
c->chrSrcVSubSample) - 1);
 } else {
-firstCPosY = lastInChrBuf + 1;
+firstCPosY = cPosY;
 lastCPosY = lastChrSrcY;
 }
 

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


[FFmpeg-cvslog] doc/muxers: add flv muxer document into doc/muxers

2016-09-16 Thread Steven Liu
ffmpeg | branch: master | Steven Liu  | Fri Sep 16 
08:58:33 2016 +0800| [3ea28f3f79edaf80b2ef8eb4ae1977ae883af872] | committer: 
Lou Logan

doc/muxers: add flv muxer document into doc/muxers

add flvflags aac_seq_header_detect and flvflags no_sequence_end
document into doc/muxers

Reviewed-by: Lou Logan 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ea28f3f79edaf80b2ef8eb4ae1977ae883af872
---

 doc/muxers.texi | 21 +
 1 file changed, 21 insertions(+)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index ccf8ea1..27eb9a0 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -129,6 +129,27 @@ and the input video converted to MPEG-2 video, use the 
command:
 ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
 @end example
 
+@section flv
+
+Adobe Flash Video Format muxer.
+
+This muxer accepts the following options:
+
+@table @option
+
+@item flvflags @var{flags}
+Possible values:
+
+@table @samp
+
+@item aac_seq_header_detect
+Place AAC sequence header based on audio stream data.
+
+@item no_sequence_end
+Disable sequence end tag.
+@end table
+@end table
+
 @anchor{framecrc}
 @section framecrc
 

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