diff options
author | waker <wakeroid@gmail.com> | 2011-10-10 19:05:08 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-10-10 19:05:08 +0200 |
commit | faae73cdf6fbc248b7f91ce4478a4908f2f32edf (patch) | |
tree | 588f90fa0ce5032d20abeeaa4359ef5a84631322 /plugins/ffmpeg | |
parent | b7f8552d60d53c02b1966d004e680242b92bbd8e (diff) |
ffmpeg: temporary override FILETYPE instead of setting it permanently (for streams); set max_analyze_duration to half a second
Diffstat (limited to 'plugins/ffmpeg')
-rw-r--r-- | plugins/ffmpeg/ffmpeg.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c index 37c7e804..4fe3d0de 100644 --- a/plugins/ffmpeg/ffmpeg.c +++ b/plugins/ffmpeg/ffmpeg.c @@ -38,6 +38,7 @@ #include <ffmpeg/avcodec.h> #include <ffmpeg/avutil.h> #include <ffmpeg/avstring.h> + #define AVERROR_EOF AVERROR(EPIPE) #if LIBAVFORMAT_VERSION_MAJOR < 53 @@ -63,6 +64,8 @@ static DB_functions_t *deadbeef; #define EXT_MAX 100 +#define FFMPEG_MAX_ANALYZE_DURATION 500000 + static char * exts[EXT_MAX] = {NULL}; enum { @@ -140,6 +143,7 @@ ffmpeg_init (DB_fileinfo_t *_info, DB_playItem_t *it) { trace ("\033[0;31mffmpeg av_find_stream_info\033[37;0m\n"); info->stream_id = -1; + info->fctx->max_analyze_duration = FFMPEG_MAX_ANALYZE_DURATION; av_find_stream_info(info->fctx); for (i = 0; i < info->fctx->nb_streams; i++) { @@ -172,7 +176,7 @@ ffmpeg_init (DB_fileinfo_t *_info, DB_playItem_t *it) { return -1; } - deadbeef->pl_replace_meta (it, ":FILETYPE", info->codec->name); + deadbeef->pl_replace_meta (it, "!FILETYPE", info->codec->name); int bps = av_get_bits_per_sample_format (info->ctx->sample_fmt); int samplerate = info->ctx->sample_rate; @@ -495,6 +499,7 @@ ffmpeg_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { return NULL; } + fctx->max_analyze_duration = FFMPEG_MAX_ANALYZE_DURATION; av_find_stream_info(fctx); for (i = 0; i < fctx->nb_streams; i++) { |