summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorgpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-12 19:59:47 +0000
committergpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-12 19:59:47 +0000
commit18dedd6eeceb78a3cfab718429a393c13c7d8bc0 (patch)
treece3253437be92d8f15531d15a96e0a75941c2245 /libmpdemux
parent3caab473238da29cd3e34f4f3ad095b7d4fc8f91 (diff)
downloadmpv-18dedd6eeceb78a3cfab718429a393c13c7d8bc0.tar.bz2
mpv-18dedd6eeceb78a3cfab718429a393c13c7d8bc0.tar.xz
add support for avc1 in X-QT over RTSP
patch by Carl Eugen Hoyos cehoyos at ag.or.at git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21889 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_rtp_codec.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/libmpdemux/demux_rtp_codec.cpp b/libmpdemux/demux_rtp_codec.cpp
index bc0d63b36b..cdee07759a 100644
--- a/libmpdemux/demux_rtp_codec.cpp
+++ b/libmpdemux/demux_rtp_codec.cpp
@@ -86,6 +86,27 @@ void rtpCodecInitialize_video(demuxer_t* demuxer,
} while (!parseQTState_video(qtRTPSource->qtState, fourcc));
bih->biCompression = sh_video->format = fourcc;
+ bih->biWidth = qtRTPSource->qtState.width;
+ bih->biHeight = qtRTPSource->qtState.height;
+ if (bih->biCompression == mmioFOURCC('a','v','c','1')) {
+ uint8_t *pos = (uint8_t*)qtRTPSource->qtState.sdAtom + 86;
+ uint8_t *endpos = (uint8_t*)qtRTPSource->qtState.sdAtom
+ + qtRTPSource->qtState.sdAtomSize;
+ while (pos+8 < endpos) {
+ unsigned atomLength = pos[0]<<24 | pos[1]<<16 | pos[2]<<8 | pos[3];
+ if (atomLength == 0 || atomLength > endpos-pos) break;
+ if (memcmp(pos+4, "avcC", 4) == 0 &&
+ atomLength > 8 &&
+ atomLength <= INT_MAX-sizeof(BITMAPINFOHEADER)) {
+ bih->biSize = sizeof(BITMAPINFOHEADER)+atomLength-8;
+ sh_video->bih = bih = (BITMAPINFOHEADER*)realloc(bih, bih->biSize);
+ memcpy(bih+1, pos+8, atomLength-8);
+ break;
+ }
+ pos += atomLength;
+ }
+ needVideoFrameRate(demuxer, subsession);
+ }
} else {
fprintf(stderr,
"Unknown MPlayer format code for MIME type \"video/%s\"\n",