[FFmpeg-cvslog] Merge commit '9108967513fcaff3d55514a7bca4c9fbba128c71'

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Jan 23 
12:26:23 2015 +0100| [0982077be563cb9ea1f905b1182b6f0d1783ae12] | committer: 
Michael Niedermayer

Merge commit '9108967513fcaff3d55514a7bca4c9fbba128c71'

* commit '9108967513fcaff3d55514a7bca4c9fbba128c71':
  rtspdec: Consistently use rtsp_hd_out for writing

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] rtspdec: Consistently use rtsp_hd_out for writing

2015-01-23 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Wed Jan 21 
14:23:50 2015 +0100| [9108967513fcaff3d55514a7bca4c9fbba128c71] | committer: 
Martin Storsjö

rtspdec: Consistently use rtsp_hd_out for writing

Signed-off-by: Martin Storsjö 

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

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

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 1f90590..418f383 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -114,7 +114,7 @@ static int rtsp_send_reply(AVFormatContext *s, enum 
RTSPStatusCode code,
 av_strlcat(message, extracontent, sizeof(message));
 av_strlcat(message, "\r\n", sizeof(message));
 av_dlog(s, "Sending response:\n%s", message);
-ffurl_write(rt->rtsp_hd, message, strlen(message));
+ffurl_write(rt->rtsp_hd_out, message, strlen(message));
 
 return 0;
 }

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


[FFmpeg-cvslog] libavformat/mov.c: Handle timecode from tmcd atom in counter mode

2015-01-23 Thread Jon Morley
ffmpeg | branch: master | Jon Morley  | Thu Jan 22 
23:04:24 2015 -0800| [47372caac507c4c4fbef57e32233a3a5e1823f68] | committer: 
Michael Niedermayer

libavformat/mov.c: Handle timecode from tmcd atom in counter mode

When the timecode value is in counter mode then it is important to use
the timescale and frameduration to calculate the timecode fps.

Signed-off-by: Michael Niedermayer 

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

 libavformat/mov.c |7 +++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6851947..ee45aa5 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1658,6 +1658,13 @@ static int mov_parse_stsd_data(MOVContext *c, 
AVIOContext *pb,
 st->codec->flags2 |= CODEC_FLAG2_DROP_FRAME_TIMECODE;
 st->codec->time_base.den = st->codec->extradata[16]; /* number of 
frame */
 st->codec->time_base.num = 1;
+/* adjust for per frame dur in counter mode */
+if (tmcd_ctx->tmcd_flags & 0x0008) {
+int timescale = AV_RB32(st->codec->extradata + 8);
+int framedur = AV_RB32(st->codec->extradata + 12);
+st->codec->time_base.den *= timescale;
+st->codec->time_base.num *= framedur;
+}
 if (size > 30) {
 uint32_t len = AV_RB32(st->codec->extradata + 18); /* name 
atom length */
 uint32_t format = AV_RB32(st->codec->extradata + 22);

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


[FFmpeg-cvslog] avfilter/af_channelmap: Check for missing argument in get_channel_idx()

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Jan 23 
15:03:40 2015 +0100| [579795b2049bc8b0f291b302e7ab24f9561eaf24] | committer: 
Michael Niedermayer

avfilter/af_channelmap: Check for missing argument in get_channel_idx()

Fixes null pointer dereference

Signed-off-by: Michael Niedermayer 

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

 libavfilter/af_channelmap.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index c3454c5..2a43c12 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -93,6 +93,8 @@ static int get_channel_idx(char **map, int *ch, char delim, 
int max_ch)
 int n = 0;
 if (!next && delim == '-')
 return AVERROR(EINVAL);
+if (!*map)
+return AVERROR(EINVAL);
 len = strlen(*map);
 sscanf(*map, "%d%n", ch, &n);
 if (n != len)

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


[FFmpeg-cvslog] doc/APIchanges: fill in more missing hash values and dates

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Jan 23 
15:09:21 2015 +0100| [8c8ee17e8d2800144116ec52f26a435a06b49420] | committer: 
Michael Niedermayer

doc/APIchanges: fill in more missing hash values and dates

all values before 2.5 seem to be filled in now

Signed-off-by: Michael Niedermayer 

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

 doc/APIchanges |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index f92..06fcd74 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -252,7 +252,7 @@ API changes, most recent first:
   Add av_stream_get_side_data() to access stream-level side data
   in the same way as av_packet_get_side_data().
 
-2014-05-xx - 7336e39 - lavu 52.86.100 - fifo.h
+2014-05-20 - 7336e39 - lavu 52.86.100 - fifo.h
   Add av_fifo_alloc_array() function.
 
 2014-05-19 - ef1d4ee / bddd8cb - lavu 52.85.100 / 53.15.0 - frame.h, display.h
@@ -405,7 +405,7 @@ API changes, most recent first:
 2014-02-19 - f4c8d00 / 6bb8720 - lavu 52.64.101 / 53.3.1 - opt.h
   Deprecate unused AV_OPT_FLAG_METADATA.
 
-2014-02-xx - xxx - lavd 55.10.100 - avdevice.h
+2014-02-16 - 81c3f81 - lavd 55.10.100 - avdevice.h
   Add avdevice_list_devices() and avdevice_free_list_devices()
 
 2014-02-16 - db3c970 - lavf 55.33.100 - avio.h
@@ -446,7 +446,7 @@ API changes, most recent first:
 2014-01-19 - 1a193c4 - lavf 55.25.100 - avformat.h
   Add avformat_get_mov_video_tags() and avformat_get_mov_audio_tags().
 
-2014-01-19 - xxx - lavu 52.63.100 - rational.h
+2014-01-19 - 3532dd5 - lavu 52.63.100 - rational.h
   Add av_make_q() function.
 
 2014-01-05 - 4cf4da9 / 5b4797a - lavu 52.62.100 / 53.2.0 - frame.h

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


[FFmpeg-cvslog] [ffmpeg-web] branch master updated. 8627023 web/download: remove insecure git:// URLs where https:// are already available

2015-01-23 Thread gitolite
The branch, master has been updated
   via  862702319c6015dcd1e13472b934b10d49afae63 (commit)
  from  2596f5ea7990dafcbfcff4f8ffcb56f319af02e3 (commit)


- Log -
commit 862702319c6015dcd1e13472b934b10d49afae63
Author: Michael Niedermayer 
AuthorDate: Fri Jan 23 17:06:32 2015 +0100
Commit: Michael Niedermayer 
CommitDate: Fri Jan 23 17:09:10 2015 +0100

web/download: remove insecure git:// URLs where https:// are already 
available

diff --git a/src/download b/src/download
index 20c42f8..b82c2c2 100644
--- a/src/download
+++ b/src/download
@@ -216,8 +216,7 @@
 
   
 
-  https://github.com/FFmpeg/FFmpeg";>https://github.com/FFmpeg/FFmpeg
-  git://github.com/FFmpeg/FFmpeg.git
+  https://github.com/FFmpeg/FFmpeg";>https://github.com/FFmpeg/FFmpeg
 
 
   https://github.com/FFmpeg/FFmpeg";>Browse
@@ -229,8 +228,7 @@
 
   
 
-  https://github.com/FFmpeg/web";>https://github.com/FFmpeg/web
-  git://github.com/FFmpeg/web.git
+  https://github.com/FFmpeg/web";>https://github.com/FFmpeg/web
 
 
   https://github.com/FFmpeg/web";>Browse
@@ -242,8 +240,7 @@
 
   
 
-  https://github.com/FFmpeg/fateserver";>https://github.com/FFmpeg/fateserver
-  git://github.com/FFmpeg/fateserver.git
+  https://github.com/FFmpeg/fateserver";>https://github.com/FFmpeg/fateserver
 
 
   https://github.com/FFmpeg/fateserver";>Browse

---

Summary of changes:
 src/download |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)


hooks/post-receive
-- 

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


[FFmpeg-cvslog] [ffmpeg-web] branch master updated. b19285a web/download: Remove main snapshot url

2015-01-23 Thread gitolite
The branch, master has been updated
   via  b19285ae0a04cdf5d771f0a143861aca12402886 (commit)
  from  862702319c6015dcd1e13472b934b10d49afae63 (commit)


- Log -
commit b19285ae0a04cdf5d771f0a143861aca12402886
Author: Michael Niedermayer 
AuthorDate: Fri Jan 23 03:27:07 2015 +0100
Commit: Michael Niedermayer 
CommitDate: Fri Jan 23 17:18:03 2015 +0100

web/download: Remove main snapshot url

The url did just end at a "403 - Snapshots not allowed"

Suggested-by: ubitux

diff --git a/src/download b/src/download
index b82c2c2..d9babe2 100644
--- a/src/download
+++ b/src/download
@@ -197,7 +197,6 @@
 git://source.ffmpeg.org/ffmpeg.git
 
   http://git.videolan.org/?p=ffmpeg.git";>Browse
-  http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=HEAD;sf=tgz";>Snapshot
 
   
   Main FFmpeg Git repository

---

Summary of changes:
 src/download |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


hooks/post-receive
-- 

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


[FFmpeg-cvslog] avformat/librtmp: Fix build with --disable-network --enable-librtmp

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Jan 23 
17:45:35 2015 +0100| [d36e66bb2622d15e53d0a02a4685a8345cf93d7d] | committer: 
Michael Niedermayer

avformat/librtmp: Fix build with --disable-network --enable-librtmp

Found-by: Carl Eugen Hoyos 
Signed-off-by: Michael Niedermayer 

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

 libavformat/librtmp.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index 40073f3..bfa9a71 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -28,7 +28,9 @@
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "avformat.h"
+#if CONFIG_NETWORK
 #include "network.h"
+#endif
 #include "url.h"
 
 #include 
@@ -232,10 +234,12 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)
 goto fail;
 }
 
+#if CONFIG_NETWORK
 if (ctx->buffer_size >= 0 && (flags & AVIO_FLAG_WRITE)) {
 int tmp = ctx->buffer_size;
 setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_SNDBUF, &tmp, 
sizeof(tmp));
 }
+#endif
 
 s->is_streamed = 1;
 return 0;
@@ -318,7 +322,9 @@ static const AVOption options[] = {
 {"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", 
OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
 {"rtmp_swfverify", "URL to player swf file, compute hash/size 
automatically. (unimplemented)", OFFSET(swfverify), AV_OPT_TYPE_STRING, {.str = 
NULL }, 0, 0, DEC},
 {"rtmp_tcurl", "URL of the target stream. Defaults to 
proto://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 
0, 0, DEC|ENC},
+#if CONFIG_NETWORK
 {"rtmp_buffer_size", "set buffer size in bytes", OFFSET(buffer_size), 
AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, DEC|ENC },
+#endif
 { NULL },
 };
 

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


Re: [FFmpeg-cvslog] librtmp: Allow changing the socket send buffer size

2015-01-23 Thread Michael Niedermayer
On Fri, Jan 23, 2015 at 04:46:34AM +, Carl Eugen Hoyos wrote:
> Brian Brice  videolan.org> writes:
> 
> > ffmpeg | branch: master | Brian Brice | Mon Jan 19 21:01:00 2015 -0600|
> > [f845ae0c8ed8c6761a5372954aff5f82b1c87cbf] | committer: Michael Niedermayer
> > 
> > librtmp: Allow changing the socket send buffer size
> 
> This broke compilation with --disable-network --enable-librtmp

Fixed

Thanks

PS: i think you should CC the author on replies on cvslog unless you
know he is subscribed

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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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


[FFmpeg-cvslog] Merge commit '2a06c2a03e1205aaeede5af850b9271752ddd4cf'

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Jan 23 
21:59:18 2015 +0100| [e40cdf8604f14feaa41323ae8fdfdf187a257d55] | committer: 
Michael Niedermayer

Merge commit '2a06c2a03e1205aaeede5af850b9271752ddd4cf'

* commit '2a06c2a03e1205aaeede5af850b9271752ddd4cf':
  mpegvideo_enc: Draw edges on input for non-multiple of 16 resolutions

Conflicts:
libavcodec/mpegvideo_enc.c

See: 1e78679768b3a1ef336c5b52aa5027d8a50fcf0d
Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] avformat/dv: check av_malloc() return code

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Jan 23 
18:15:43 2015 +0100| [72d99c8c2647c77e01dfc82a354d500d48258469] | committer: 
Michael Niedermayer

avformat/dv: check av_malloc() return code

Signed-off-by: Michael Niedermayer 

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

 libavformat/dv.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index 0a893f4..3243ca2 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -472,6 +472,9 @@ static int dv_read_timecode(AVFormatContext *s) {
 partial_frame_size);
 
 RawDVContext *c = s->priv_data;
+if (!partial_frame)
+return AVERROR(ENOMEM);
+
 ret = avio_read(s->pb, partial_frame, partial_frame_size);
 if (ret < 0)
 goto finish;

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


[FFmpeg-cvslog] mpegvideo_enc: Draw edges on input for non-multiple of 16 resolutions

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Feb 16 
10:44:38 2013 +0100| [2a06c2a03e1205aaeede5af850b9271752ddd4cf] | committer: 
Martin Storsjö

mpegvideo_enc: Draw edges on input for non-multiple of 16 resolutions

This improves motion estimation and avoids using uninitialized data
for resolutions that aren't a multiple of 16.

Prior to d2a25c40, the edges used to be initialized so that encoding
was deterministic, but after that commit it started using uninitialized
data (for non multiple of 16 resolutions).

CC: libav-sta...@libav.org
Signed-off-by: Martin Storsjö 

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

 libavcodec/mpegvideo_enc.c |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 535978d..be6fb08 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -990,6 +990,8 @@ static int load_input_picture(MpegEncContext *s, const 
AVFrame *pic_arg)
 pic_arg->linesize[1] != s->uvlinesize ||
 pic_arg->linesize[2] != s->uvlinesize)
 direct = 0;
+if ((s->width & 15) || (s->height & 15))
+direct = 0;
 
 av_dlog(s->avctx, "%d %d %td %td\n", pic_arg->linesize[0],
 pic_arg->linesize[1], s->linesize, s->uvlinesize);
@@ -1038,12 +1040,21 @@ static int load_input_picture(MpegEncContext *s, const 
AVFrame *pic_arg)
 if (src_stride == dst_stride)
 memcpy(dst, src, src_stride * h);
 else {
-while (h--) {
-memcpy(dst, src, w);
-dst += dst_stride;
+int h2 = h;
+uint8_t *dst2 = dst;
+while (h2--) {
+memcpy(dst2, src, w);
+dst2 += dst_stride;
 src += src_stride;
 }
 }
+if ((s->width & 15) || (s->height & 15)) {
+s->mpvencdsp.draw_edges(dst, dst_stride,
+w, h,
+16 >> h_shift,
+16 >> v_shift,
+EDGE_BOTTOM);
+}
 }
 }
 }

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


[FFmpeg-cvslog] Merge commit '4c5fa628da099dbb598c93bc4555b8733d2c3035'

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Jan 23 
22:19:21 2015 +0100| [da304c529b65058c0a001b3bbb18e83539a28d71] | committer: 
Michael Niedermayer

Merge commit '4c5fa628da099dbb598c93bc4555b8733d2c3035'

* commit '4c5fa628da099dbb598c93bc4555b8733d2c3035':
  mov: Do not compute negative SAR values

Conflicts:
libavformat/mov.c

See: e32b07aea4981719a3e6ce92491349c9547958e1
Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] mov: Do not compute negative SAR values

2015-01-23 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Thu 
Jan 22 19:10:27 2015 +| [4c5fa628da099dbb598c93bc4555b8733d2c3035] | 
committer: Vittorio Giovara

mov: Do not compute negative SAR values

This partially reverts cf70ba37ba74089a18295b29e77dead0a3222c9e, since
it didn't take into account when rotation is 0, but there is another
valid operation (eg. translation) in the matrix.

Found-by: Michael Niedermayer 

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

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 86b2de0..75bd5e9 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -35,7 +35,6 @@
 #include "libavutil/time_internal.h"
 #include "libavutil/avstring.h"
 #include "libavutil/dict.h"
-#include "libavutil/display.h"
 #include "libavutil/opt.h"
 #include "libavcodec/ac3tab.h"
 #include "avformat.h"
@@ -2579,10 +2578,9 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 }
 
 // transform the display width/height according to the matrix
-// skip this if the rotation angle is 0 degrees
+// skip this when the display matrix is the identity one
 // to keep the same scale, use [width height 1<<16]
-if (width && height && sc->display_matrix &&
-av_display_rotation_get(sc->display_matrix) != 0.0f) {
+if (width && height && sc->display_matrix) {
 for (i = 0; i < 2; i++)
 disp_transform[i] =
 (int64_t)  width  * display_matrix[0][i] +
@@ -2590,9 +2588,10 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 ((int64_t) display_matrix[2][i] << 16);
 
 //sample aspect ratio is new width/height divided by old width/height
-st->sample_aspect_ratio = av_d2q(
-((double) disp_transform[0] * height) /
-((double) disp_transform[1] * width), INT_MAX);
+if (disp_transform[0] > 0 && disp_transform[1] > 0)
+st->sample_aspect_ratio = av_d2q(
+((double) disp_transform[0] * height) /
+((double) disp_transform[1] * width), INT_MAX);
 }
 return 0;
 }

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


[FFmpeg-cvslog] Merge commit '7915e6741dbe1cf3a8781cead3e68a7666de14f4'

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Jan 23 
22:27:42 2015 +0100| [0c00e734ef2b1cac83cf71f331bdb0f6e504de23] | committer: 
Michael Niedermayer

Merge commit '7915e6741dbe1cf3a8781cead3e68a7666de14f4'

* commit '7915e6741dbe1cf3a8781cead3e68a7666de14f4':
  hlsproto: Properly close avio buffer in case of error

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] hlsproto: Properly close avio buffer in case of error

2015-01-23 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Thu 
Jan 22 20:13:44 2015 +| [7915e6741dbe1cf3a8781cead3e68a7666de14f4] | 
committer: Vittorio Giovara

hlsproto: Properly close avio buffer in case of error

Fix a memory leak.

CC: libav-sta...@libav.org
Bug-Id: CID 717999

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

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

diff --git a/libavformat/hlsproto.c b/libavformat/hlsproto.c
index 751fef2..0eba049 100644
--- a/libavformat/hlsproto.c
+++ b/libavformat/hlsproto.c
@@ -121,8 +121,10 @@ static int parse_playlist(URLContext *h, const char *url)
 return ret;
 
 read_chomp_line(in, line, sizeof(line));
-if (strcmp(line, "#EXTM3U"))
-return AVERROR_INVALIDDATA;
+if (strcmp(line, "#EXTM3U")) {
+ret = AVERROR_INVALIDDATA;
+goto fail;
+}
 
 free_segment_list(s);
 s->finished = 0;

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


[FFmpeg-cvslog] Merge commit '3a6dfec864d569c2d0a875e1a7466f51b00edb63'

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Jan 23 
22:53:25 2015 +0100| [a915b1daee3ba99306d79100d5e973549b48a891] | committer: 
Michael Niedermayer

Merge commit '3a6dfec864d569c2d0a875e1a7466f51b00edb63'

* commit '3a6dfec864d569c2d0a875e1a7466f51b00edb63':
  segment: Check av_get_frame_filename() return value

Conflicts:
libavformat/segment.c

No changes as there was no unchecked av_get_frame_filename() in segment.c

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] segment: Check av_get_frame_filename() return value

2015-01-23 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Thu 
Jan 22 20:13:45 2015 +| [3a6dfec864d569c2d0a875e1a7466f51b00edb63] | 
committer: Vittorio Giovara

segment: Check av_get_frame_filename() return value

CC: libav-sta...@libav.org
Bug-Id: CID 1265713

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

 libavformat/segment.c |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index bcfd1f9..824bbf7 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -105,7 +105,11 @@ static int segment_hls_window(AVFormatContext *s, int last)
 if (seg->entry_prefix) {
 avio_printf(seg->pb, "%s", seg->entry_prefix);
 }
-av_get_frame_filename(buf, sizeof(buf), s->filename, i);
+ret = av_get_frame_filename(buf, sizeof(buf), s->filename, i);
+if (ret < 0) {
+ret = AVERROR(EINVAL);
+goto fail;
+}
 avio_printf(seg->pb, "%s\n", buf);
 }
 

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


[FFmpeg-cvslog] dshow: add options for allowing filter popup configuration dialogs to be presented to the user

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:49:37 2015 -0700| [5d72cf0f64162aa130b4720f71e9249a6a34f08a] | committer: 
rogerdpack

dshow: add options for allowing filter popup configuration dialogs to be 
presented to the user

Signed-off-by: rogerdpack 

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

 configure|2 +-
 doc/indevs.texi  |   26 ++
 libavdevice/dshow.c  |   62 +-
 libavdevice/dshow_capture.h  |1 +
 libavdevice/dshow_crossbar.c |7 +
 5 files changed, 96 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index a0dbafb..0b6be39 100755
--- a/configure
+++ b/configure
@@ -2487,7 +2487,7 @@ decklink_outdev_extralibs="-lstdc++"
 decklink_indev_deps="decklink pthreads"
 decklink_indev_extralibs="-lstdc++"
 dshow_indev_deps="IBaseFilter"
-dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
+dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32"
 dv1394_indev_deps="dv1394"
 dv1394_indev_select="dv_demuxer"
 fbdev_indev_deps="linux_fb_h"
diff --git a/doc/indevs.texi b/doc/indevs.texi
index ec40c34..a9792fd 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -234,6 +234,25 @@ routed to the crossbar device's Video Decoder output pin.
 Select audio input pin number for crossbar device. This will be
 routed to the crossbar device's Audio Decoder output pin.
 
+@item show_video_device_dialog
+If set to @option{true}, before capture starts, popup a display dialog
+to the end user, allowing them to change video filter properties
+and configurations manually.
+Note that for crossbar devices, this may be needed at times to toggle
+between PAL and NTSC input frame rates and sizes, etc.  Possibly 
+enabling different scan rates/frame rates and avoiding green bars at
+the bottom, etc.
+
+@item show_audio_device_dialog
+If set to @option{true}, before capture starts, popup a display dialog
+to the end user, allowing them to change audio filter properties
+and configurations manually.
+
+@item show_crossbar_connection_dialog
+If set to @option{true}, before capture starts, popup a display
+dialog to the end user, allowing them to manually
+modify crossbar pin routings.
+
 @end table
 
 @subsection Examples
@@ -276,6 +295,13 @@ Specify pin names to capture by name or alternative name, 
specify alternative de
 $ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i 
video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
 @end example
 
+@item
+Configure a crossbar device, specifying crossbar pins, allow user to adjust 
video capture properties at startup:
+@example
+$ ffmpeg -f dshow -show_video_device_dialog true 
-crossbar_video_input_pin_number 0
+ -crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog 
Capture":audio="AVerMedia BDA Analog Capture"
+@end example
+
 @end itemize
 
 @section dv1394
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 6349377..691250f 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -503,6 +503,53 @@ end:
 }
 
 /**
+ * Pops up a user dialog allowing them to adjust properties for the given 
filter, if possible.
+ */
+void
+dshow_show_filter_properties(IBaseFilter *device_filter, AVFormatContext 
*avctx) {
+ISpecifyPropertyPages *property_pages = NULL;
+IUnknown *device_filter_iunknown = NULL;
+HRESULT hr;
+FILTER_INFO filter_info = {0}; /* a warning on this line is false positive 
GCC bug 53119 */
+CAUUID ca_guid = {0};
+
+hr  = IBaseFilter_QueryInterface(device_filter, 
&IID_ISpecifyPropertyPages, (void **)&property_pages);
+if (hr != S_OK) {
+av_log(avctx, AV_LOG_WARNING, "requested filter does not have a 
property page to show");
+goto end;
+}
+hr = IBaseFilter_QueryFilterInfo(device_filter, &filter_info);
+if (hr != S_OK) {
+goto fail;
+}
+hr = IBaseFilter_QueryInterface(device_filter, &IID_IUnknown, (void 
**)&device_filter_iunknown);
+if (hr != S_OK) {
+goto fail;
+}
+hr = ISpecifyPropertyPages_GetPages(property_pages, &ca_guid);
+if (hr != S_OK) {
+goto fail;
+}
+hr = OleCreatePropertyFrame(NULL, 0, 0, filter_info.achName, 1, 
&device_filter_iunknown, ca_guid.cElems,
+ca_guid.pElems, 0, 0, NULL);
+if (hr != S_OK) {
+goto fail;
+}
+goto end;
+fail:
+av_log(avctx, AV_LOG_ERROR, "Failure showing property pages for filter");
+end:
+if (property_pages)
+ISpecifyPropertyPages_Release(property_pages);
+if (device_filter_iunknown)
+IUnknown_Release(device_filter_iunknown);
+if (filter_info.pGraph)
+IFilterGraph_Release(filter_info.pGraph);
+if (ca_guid.pElems)
+CoTaskMemFree(ca_guid.pElems);
+}
+
+/**
  * Cy

[FFmpeg-cvslog] Merge remote-tracking branch 'rdp/dshow_crossbar'

2015-01-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Jan 23 
23:44:57 2015 +0100| [76241c911510ae3eaccf92a21e95b82579dc1ec5] | committer: 
Michael Niedermayer

Merge remote-tracking branch 'rdp/dshow_crossbar'

* rdp/dshow_crossbar:
  dshow: fix docu escapes
  dshow: some devices only list themselves under "Video sources" but actually 
have both video and audio output pins, so make the audio pins accessible by 
video source name.
  dshow: add options for allowing filter popup configuration dialogs to be 
presented to the user
  dshow: introduce support for crossbar [multiple input selectable] devices
  dshow: drop initial audio packets with weird timestamps
  dshow: use non deprecated api
  dshow: miscellaneous tweaks
  dshow: allow selecting devices by an alternative name (workaround for devices 
with symbols in them), allow specifying capture pins by name and alternative 
(unique) name

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] dshow: introduce support for crossbar [multiple input selectable] devices

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:35:16 2015 -0700| [ec81ad21c1f8124dcde08c1e64656331d4c3d9e6] | committer: 
rogerdpack

dshow: introduce support for crossbar [multiple input selectable] devices

Signed-off-by: rogerdpack 

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

 doc/indevs.texi  |8 +++
 libavdevice/Makefile |2 +-
 libavdevice/dshow.c  |   97 -
 libavdevice/dshow_capture.h  |   61 
 libavdevice/dshow_crossbar.c |  164 ++
 5 files changed, 278 insertions(+), 54 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 00820af..ec40c34 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -226,6 +226,14 @@ Select video capture pin to use by name or alternative 
name.
 @item audio_pin_name
 Select audio capture pin to use by name or alternative name.
 
+@item crossbar_video_input_pin_number
+Select video input pin number for crossbar device. This will be
+routed to the crossbar device's Video Decoder output pin.
+
+@item crossbar_audio_input_pin_number
+Select audio input pin number for crossbar device. This will be
+routed to the crossbar device's Audio Decoder output pin.
+
 @end table
 
 @subsection Examples
diff --git a/libavdevice/Makefile b/libavdevice/Makefile
index 872504b..696cc88 100644
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@ -19,7 +19,7 @@ OBJS-$(CONFIG_BKTR_INDEV)+= bktr.o
 OBJS-$(CONFIG_CACA_OUTDEV)   += caca.o
 OBJS-$(CONFIG_DECKLINK_OUTDEV)   += decklink_enc.o decklink_enc_c.o 
decklink_common.o
 OBJS-$(CONFIG_DECKLINK_INDEV)+= decklink_dec.o decklink_dec_c.o 
decklink_common.o
-OBJS-$(CONFIG_DSHOW_INDEV)   += dshow.o dshow_enummediatypes.o \
+OBJS-$(CONFIG_DSHOW_INDEV)   += dshow_crossbar.o dshow.o 
dshow_enummediatypes.o \
 dshow_enumpins.o dshow_filter.o \
 dshow_pin.o dshow_common.o
 OBJS-$(CONFIG_DV1394_INDEV)  += dv1394.o
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 0a5788d..6349377 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -28,51 +28,6 @@
 #include "avdevice.h"
 #include "libavcodec/raw.h"
 
-struct dshow_ctx {
-const AVClass *class;
-
-IGraphBuilder *graph;
-
-char *device_name[2];
-int video_device_number;
-int audio_device_number;
-
-int   list_options;
-int   list_devices;
-int   audio_buffer_size;
-char *video_pin_name;
-char *audio_pin_name;
-
-IBaseFilter *device_filter[2];
-IPin*device_pin[2];
-libAVFilter *capture_filter[2];
-libAVPin*capture_pin[2];
-
-HANDLE mutex;
-HANDLE event[2]; /* event[0] is set by DirectShow
-  * event[1] is set by callback() */
-AVPacketList *pktl;
-
-int eof;
-
-int64_t curbufsize[2];
-unsigned int video_frame_num;
-
-IMediaControl *control;
-IMediaEvent *media_event;
-
-enum AVPixelFormat pixel_format;
-enum AVCodecID video_codec_id;
-char *framerate;
-
-int requested_width;
-int requested_height;
-AVRational requested_framerate;
-
-int sample_rate;
-int sample_size;
-int channels;
-};
 
 static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount)
 {
@@ -710,8 +665,7 @@ dshow_list_device_options(AVFormatContext *avctx, 
ICreateDevEnum *devenum,
 }
 
 static int
-dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum,
-  enum dshowDeviceType devtype)
+dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, enum 
dshowDeviceType devtype)
 {
 struct dshow_ctx *ctx = avctx->priv_data;
 IBaseFilter *device_filter = NULL;
@@ -719,6 +673,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 IPin *device_pin = NULL;
 libAVPin *capture_pin = NULL;
 libAVFilter *capture_filter = NULL;
+ICaptureGraphBuilder2 *graph_builder2 = NULL;
 int ret = AVERROR(EIO);
 int r;
 
@@ -741,6 +696,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 ret = r;
 goto error;
 }
+
 ctx->device_pin[devtype] = device_pin;
 
 capture_filter = libAVFilter_Create(avctx, callback, devtype);
@@ -761,15 +717,39 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 capture_pin = capture_filter->pin;
 ctx->capture_pin[devtype] = capture_pin;
 
-r = IGraphBuilder_ConnectDirect(graph, device_pin, (IPin *) capture_pin, 
NULL);
+r = CoCreateInstance(&CLSID_CaptureGraphBuilder2, NULL, 
CLSCTX_INPROC_SERVER,
+ &IID_ICaptureGraphBuilder2, (void **) 
&graph_builder2);
+if (r != S_OK) {
+av_log(avctx, AV_LOG_ERROR, "Could not create CaptureGraphBuilder2\n");
+goto error;
+}
+ICaptu

[FFmpeg-cvslog] dshow: miscellaneous tweaks

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:01:32 2015 -0700| [e620eee88c4fdd43eb45001e4ec073110aea78d8] | committer: 
rogerdpack

dshow: miscellaneous tweaks

Signed-off-by: rogerdpack 

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

 libavdevice/dshow.c |   13 -
 libavdevice/dshow_capture.h |2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 0497e09..4883b33 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -188,10 +188,12 @@ static int shall_we_drop(AVFormatContext *s, int index, 
enum dshowDeviceType dev
 static const uint8_t dropscore[] = {62, 75, 87, 100};
 const int ndropscores = FF_ARRAY_ELEMS(dropscore);
 unsigned int buffer_fullness = 
(ctx->curbufsize[index]*100)/s->max_picture_buffer;
+const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
 
 if(dropscore[++ctx->video_frame_num%ndropscores] <= buffer_fullness) {
 av_log(s, AV_LOG_ERROR,
-  "real-time buffer[%s] too full (%d%% of size: %d)! frame 
dropped!\n", ctx->device_name[devtype], buffer_fullness, s->max_picture_buffer);
+  "real-time buffer [%s] [%s input] too full or near too full 
(%d%% of size: %d [rtbufsize parameter])! frame dropped!\n",
+  ctx->device_name[devtype], devtypename, buffer_fullness, 
s->max_picture_buffer);
 return 1;
 }
 
@@ -366,7 +368,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum 
dshowDeviceType devtype,
 AM_MEDIA_TYPE *type = NULL;
 int format_set = 0;
 void *caps = NULL;
-int i, n, size;
+int i, n, size, r;
 
 if (IPin_QueryInterface(pin, &IID_IAMStreamConfig, (void **) &config) != 
S_OK)
 return;
@@ -378,8 +380,9 @@ dshow_cycle_formats(AVFormatContext *avctx, enum 
dshowDeviceType devtype,
 goto end;
 
 for (i = 0; i < n && !format_set; i++) {
-IAMStreamConfig_GetStreamCaps(config, i, &type, (void *) caps);
-
+r = IAMStreamConfig_GetStreamCaps(config, i, &type, (void *) caps);
+if (r != S_OK)
+goto next;
 #if DSHOWDEBUG
 ff_print_AM_MEDIA_TYPE(type);
 #endif
@@ -643,6 +646,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum 
dshowDeviceType devtype,
 goto next;
 
 IEnumMediaTypes_Reset(types);
+/* in case format_set was not called, just verify the majortype */
 while (!device_pin && IEnumMediaTypes_Next(types, 1, &type, NULL) == 
S_OK) {
 if (IsEqualGUID(&type->majortype, mediatype[devtype])) {
 device_pin = pin;
@@ -663,7 +667,6 @@ next:
 av_free(pin_buf);
 if (pin_id)
 CoTaskMemFree(pin_id);
-
 }
 
 IEnumPins_Release(pins);
diff --git a/libavdevice/dshow_capture.h b/libavdevice/dshow_capture.h
index 0252070..09e9b1b 100644
--- a/libavdevice/dshow_capture.h
+++ b/libavdevice/dshow_capture.h
@@ -223,7 +223,7 @@ libAVEnumPins   *libAVEnumPins_Create (libAVPin *pin, 
libAVFilter *filter);
  * libAVEnumMediaTypes
  /
 struct libAVEnumMediaTypes {
-IEnumPinsVtbl *vtbl;
+IEnumMediaTypesVtbl *vtbl;
 long ref;
 int pos;
 AM_MEDIA_TYPE type;

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


[FFmpeg-cvslog] dshow: use non deprecated api

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:07:24 2015 -0700| [8eb5b5ec6f582cac25195682680907c9ac52374a] | committer: 
rogerdpack

dshow: use non deprecated api

Signed-off-by: rogerdpack 

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

 libavdevice/dshow.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 4883b33..0a5788d 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -162,7 +162,7 @@ dshow_read_close(AVFormatContext *s)
 pktl = ctx->pktl;
 while (pktl) {
 AVPacketList *next = pktl->next;
-av_destruct_packet(&pktl->pkt);
+av_free_packet(&pktl->pkt);
 av_free(pktl);
 pktl = next;
 }

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


[FFmpeg-cvslog] dshow: drop initial audio packets with weird timestamps

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:13:33 2015 -0700| [b76a0e24f9effa64e48ff0567af0dc497dd99e84] | committer: 
rogerdpack

dshow: drop initial audio packets with weird timestamps

Signed-off-by: rogerdpack 

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

 libavdevice/dshow_pin.c |8 
 1 file changed, 8 insertions(+)

diff --git a/libavdevice/dshow_pin.c b/libavdevice/dshow_pin.c
index 1c0dca2..5904c28 100644
--- a/libavdevice/dshow_pin.c
+++ b/libavdevice/dshow_pin.c
@@ -320,6 +320,14 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, 
IMediaSample *sample)
 } else {
 int64_t dummy;
 IMediaSample_GetTime(sample, &curtime, &dummy);
+if(curtime > 40LL) {
+/* initial frames sometimes start < 0 (shown as a very large 
number here,
+   like 437650244077016960 which FFmpeg doesn't like.
+   TODO figure out math. For now just drop them. */
+av_log(NULL, AV_LOG_DEBUG,
+"dshow dropping initial (or ending) audio frame with odd PTS 
too high %"PRId64"\n", curtime);
+return S_OK;
+}
 curtime += pin->filter->start_time;
 }
 

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


[FFmpeg-cvslog] dshow: fix docu escapes

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
08:31:58 2015 -0700| [b587ec00f7b6df7c46efd115a544c0686bcbd833] | committer: 
rogerdpack

dshow: fix docu escapes

Signed-off-by: rogerdpack 

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

 doc/indevs.texi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index a9792fd..1a5203f 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -292,7 +292,7 @@ $ ffmpeg -list_options true -f dshow -i video="Camera"
 @item
 Specify pin names to capture by name or alternative name, specify alternative 
device name:
 @example
-$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i 
video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
+$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i 
video=video="@@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#@{65e8773d-8f56-11d0-a3b9-00a0c9223196@}\@{ca465100-deb0-4d59-818f-8c477184adf6@}":audio="Microphone"
 @end example
 
 @item

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


[FFmpeg-cvslog] dshow: some devices only list themselves under "Video sources" but

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
06:54:44 2015 -0700| [a35da0920d787d96569171a7c2dff5893144232f] | committer: 
rogerdpack

dshow: some devices only list themselves under "Video sources" but
actually have both video and audio output pins, so make the audio pins
accessible by video source name.

Signed-off-by: rogerdpack 

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

 libavdevice/dshow.c |   81 ---
 libavdevice/dshow_capture.h |5 +++
 2 files changed, 50 insertions(+), 36 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 691250f..e34b77c 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -203,7 +203,7 @@ fail:
  */
 static int
 dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
-enum dshowDeviceType devtype, IBaseFilter **pfilter)
+enum dshowDeviceType devtype, enum dshowSourceFilterType 
sourcetype, IBaseFilter **pfilter)
 {
 struct dshow_ctx *ctx = avctx->priv_data;
 IBaseFilter *device_filter = NULL;
@@ -216,12 +216,13 @@ dshow_cycle_devices(AVFormatContext *avctx, 
ICreateDevEnum *devenum,
 
 const GUID *device_guid[2] = { &CLSID_VideoInputDeviceCategory,
&CLSID_AudioInputDeviceCategory };
-const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
+const char *devtypename = (devtype == VideoDevice) ? "video" : "audio 
only";
+const char *sourcetypename = (sourcetype == VideoSourceDevice) ? "video" : 
"audio";
 
-r = ICreateDevEnum_CreateClassEnumerator(devenum, device_guid[devtype],
+r = ICreateDevEnum_CreateClassEnumerator(devenum, device_guid[sourcetype],
  (IEnumMoniker **) &classenum, 0);
 if (r != S_OK) {
-av_log(avctx, AV_LOG_ERROR, "Could not enumerate %s devices.\n",
+av_log(avctx, AV_LOG_ERROR, "Could not enumerate %s devices (or none 
found).\n",
devtypename);
 return AVERROR(EIO);
 }
@@ -253,7 +254,6 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 unique_name[i] = '_';
 }
 
-
 r = IMoniker_BindToStorage(m, 0, 0, &IID_IPropertyBag, (void *) &bag);
 if (r != S_OK)
 goto fail1;
@@ -262,10 +262,9 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 r = IPropertyBag_Read(bag, L"FriendlyName", &var, NULL);
 if (r != S_OK)
 goto fail1;
-
 friendly_name = dup_wchar_to_utf8(var.bstrVal);
 
- if (pfilter) {
+if (pfilter) {
 if (strcmp(device_name, friendly_name) && strcmp(device_name, 
unique_name))
 goto fail1;
 
@@ -291,15 +290,14 @@ fail1:
 if (bag)
 IPropertyBag_Release(bag);
 IMoniker_Release(m);
-
 }
 
 IEnumMoniker_Release(classenum);
 
 if (pfilter) {
 if (!device_filter) {
-av_log(avctx, AV_LOG_ERROR, "Could not find %s device.\n",
-   devtypename);
+av_log(avctx, AV_LOG_ERROR, "Could not find %s device with name 
[%s] among source devices of type %s.\n",
+   devtypename, device_name, sourcetypename);
 return AVERROR(EIO);
 }
 *pfilter = device_filter;
@@ -510,7 +508,7 @@ dshow_show_filter_properties(IBaseFilter *device_filter, 
AVFormatContext *avctx)
 ISpecifyPropertyPages *property_pages = NULL;
 IUnknown *device_filter_iunknown = NULL;
 HRESULT hr;
-FILTER_INFO filter_info = {0}; /* a warning on this line is false positive 
GCC bug 53119 */
+FILTER_INFO filter_info = {0}; /* a warning on this line is false positive 
GCC bug 53119 AFAICT */
 CAUUID ca_guid = {0};
 
 hr  = IBaseFilter_QueryInterface(device_filter, 
&IID_ISpecifyPropertyPages, (void **)&property_pages);
@@ -557,7 +555,7 @@ end:
  */
 static int
 dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
- IBaseFilter *device_filter, IPin **ppin)
+ enum dshowSourceFilterType sourcetype, IBaseFilter 
*device_filter, IPin **ppin)
 {
 struct dshow_ctx *ctx = avctx->priv_data;
 IEnumPins *pins = 0;
@@ -566,7 +564,8 @@ dshow_cycle_pins(AVFormatContext *avctx, enum 
dshowDeviceType devtype,
 int r;
 
 const GUID *mediatype[2] = { &MEDIATYPE_Video, &MEDIATYPE_Audio };
-const char *devtypename = (devtype == VideoDevice) ? "video" : "audio";
+const char *devtypename = (devtype == VideoDevice) ? "video" : "audio 
only";
+const char *sourcetypename = (sourcetype == VideoSourceDevice) ? "video" : 
"audio";
 
 int set_format = (devtype == VideoDevice && (ctx->framerate ||
 (ctx->requested_width && 
ctx->requested_height) ||
@@ -586,9 +585,10 @@ dshow_cycle_pins(AVFormatContext *avctx, enum 
dsh

[FFmpeg-cvslog] dshow: allow selecting devices by an alternative name ( workaround for devices with symbols in them), allow specifying capture pins by name and alternative (unique) name

2015-01-23 Thread rogerdpack
ffmpeg | branch: master | rogerdpack  | Fri Jan 23 
05:34:30 2015 -0700| [d01234419b615792cd6447cb925ba16cc12ef32e] | committer: 
rogerdpack

dshow: allow selecting devices by an alternative name (workaround for devices 
with symbols in them), allow specifying capture pins by name and alternative 
(unique) name

Signed-off-by: rogerdpack 

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

 doc/indevs.texi |   14 +++-
 libavdevice/dshow.c |   88 ---
 2 files changed, 89 insertions(+), 13 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index fa6facf..00820af 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -167,7 +167,7 @@ The input name should be in the format:
 @end example
 
 where @var{TYPE} can be either @var{audio} or @var{video},
-and @var{NAME} is the device's name.
+and @var{NAME} is the device's name or alternative name..
 
 @subsection Options
 
@@ -220,6 +220,12 @@ Setting this value too low can degrade performance.
 See also
 
@url{http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx}
 
+@item video_pin_name
+Select video capture pin to use by name or alternative name.
+
+@item audio_pin_name
+Select audio capture pin to use by name or alternative name.
+
 @end table
 
 @subsection Examples
@@ -256,6 +262,12 @@ Print the list of supported options in selected device and 
exit:
 $ ffmpeg -list_options true -f dshow -i video="Camera"
 @end example
 
+@item
+Specify pin names to capture by name or alternative name, specify alternative 
device name:
+@example
+$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i 
video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
+@end example
+
 @end itemize
 
 @section dv1394
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index f326ca2..0497e09 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -40,6 +40,8 @@ struct dshow_ctx {
 int   list_options;
 int   list_devices;
 int   audio_buffer_size;
+char *video_pin_name;
+char *audio_pin_name;
 
 IBaseFilter *device_filter[2];
 IPin*device_pin[2];
@@ -269,8 +271,31 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum 
*devenum,
 
 while (!device_filter && IEnumMoniker_Next(classenum, 1, &m, NULL) == 
S_OK) {
 IPropertyBag *bag = NULL;
-char *buf = NULL;
+char *friendly_name = NULL;
+char *unique_name = NULL;
 VARIANT var;
+IBindCtx *bind_ctx = NULL;
+LPOLESTR olestr = NULL;
+LPMALLOC co_malloc = NULL;
+int i;
+
+r = CoGetMalloc(1, &co_malloc);
+if (r = S_OK)
+goto fail1;
+r = CreateBindCtx(0, &bind_ctx);
+if (r != S_OK)
+goto fail1;
+/* GetDisplayname works for both video and audio, DevicePath doesn't */
+r = IMoniker_GetDisplayName(m, bind_ctx, NULL, &olestr);
+if (r != S_OK)
+goto fail1;
+unique_name = dup_wchar_to_utf8(olestr);
+/* replace ':' with '_' since we use : to delineate between sources */
+for (i = 0; i < strlen(unique_name); i++) {
+if (unique_name[i] == ':')
+unique_name[i] = '_';
+}
+
 
 r = IMoniker_BindToStorage(m, 0, 0, &IID_IPropertyBag, (void *) &bag);
 if (r != S_OK)
@@ -281,23 +306,35 @@ dshow_cycle_devices(AVFormatContext *avctx, 
ICreateDevEnum *devenum,
 if (r != S_OK)
 goto fail1;
 
-buf = dup_wchar_to_utf8(var.bstrVal);
+friendly_name = dup_wchar_to_utf8(var.bstrVal);
 
-if (pfilter) {
-if (strcmp(device_name, buf))
+ if (pfilter) {
+if (strcmp(device_name, friendly_name) && strcmp(device_name, 
unique_name))
 goto fail1;
 
-if (!skip--)
-IMoniker_BindToObject(m, 0, 0, &IID_IBaseFilter, (void *) 
&device_filter);
+if (!skip--) {
+r = IMoniker_BindToObject(m, 0, 0, &IID_IBaseFilter, (void *) 
&device_filter);
+if (r != S_OK) {
+av_log(avctx, AV_LOG_ERROR, "Unable to BindToObject for 
%s\n", device_name);
+goto fail1;
+}
+}
 } else {
-av_log(avctx, AV_LOG_INFO, " \"%s\"\n", buf);
+av_log(avctx, AV_LOG_INFO, " \"%s\"\n", friendly_name);
+av_log(avctx, AV_LOG_INFO, "Alternative name \"%s\"\n", 
unique_name);
 }
 
 fail1:
-av_free(buf);
+if (olestr && co_malloc)
+IMalloc_Free(co_malloc, olestr);
+if (bind_ctx)
+IBindCtx_Release(bind_ctx);
+av_free(friendly_name);
+av_free(unique_name);
 if (bag)
 IPropertyBag_Release(bag);

[FFmpeg-cvslog] lavc/libopenjpegenc: move opj_setup_encoder to libopenjpeg_encode_frame

2015-01-23 Thread Jean First
ffmpeg | branch: master | Jean First  | Fri Jan 23 
21:58:41 2015 +0100| [1f13348f7d1049fe9be2897d8cd88024db233bda] | committer: 
Michael Niedermayer

lavc/libopenjpegenc: move opj_setup_encoder to libopenjpeg_encode_frame

if the openjpeg parameter tcp_rates is not 0 ( using the ffmpeg 
compression_level option )
every 2nd image per thread is badly encoded. By moving the opj_setup_encoder 
function from
libopenjpeg_encode_init to libopenjpeg_encode_frame this can be prevented.

This fixes ticket #3754.

Signed-off-by: Jean First 
Signed-off-by: Michael Niedermayer 

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

 libavcodec/libopenjpegenc.c |   19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 66633f4..4039663 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -233,14 +233,6 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext 
*avctx)
 err = AVERROR(EINVAL);
 goto fail;
 }
-opj_setup_encoder(ctx->compress, &ctx->enc_params, ctx->image);
-
-ctx->stream = opj_cio_open((opj_common_ptr) ctx->compress, NULL, 0);
-if (!ctx->stream) {
-av_log(avctx, AV_LOG_ERROR, "Error creating the cio stream\n");
-err = AVERROR(ENOMEM);
-goto fail;
-}
 
 avctx->coded_frame = av_frame_alloc();
 if (!avctx->coded_frame) {
@@ -257,8 +249,6 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext 
*avctx)
 return 0;
 
 fail:
-opj_cio_close(ctx->stream);
-ctx->stream = NULL;
 opj_destroy_compress(ctx->compress);
 ctx->compress = NULL;
 opj_image_destroy(ctx->image);
@@ -569,7 +559,14 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
 return -1;
 }
 
-cio_seek(stream, 0);
+opj_setup_encoder(compress, &ctx->enc_params, image);
+
+stream = opj_cio_open((opj_common_ptr) compress, NULL, 0);
+if (!stream) {
+av_log(avctx, AV_LOG_ERROR, "Error creating the cio stream\n");
+return AVERROR(ENOMEM);
+}
+
 if (!opj_encode(compress, stream, image, NULL)) {
 av_log(avctx, AV_LOG_ERROR, "Error during the opj encode\n");
 return -1;

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


[FFmpeg-cvslog] ffserver: reflow http_vlog()

2015-01-23 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
 | Sat Jan 24 01:10:35 2015 -0300| 
[e97545646af74536a3674954ade51464f51f38dc] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow http_vlog()

Signed-off-by: Reynaldo H. Verdejo Pinochet 

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

 ffserver.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 0b69196..6d75ad6 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -314,7 +314,10 @@ static char *ctime1(char *buf2, int buf_size)
 static void http_vlog(const char *fmt, va_list vargs)
 {
 static int print_prefix = 1;
-if (logfile) {
+
+if (!logfile)
+return;
+
 if (print_prefix) {
 char buf[32];
 ctime1(buf, sizeof(buf));
@@ -323,7 +326,6 @@ static void http_vlog(const char *fmt, va_list vargs)
 print_prefix = strstr(fmt, "\n") != NULL;
 vfprintf(logfile, fmt, vargs);
 fflush(logfile);
-}
 }
 
 #ifdef __GNUC__

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


[FFmpeg-cvslog] ffserver: reindent http_vlog()

2015-01-23 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
 | Sat Jan 24 01:11:58 2015 -0300| 
[7d3857b7ab590752a9c3a32fab7559ec8ad49537] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reindent http_vlog()

Signed-off-by: Reynaldo H. Verdejo Pinochet 

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

 ffserver.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 6d75ad6..578e560 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -318,14 +318,14 @@ static void http_vlog(const char *fmt, va_list vargs)
 if (!logfile)
 return;
 
-if (print_prefix) {
-char buf[32];
-ctime1(buf, sizeof(buf));
-fprintf(logfile, "%s ", buf);
-}
-print_prefix = strstr(fmt, "\n") != NULL;
-vfprintf(logfile, fmt, vargs);
-fflush(logfile);
+if (print_prefix) {
+char buf[32];
+ctime1(buf, sizeof(buf));
+fprintf(logfile, "%s ", buf);
+}
+print_prefix = strstr(fmt, "\n") != NULL;
+vfprintf(logfile, fmt, vargs);
+fflush(logfile);
 }
 
 #ifdef __GNUC__

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


[FFmpeg-cvslog] ffserver: reflow handle_connection()

2015-01-23 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
 | Sat Jan 24 01:35:39 2015 -0300| 
[eadd66a4aff74fd39f8847b655c4ad3a1ac5db2e] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow handle_connection()

Signed-off-by: Reynaldo H. Verdejo Pinochet 

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

 ffserver.c |   25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 578e560..06bcb2d 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -870,6 +870,7 @@ static void close_connection(HTTPContext *c)
 static int handle_connection(HTTPContext *c)
 {
 int len, ret;
+uint8_t *ptr;
 
 switch(c->state) {
 case HTTPSTATE_WAIT_REQUEST:
@@ -885,16 +886,16 @@ static int handle_connection(HTTPContext *c)
 return 0;
 /* read the data */
 read_loop:
-len = recv(c->fd, c->buffer_ptr, 1, 0);
+if (!(len = recv(c->fd, c->buffer_ptr, 1, 0)))
+return -1;
+
 if (len < 0) {
 if (ff_neterrno() != AVERROR(EAGAIN) &&
 ff_neterrno() != AVERROR(EINTR))
 return -1;
-} else if (len == 0) {
-return -1;
-} else {
+break;
+}
 /* search for end of request. */
-uint8_t *ptr;
 c->buffer_ptr += len;
 ptr = c->buffer_ptr;
 if ((ptr >= c->buffer + 2 && !memcmp(ptr-2, "\n\n", 2)) ||
@@ -911,7 +912,7 @@ static int handle_connection(HTTPContext *c)
 /* request too long: cannot do anything */
 return -1;
 } else goto read_loop;
-}
+
 break;
 
 case HTTPSTATE_SEND_HEADER:
@@ -927,7 +928,8 @@ static int handle_connection(HTTPContext *c)
 ff_neterrno() != AVERROR(EINTR)) {
 goto close_connection;
 }
-} else {
+break;
+}
 c->buffer_ptr += len;
 if (c->stream)
 c->stream->bytes_served += len;
@@ -942,7 +944,6 @@ static int handle_connection(HTTPContext *c)
 c->state = HTTPSTATE_SEND_DATA_HEADER;
 c->buffer_ptr = c->buffer_end = c->buffer;
 }
-}
 break;
 
 case HTTPSTATE_SEND_DATA:
@@ -994,7 +995,8 @@ static int handle_connection(HTTPContext *c)
 ff_neterrno() != AVERROR(EINTR)) {
 goto close_connection;
 }
-} else {
+break;
+}
 c->buffer_ptr += len;
 c->data_count += len;
 if (c->buffer_ptr >= c->buffer_end) {
@@ -1002,7 +1004,6 @@ static int handle_connection(HTTPContext *c)
 av_freep(&c->pb_buffer);
 start_wait_request(c, 1);
 }
-}
 break;
 case RTSPSTATE_SEND_PACKET:
 if (c->poll_entry->revents & (POLLERR | POLLHUP)) {
@@ -1021,14 +1022,14 @@ static int handle_connection(HTTPContext *c)
 av_freep(&c->packet_buffer);
 return -1;
 }
-} else {
+break;
+}
 c->packet_buffer_ptr += len;
 if (c->packet_buffer_ptr >= c->packet_buffer_end) {
 /* all the buffer was sent : wait for a new request */
 av_freep(&c->packet_buffer);
 c->state = RTSPSTATE_WAIT_REQUEST;
 }
-}
 break;
 case HTTPSTATE_READY:
 /* nothing to do */

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


[FFmpeg-cvslog] ffserver: reindent handle_connection()

2015-01-23 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
 | Sat Jan 24 01:44:23 2015 -0300| 
[197acee767ddeb9ffeeacf5f9c3449375162f52a] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reindent handle_connection()

Signed-off-by: Reynaldo H. Verdejo Pinochet 

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

 ffserver.c |   86 ++--
 1 file changed, 43 insertions(+), 43 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 06bcb2d..f3b2b19 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -895,23 +895,23 @@ static int handle_connection(HTTPContext *c)
 return -1;
 break;
 }
-/* search for end of request. */
-c->buffer_ptr += len;
-ptr = c->buffer_ptr;
-if ((ptr >= c->buffer + 2 && !memcmp(ptr-2, "\n\n", 2)) ||
-(ptr >= c->buffer + 4 && !memcmp(ptr-4, "\r\n\r\n", 4))) {
-/* request found : parse it and reply */
-if (c->state == HTTPSTATE_WAIT_REQUEST) {
-ret = http_parse_request(c);
-} else {
-ret = rtsp_parse_request(c);
-}
-if (ret < 0)
-return -1;
-} else if (ptr >= c->buffer_end) {
-/* request too long: cannot do anything */
+/* search for end of request. */
+c->buffer_ptr += len;
+ptr = c->buffer_ptr;
+if ((ptr >= c->buffer + 2 && !memcmp(ptr-2, "\n\n", 2)) ||
+(ptr >= c->buffer + 4 && !memcmp(ptr-4, "\r\n\r\n", 4))) {
+/* request found : parse it and reply */
+if (c->state == HTTPSTATE_WAIT_REQUEST) {
+ret = http_parse_request(c);
+} else {
+ret = rtsp_parse_request(c);
+}
+if (ret < 0)
 return -1;
-} else goto read_loop;
+} else if (ptr >= c->buffer_end) {
+/* request too long: cannot do anything */
+return -1;
+} else goto read_loop;
 
 break;
 
@@ -930,20 +930,20 @@ static int handle_connection(HTTPContext *c)
 }
 break;
 }
-c->buffer_ptr += len;
-if (c->stream)
-c->stream->bytes_served += len;
-c->data_count += len;
-if (c->buffer_ptr >= c->buffer_end) {
-av_freep(&c->pb_buffer);
-/* if error, exit */
-if (c->http_error)
-return -1;
-/* all the buffer was sent : synchronize to the incoming
- * stream */
-c->state = HTTPSTATE_SEND_DATA_HEADER;
-c->buffer_ptr = c->buffer_end = c->buffer;
-}
+c->buffer_ptr += len;
+if (c->stream)
+c->stream->bytes_served += len;
+c->data_count += len;
+if (c->buffer_ptr >= c->buffer_end) {
+av_freep(&c->pb_buffer);
+/* if error, exit */
+if (c->http_error)
+return -1;
+/* all the buffer was sent : synchronize to the incoming
+ * stream */
+c->state = HTTPSTATE_SEND_DATA_HEADER;
+c->buffer_ptr = c->buffer_end = c->buffer;
+}
 break;
 
 case HTTPSTATE_SEND_DATA:
@@ -997,13 +997,13 @@ static int handle_connection(HTTPContext *c)
 }
 break;
 }
-c->buffer_ptr += len;
-c->data_count += len;
-if (c->buffer_ptr >= c->buffer_end) {
-/* all the buffer was sent : wait for a new request */
-av_freep(&c->pb_buffer);
-start_wait_request(c, 1);
-}
+c->buffer_ptr += len;
+c->data_count += len;
+if (c->buffer_ptr >= c->buffer_end) {
+/* all the buffer was sent : wait for a new request */
+av_freep(&c->pb_buffer);
+start_wait_request(c, 1);
+}
 break;
 case RTSPSTATE_SEND_PACKET:
 if (c->poll_entry->revents & (POLLERR | POLLHUP)) {
@@ -1024,12 +1024,12 @@ static int handle_connection(HTTPContext *c)
 }
 break;
 }
-c->packet_buffer_ptr += len;
-if (c->packet_buffer_ptr >= c->packet_buffer_end) {
-/* all the buffer was sent : wait for a new request */
-av_freep(&c->packet_buffer);
-c->state = RTSPSTATE_WAIT_REQUEST;
-}
+c->packet_buffer_ptr += len;
+if (c->packet_buffer_ptr >= c->packet_buffer_end) {
+/* all the buffer was sent : wait for a new request */
+av_freep(&c->packet_buffer);
+c->state = RTSPSTATE_WAIT_REQUEST;
+}
 break;
 case HTTPSTATE_READY:
 /* nothing to do */

__

[FFmpeg-cvslog] ffserver: reflow find_stream_in_feed()

2015-01-23 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
 | Sat Jan 24 01:56:18 2015 -0300| 
[2699a378167550d50f2b32587bdbc985a2a6bc54] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow find_stream_in_feed()

Signed-off-by: Reynaldo H. Verdejo Pinochet 

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

 ffserver.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index f3b2b19..0946d0e 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1117,14 +1117,13 @@ static int find_stream_in_feed(FFServerStream *feed, 
AVCodecContext *codec, int
 best_bitrate = feed_codec->bit_rate;
 best = i;
 }
-} else {
-if (feed_codec->bit_rate < best_bitrate) {
-best_bitrate = feed_codec->bit_rate;
-best = i;
-}
+continue;
+}
+if (feed_codec->bit_rate < best_bitrate) {
+best_bitrate = feed_codec->bit_rate;
+best = i;
 }
 }
-
 return best;
 }
 

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