[FFmpeg-devel] [PATCH] RTSP-MS 14/15: ASF packet parsing
Michael Niedermayer
michaelni
Thu Jun 18 15:03:29 CEST 2009
On Sun, Jun 14, 2009 at 10:09:14PM -0400, Ronald S. Bultje wrote:
> Hi,
>
> On Thu, Apr 23, 2009 at 4:27 PM, Michael Niedermayer<michaelni at gmx.at> wrote:
> > On Thu, Apr 23, 2009 at 03:49:54PM -0400, Ronald S. Bultje wrote:
> >> My guess was that you would reject a patch that handles it at that
> >> single spot... :-).
> >
> > i can accept a demuxer that is designed to support EAGAIN at packet
> > boundaries.
> > but one that supports multiple EOF or is not
>
> OK, attached patch implements RTSP/ASF using your proposed method. I
> can apply in smaller patches if you want, but the patch is not too
> big. And it works. :-).
>
> Ronald
> Changelog | 1
> libavformat/asfdec.c | 2
> libavformat/rtp_asf.c | 190 +++++++++++++++++++++++++++++++++++++++++++++++++-
> libavformat/rtsp.h | 4 +
> 4 files changed, 196 insertions(+), 1 deletion(-)
> a741b69cdeb00ebd2758b2655587f2175270b280 rtsp-ms-parse-asf-payload.patch
> Index: ffmpeg-svn/libavformat/rtp_asf.c
> ===================================================================
> --- ffmpeg-svn.orig/libavformat/rtp_asf.c 2009-06-12 14:18:53.000000000 -0400
> +++ ffmpeg-svn/libavformat/rtp_asf.c 2009-06-14 12:53:14.000000000 -0400
> @@ -27,11 +27,67 @@
>
> #include <libavutil/base64.h>
> #include <libavutil/avstring.h>
> +#include <libavcodec/internal.h>
what is this good for?
> +#include <libavutil/intreadwrite.h>
> #include "rtp.h"
> #include "rtp_asf.h"
> #include "rtsp.h"
> #include "asf.h"
>
> +static void
> +rtp_asf_fix_header(uint8_t *buf, int len)
> +{
> + /**
> + * From MSDN 2.2.1.4, we learn that ASF data packets over RTP should
> + * not contain any padding. Unfortunately, the header min/max_pktsize
> + * are not updated (thus making min_pktsize invalid). Here, we "fix"
> + * these faulty min_pktsize values in the ASF file header.
> + */
that comment should be before the function
[...]
> Index: ffmpeg-svn/libavformat/asfdec.c
> ===================================================================
> --- ffmpeg-svn.orig/libavformat/asfdec.c 2009-06-14 11:52:33.000000000 -0400
> +++ ffmpeg-svn/libavformat/asfdec.c 2009-06-14 12:49:08.000000000 -0400
> @@ -606,6 +606,8 @@
> }
>
> if (c != 0x82) {
> + if (url_ferror(pb) == -EAGAIN)
> + return -EAGAIN;
this must be documented to make it very clear that it is not a generic
EAGAIN handling capability but rather limited to packet boundaries
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090618/a3016d9f/attachment.pgp>
More information about the ffmpeg-devel
mailing list