Skip to content

Commit

Permalink
Mpeg: Ask FFmpeg not to look beyond the header.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Jul 23, 2016
1 parent e075649 commit 81f8cb5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Core/HW/MediaEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,13 @@ bool MediaEngine::openContext() {
m_pFormatCtx->pb = m_pIOContext;

// Open video file
if (avformat_open_input((AVFormatContext**)&m_pFormatCtx, NULL, NULL, NULL) != 0)
AVDictionary *open_opt = nullptr;
av_dict_set_int(&open_opt, "probesize", m_mpegheaderSize, 0);
if (avformat_open_input((AVFormatContext**)&m_pFormatCtx, NULL, NULL, &open_opt) != 0) {
av_dict_free(&open_opt);
return false;
}
av_dict_free(&open_opt);

if (avformat_find_stream_info(m_pFormatCtx, NULL) < 0) {
closeContext();
Expand Down

0 comments on commit 81f8cb5

Please sign in to comment.