[SCM] libav/experimental: Autodetect when byte based seeking is better (that is for all formats that allow discontinuities) Fixes issue1090
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 16:59:18 UTC 2013
The following commit has been merged in the experimental branch:
commit 70a4764d0e0085523d46d0b3c361baa94388789c
Author: Michael Niedermayer <michaelni at gmx.at>
Date: Tue Feb 2 18:02:16 2010 +0000
Autodetect when byte based seeking is better (that is for all formats that allow
discontinuities)
Fixes issue1090
Originally committed as revision 21606 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/ffplay.c b/ffplay.c
index 744b4d4..460bfef 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -207,7 +207,7 @@ static int video_disable;
static int wanted_audio_stream= 0;
static int wanted_video_stream= 0;
static int wanted_subtitle_stream= -1;
-static int seek_by_bytes;
+static int seek_by_bytes=-1;
static int display_disable;
static int show_status = 1;
static int av_sync_type = AV_SYNC_AUDIO_MASTER;
@@ -1971,6 +1971,9 @@ static int decode_thread(void *arg)
if(ic->pb)
ic->pb->eof_reached= 0; //FIXME hack, ffplay maybe should not use url_feof() to test for the end
+ if(seek_by_bytes<0)
+ seek_by_bytes= !!(ic->iformat->flags & AVFMT_TS_DISCONT);
+
/* if seeking requested, we execute it */
if (start_time != AV_NOPTS_VALUE) {
int64_t timestamp;
@@ -2529,7 +2532,7 @@ static const OptionDef options[] = {
{ "vst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_video_stream}, "select desired video stream", "stream_number" },
{ "sst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_subtitle_stream}, "select desired subtitle stream", "stream_number" },
{ "ss", HAS_ARG | OPT_FUNC2, {(void*)&opt_seek}, "seek to a given position in seconds", "pos" },
- { "bytes", OPT_BOOL, {(void*)&seek_by_bytes}, "seek by bytes" },
+ { "bytes", OPT_INT | HAS_ARG, {(void*)&seek_by_bytes}, "seek by bytes 0=off 1=on -1=auto" },
{ "nodisp", OPT_BOOL, {(void*)&display_disable}, "disable graphical display" },
{ "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
{ "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_frame_pix_fmt}, "set pixel format", "format" },
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list