aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-04 17:35:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-04 17:35:20 +0200
commit2e8dcde1fe91ec6f0a139008f4cea49f0014b2bf (patch)
treee5f70b0c2adbdccd059137d51540ce689bb7389c /ffplay.c
parentcb3fd029b7dce5b8f01f3bb7f0cfe1c6e384bb44 (diff)
downloadffmpeg-2e8dcde1fe91ec6f0a139008f4cea49f0014b2bf.tar.gz
ffplay: autodetect realtime streams and enable infbuf
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ffplay.c b/ffplay.c
index 9e26399215..d94555a5fb 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2363,6 +2363,22 @@ static int decode_interrupt_cb(void *ctx)
return is->abort_request;
}
+static int is_realtime(AVFormatContext *s)
+{
+ if( !strcmp(s->iformat->name, "rtp")
+ || !strcmp(s->iformat->name, "rtsp")
+ || !strcmp(s->iformat->name, "sdp")
+ )
+ return 1;
+
+ if(s->pb && ( !strncmp(s->filename, "rtp:", 4)
+ || !strncmp(s->filename, "udp:", 4)
+ )
+ )
+ return 1;
+ return 0;
+}
+
/* this thread gets the stream from the disk or the network */
static int read_thread(void *arg)
{
@@ -2485,6 +2501,9 @@ static int read_thread(void *arg)
goto fail;
}
+ if (infinite_buffer < 0 && is_realtime(ic))
+ infinite_buffer = 1;
+
for (;;) {
if (is->abort_request)
break;