summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_rtp_codec.cpp
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-08-18 02:29:37 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-08-18 02:29:37 +0300
commit95da34aa071d64b21ef3e952b987ba3dcee84ca0 (patch)
treeeabf4399e40fd270714c53d40688eadadfd4c5ff /libmpdemux/demux_rtp_codec.cpp
parentf394231f5de9d1ff679f1b2da4d1f1b303ae914a (diff)
parent3961e12fca2f1ec10c64e3ff298828feecca52c9 (diff)
downloadmpv-95da34aa071d64b21ef3e952b987ba3dcee84ca0.tar.bz2
mpv-95da34aa071d64b21ef3e952b987ba3dcee84ca0.tar.xz
Merge svn changes up to r29532
Diffstat (limited to 'libmpdemux/demux_rtp_codec.cpp')
-rw-r--r--libmpdemux/demux_rtp_codec.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libmpdemux/demux_rtp_codec.cpp b/libmpdemux/demux_rtp_codec.cpp
index 839da403ca..32bfc43647 100644
--- a/libmpdemux/demux_rtp_codec.cpp
+++ b/libmpdemux/demux_rtp_codec.cpp
@@ -29,6 +29,7 @@ extern "C" {
#ifdef CONFIG_LIBAVCODEC
AVCodecParserContext * h264parserctx;
+AVCodecContext *avcctx;
#endif
// Copied from vlc
@@ -137,6 +138,7 @@ void rtpCodecInitialize_video(demuxer_t* demuxer,
#ifdef CONFIG_LIBAVCODEC
avcodec_register_all();
h264parserctx = av_parser_init(CODEC_ID_H264);
+ avcctx = avcodec_alloc_context();
#endif
needVideoFrameRate(demuxer, subsession);
} else if (strcmp(subsession->codecName(), "H261") == 0) {
@@ -181,6 +183,8 @@ void rtpCodecInitialize_video(demuxer_t* demuxer,
bih->biCompression = sh_video->format = fourcc;
bih->biWidth = qtRTPSource->qtState.width;
bih->biHeight = qtRTPSource->qtState.height;
+ if (qtRTPSource->qtState.sdAtomSize > 83)
+ bih->biBitCount = qtRTPSource->qtState.sdAtom[83];
uint8_t *pos = (uint8_t*)qtRTPSource->qtState.sdAtom + 86;
uint8_t *endpos = (uint8_t*)qtRTPSource->qtState.sdAtom
+ qtRTPSource->qtState.sdAtomSize;
@@ -315,6 +319,10 @@ void rtpCodecInitialize_audio(demuxer_t* demuxer,
wf->wFormatTag = sh_audio->format = fourcc;
wf->nChannels = numChannels;
+ if (qtRTPSource->qtState.sdAtomSize > 33) {
+ wf->wBitsPerSample = qtRTPSource->qtState.sdAtom[27];
+ wf->nSamplesPerSec = qtRTPSource->qtState.sdAtom[32]<<8|qtRTPSource->qtState.sdAtom[33];
+ }
uint8_t *pos = (uint8_t*)qtRTPSource->qtState.sdAtom + 52;
uint8_t *endpos = (uint8_t*)qtRTPSource->qtState.sdAtom
+ qtRTPSource->qtState.sdAtomSize;