diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-08-04 10:33:00 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-08-04 10:33:00 +0400 |
commit | 2e78bdc0dadad3d9080c5a00a56a159a5bd3819b (patch) | |
tree | 65c247d98df7f8003c420eca226e424a2352c209 | |
parent | e5c84b149dd1d618c848c620a59365a36d8801fa (diff) |
Fix handling of some H264 AnnexB streams in AVI
-rw-r--r-- | demuxer/Demuxers/LAVFStreamInfo.cpp | 13 | ||||
-rw-r--r-- | demuxer/Demuxers/LAVFVideoHelper.cpp | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/demuxer/Demuxers/LAVFStreamInfo.cpp b/demuxer/Demuxers/LAVFStreamInfo.cpp index 1e4c62e5..ebfa4434 100644 --- a/demuxer/Demuxers/LAVFStreamInfo.cpp +++ b/demuxer/Demuxers/LAVFStreamInfo.cpp @@ -239,12 +239,15 @@ STDMETHODIMP CLAVFStreamInfo::CreateVideoMediaType(AVFormatContext *avctx, AVStr BOOL bConvertToAVC1 = (m_containerFormat == "mpegts"); mtype.pbFormat = (BYTE *)g_VideoHelper.CreateMPEG2VI(avstream, &mtype.cbFormat, m_containerFormat, bConvertToAVC1); MPEG2VIDEOINFO *mp2vi = (MPEG2VIDEOINFO *)mtype.pbFormat; - if (avstream->codec->codec_id == AV_CODEC_ID_H264 && !bConvertToAVC1 && h264_is_annexb(m_containerFormat, avstream)) { - mtype.subtype = MEDIASUBTYPE_H264; + if (avstream->codec->codec_id == AV_CODEC_ID_H264) { + if (!bConvertToAVC1 && h264_is_annexb(m_containerFormat, avstream)) { + mtype.subtype = MEDIASUBTYPE_H264; + } else { + mtype.subtype = MEDIASUBTYPE_AVC1; + if (mp2vi->dwFlags == 0) + mp2vi->dwFlags = 4; + } mp2vi->hdr.bmiHeader.biCompression = mtype.subtype.Data1; - } else { - if (mp2vi->dwFlags == 0) - mp2vi->dwFlags = 4; } } diff --git a/demuxer/Demuxers/LAVFVideoHelper.cpp b/demuxer/Demuxers/LAVFVideoHelper.cpp index 31eb5b37..9d5cf876 100644 --- a/demuxer/Demuxers/LAVFVideoHelper.cpp +++ b/demuxer/Demuxers/LAVFVideoHelper.cpp @@ -39,7 +39,7 @@ CLAVFVideoHelper g_VideoHelper; static FormatMapping video_map[] = { { AV_CODEC_ID_H263, &MEDIASUBTYPE_H263, NULL, NULL }, { AV_CODEC_ID_H263I, &MEDIASUBTYPE_I263, NULL, NULL }, - { AV_CODEC_ID_H264, &MEDIASUBTYPE_AVC1, MKTAG('A','V','C','1'), &FORMAT_MPEG2Video }, + { AV_CODEC_ID_H264, &MEDIASUBTYPE_AVC1, NULL, &FORMAT_MPEG2Video }, { AV_CODEC_ID_MPEG1VIDEO, &MEDIASUBTYPE_MPEG1Payload, NULL, &FORMAT_MPEGVideo }, { AV_CODEC_ID_MPEG2VIDEO, &MEDIASUBTYPE_MPEG2_VIDEO, NULL, &FORMAT_MPEG2Video }, { AV_CODEC_ID_RV10, &MEDIASUBTYPE_RV10, MKTAG('R','V','1','0'), &FORMAT_VideoInfo2 }, |