diff options
author | jstebbins <[email protected]> | 2015-01-14 18:41:43 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-01-14 18:41:43 +0000 |
commit | b3e37a702ac87ddec82010a0e2a88d47ee00a7dc (patch) | |
tree | b0b39cb067bf55212b159dd9a5c62514b3e3659f | |
parent | 97b3bc9d4d9d639c89a1c2cf34f8627d95c27be7 (diff) |
stream: Fix scanning files with large PNGs
Increase libavformat probe buffer size. The default size of 5MB is not
large enough to successfully scan some files.
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.10.x@6750 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/stream.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libhb/stream.c b/libhb/stream.c index 0d1bec226..c54eb7e8a 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -4949,16 +4949,30 @@ static int ffmpeg_open( hb_stream_t *stream, hb_title_t *title, int scan ) av_log_set_level( AV_LOG_ERROR ); + // Increase probe buffer size + // The default (5MB) is not big enough to successfully scan + // some files with large PNGs + AVDictionary * av_opts = NULL; + av_dict_set( &av_opts, "probesize", "15000000", 0 ); + // FFMpeg has issues with seeking. After av_find_stream_info, the // streams are left in an indeterminate position. So a seek is // necessary to force things back to the beginning of the stream. // But then the seek fails for some stream types. So the safest thing // to do seems to be to open 2 AVFormatContext. One for probing info // and the other for reading. - if ( avformat_open_input( &info_ic, stream->path, NULL, NULL ) < 0 ) + if ( avformat_open_input( &info_ic, stream->path, NULL, &av_opts ) < 0 ) { return 0; } + // libav populates av_opts with the things it didn't recognize. + AVDictionaryEntry *t = NULL; + while ((t = av_dict_get(av_opts, "", t, AV_DICT_IGNORE_SUFFIX)) != NULL) + { + hb_log("ffmpeg_open: unknown option '%s'", t->key); + } + av_dict_free( &av_opts ); + if ( avformat_find_stream_info( info_ic, NULL ) < 0 ) goto fail; |