diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2007-08-28 13:43:39 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2007-08-28 13:43:39 +0000 |
commit | f6df400c0c5b7b7cd065d0ec34d3f97d05ea75c1 (patch) | |
tree | bd6310118358249239b6bc32e2918bbf80b9b213 /libavformat/rtp_mpv.c | |
parent | 55bf7fb6130a2a13c30498a787d6dfead39ecceb (diff) | |
download | ffmpeg-f6df400c0c5b7b7cd065d0ec34d3f97d05ea75c1.tar.gz |
Backport fix for mpegvideo rtp, fixes Issue119, original fix from Dario Gallucci <dariodotgallucciatpolito.it> in feng
Originally committed as revision 10257 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtp_mpv.c')
-rw-r--r-- | libavformat/rtp_mpv.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/libavformat/rtp_mpv.c b/libavformat/rtp_mpv.c index 0db6663cbd..3886d8bceb 100644 --- a/libavformat/rtp_mpv.c +++ b/libavformat/rtp_mpv.c @@ -28,32 +28,39 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size) RTPDemuxContext *s = s1->priv_data; AVStream *st = s1->streams[0]; int len, h, max_packet_size; + int b=1, e=0; uint8_t *q; max_packet_size = s->max_payload_size; while (size > 0) { - /* XXX: more correct headers */ + len = max_packet_size - 4; + + if (len >= size) { + len = size; + e = 1; + } + h = 0; - if (st->codec->sub_id == 2) - h |= 1 << 26; /* mpeg 2 indicator */ + h |= b << 12; + h |= e << 11; + +// if (st->codec->sub_id == 2) +// h |= 1 << 26; /* mpeg 2 indicator */ + q = s->buf; *q++ = h >> 24; *q++ = h >> 16; *q++ = h >> 8; *q++ = h; - if (st->codec->sub_id == 2) { +/* if (st->codec->sub_id == 2) { h = 0; *q++ = h >> 24; *q++ = h >> 16; *q++ = h >> 8; *q++ = h; - } - - len = max_packet_size - (q - s->buf); - if (len > size) - len = size; + } */ memcpy(q, buf1, len); q += len; |