projects
/
goodguy
/
history.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
475fa6d
)
fix for ffmpeg seek pos 0, add pactl probe
author
Good Guy
<good1.2guy@gmail.com>
Wed, 4 May 2016 18:42:27 +0000
(12:42 -0600)
committer
Good Guy
<good1.2guy@gmail.com>
Wed, 4 May 2016 18:42:27 +0000
(12:42 -0600)
cinelerra-5.1/cinelerra/audioalsa.C
patch
|
blob
|
history
cinelerra-5.1/cinelerra/ffmpeg.C
patch
|
blob
|
history
cinelerra-5.1/cinelerra/ffmpeg.h
patch
|
blob
|
history
cinelerra-5.1/configure
patch
|
blob
|
history
cinelerra-5.1/global_config
patch
|
blob
|
history
diff --git
a/cinelerra-5.1/cinelerra/audioalsa.C
b/cinelerra-5.1/cinelerra/audioalsa.C
index ee5b65303fbb9a4e1e68013a933d444d7a9695d9..166324d61a4e482712c88e623df868252cdb4c88 100644
(file)
--- a/
cinelerra-5.1/cinelerra/audioalsa.C
+++ b/
cinelerra-5.1/cinelerra/audioalsa.C
@@
-156,6
+156,7
@@
void AudioALSA::list_devices(ArrayList<char*> *devices, int pcm_title, int mode)
snd_ctl_close(handle);
}
snd_ctl_close(handle);
}
+#ifdef HAVE_PACTL
// attempt to add pulseaudio "monitor" devices
// run: pactl list <sources>|<sinks>
// scan output for <Source/Sink> #n, Name: <device>
// attempt to add pulseaudio "monitor" devices
// run: pactl list <sources>|<sinks>
// scan output for <Source/Sink> #n, Name: <device>
@@
-211,6
+212,7
@@
void AudioALSA::list_devices(ArrayList<char*> *devices, int pcm_title, int mode)
}
pclose(pactl);
}
}
pclose(pactl);
}
+#endif
}
void AudioALSA::translate_name(char *output, char *input, int mode)
}
void AudioALSA::translate_name(char *output, char *input, int mode)
diff --git
a/cinelerra-5.1/cinelerra/ffmpeg.C
b/cinelerra-5.1/cinelerra/ffmpeg.C
index 515657867a22e929a0f806ec321bee6c1a63a9ac..74d1d74522528855c84bcd5bedf766ed99640070 100644
(file)
--- a/
cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/
cinelerra-5.1/cinelerra/ffmpeg.C
@@
-47,21
+47,15
@@
static void ff_err(int ret, const char *fmt, ...)
fprintf(stderr,_("%s err: %s\n"),msg, errmsg);
}
fprintf(stderr,_("%s err: %s\n"),msg, errmsg);
}
-FFPacket::FFPacket()
-{
- init();
-}
-
-FFPacket::~FFPacket()
-{
- av_packet_unref(&pkt);
-}
-
void FFPacket::init()
{
av_init_packet(&pkt);
pkt.data = 0; pkt.size = 0;
}
void FFPacket::init()
{
av_init_packet(&pkt);
pkt.data = 0; pkt.size = 0;
}
+void FFPacket::finit()
+{
+ av_packet_unref(&pkt);
+}
FFrame::FFrame(FFStream *fst)
{
FFrame::FFrame(FFStream *fst)
{
@@
-449,7
+443,7
@@
int FFStream::flush()
int FFStream::seek(int64_t no, double rate)
{
int FFStream::seek(int64_t no, double rate)
{
- i
f( no < 0 ) no = 0
;
+ i
nt64_t tstmp = -INT64_MAX+1
;
// default ffmpeg native seek
int npkts = 1;
int64_t pos = no, plmt = -1;
// default ffmpeg native seek
int npkts = 1;
int64_t pos = no, plmt = -1;
@@
-461,27
+455,30
@@
int FFStream::seek(int64_t no, double rate)
if( no-n < 30*rate ) {
if( n < 0 ) n = 0;
pos = n;
if( no-n < 30*rate ) {
if( n < 0 ) n = 0;
pos = n;
- if(
++
i < marks.size() ) plmt = marks[i].pos;
+ if( i < marks.size() ) plmt = marks[i].pos;
npkts = MAX_RETRY;
}
}
npkts = MAX_RETRY;
}
}
- double secs = pos / rate;
- int64_t pkt_ts, tstmp = secs * st->time_base.den / st->time_base.num;
- if( nudge != AV_NOPTS_VALUE ) tstmp += nudge;
+ if( pos > 0 ) {
+ double secs = pos / rate;
+ tstmp = secs * st->time_base.den / st->time_base.num;
+ if( nudge != AV_NOPTS_VALUE ) tstmp += nudge;
+ }
int ret = avformat_seek_file(fmt_ctx, st->index,
-INT64_MAX, tstmp, INT64_MAX, AVSEEK_FLAG_ANY);
if( ret >= 0 ) {
avcodec_flush_buffers(st->codec);
int ret = avformat_seek_file(fmt_ctx, st->index,
-INT64_MAX, tstmp, INT64_MAX, AVSEEK_FLAG_ANY);
if( ret >= 0 ) {
avcodec_flush_buffers(st->codec);
+ ipkt.finit(); ipkt.init();
need_packet = 0; flushed = 0;
seeked = 1; st_eof(0);
// read up to retry packets, limited to npkts in stream, and not past pkt.pos plmt
need_packet = 0; flushed = 0;
seeked = 1; st_eof(0);
// read up to retry packets, limited to npkts in stream, and not past pkt.pos plmt
- for(
int retry=MAX_RETRY; ret>=0 && --retry>=0;
) {
+ for(
;;
) {
if( read_packet() <= 0 ) { ret = -1; break; }
if( plmt >= 0 && ipkt->pos >= plmt ) break;
if( ipkt->stream_index != st->index ) continue;
if( --npkts <= 0 ) break;
if( read_packet() <= 0 ) { ret = -1; break; }
if( plmt >= 0 && ipkt->pos >= plmt ) break;
if( ipkt->stream_index != st->index ) continue;
if( --npkts <= 0 ) break;
- i
f( (pkt_ts=ipkt->dts) == AV_NOPTS_VALUE &&
-
(pkt_ts=ipkt->pts)
== AV_NOPTS_VALUE ) continue;
+ i
nt64_t pkt_ts = ipkt->dts != AV_NOPTS_VALUE ? ipkt->dts : ipkt->pts;
+
if( pkt_ts
== AV_NOPTS_VALUE ) continue;
if( pkt_ts >= tstmp ) break;
}
}
if( pkt_ts >= tstmp ) break;
}
}
diff --git
a/cinelerra-5.1/cinelerra/ffmpeg.h
b/cinelerra-5.1/cinelerra/ffmpeg.h
index 4860c0021dd1c9a9d868d5a435e4e1e9b263620f..674e2703201b92ffa92b9a91264863fe2e9b9d73 100644
(file)
--- a/
cinelerra-5.1/cinelerra/ffmpeg.h
+++ b/
cinelerra-5.1/cinelerra/ffmpeg.h
@@
-40,12
+40,14
@@
extern "C" {
class FFPacket {
AVPacket pkt;
public:
class FFPacket {
AVPacket pkt;
public:
- FFPacket();
- ~FFPacket();
- void init();
operator AVPacket*() { return &pkt; }
operator AVPacket&() { return pkt; }
AVPacket *operator ->() { return &pkt; }
operator AVPacket*() { return &pkt; }
operator AVPacket&() { return pkt; }
AVPacket *operator ->() { return &pkt; }
+
+ void init();
+ void finit();
+ FFPacket() { init(); }
+ ~FFPacket() { finit(); }
};
class FFrame : public ListItem<FFrame> {
};
class FFrame : public ListItem<FFrame> {
diff --git
a/cinelerra-5.1/configure
b/cinelerra-5.1/configure
index 02e4c514e73cdbe9de39efbc7f2c993a425becce..06bbc5661126b33f007269ba6871c23b5409d593 100755
(executable)
--- a/
cinelerra-5.1/configure
+++ b/
cinelerra-5.1/configure
@@
-6,7
+6,7
@@
#edit global_config and set HAVE_var to override probe
PROBED="STATIC_LIBRARIES HAVE_VIDEO4LINUX2 HAVE_DVB HAVE_GL"
#edit global_config and set HAVE_var to override probe
PROBED="STATIC_LIBRARIES HAVE_VIDEO4LINUX2 HAVE_DVB HAVE_GL"
-PROBED="$PROBED HAVE_DL HAVE_NUMA"
+PROBED="$PROBED HAVE_DL HAVE_NUMA
HAVE_PACTL
"
if [ $# -gt 0 ]; then
if [ "$1" = "reset" ]; then
if [ $# -gt 0 ]; then
if [ "$1" = "reset" ]; then
@@
-169,6
+169,7
@@
if [ -x a.out ]; then HAVE_NUMA=y; else HAVE_NUMA=n; fi
rm -f a.out conftest.c
rm -f a.out conftest.c
+if pactl --version >& /dev/null; then HAVE_PACTL=y; else HAVE_PACTL=n; fi
# update global_config with probe data
# update global_config with probe data
diff --git
a/cinelerra-5.1/global_config
b/cinelerra-5.1/global_config
index 43126b32c26e6046886ec168176baab255b7cb9d..e25ee3154c9d4fc99d3624a0e7e16a0d79034eea 100644
(file)
--- a/
cinelerra-5.1/global_config
+++ b/
cinelerra-5.1/global_config
@@
-18,6
+18,7
@@
HAVE_LADSPA := y
#HAVE_GL := y
#HAVE_DL := y
#HAVE_NUMA := y
#HAVE_GL := y
#HAVE_DL := y
#HAVE_NUMA := y
+#HAVE_PACTL := y
OBJDIR := $(shell uname -m)
OBJDIR := $(shell uname -m)