diff options
author | jstebbins <[email protected]> | 2015-01-14 18:41:38 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-01-14 18:41:38 +0000 |
commit | 3517fab9d6bba873a5bf7a047f651fd8ea169c8b (patch) | |
tree | d16a420393a425b793ff67bea352be2ea0adb277 /libhb | |
parent | 7116db76641468327080ce0623ba2b62795d41cb (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/trunk@6749 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-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 fc3bb7b4a..77bc03fc4 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; |