[FFmpeg-devel] [PATCH 1/2] add support for generic seeking by reading timestamps in nuv

Michael Niedermayer michaelni at gmx.at
Mon Sep 12 16:51:46 CEST 2011


On Sun, Sep 11, 2011 at 06:11:16PM +0200, Joakim Plate wrote:
> ---
>  libavformat/nuv.c |   78 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 78 insertions(+), 0 deletions(-)

>  nuv.c |   78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 78 insertions(+)
> 64e9f198563491684442b1bc40bb54fe608c7e80  0001-add-support-for-generic-seeking-by-reading-timestamp.patch
> diff --git a/libavformat/nuv.c b/libavformat/nuv.c
> index 607dcdc..999546f 100644
> --- a/libavformat/nuv.c
> +++ b/libavformat/nuv.c
> @@ -258,6 +258,83 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) {
>      return AVERROR(EIO);
>  }
>  
> +/**
> + * \brief looks for the string RTjjjjjjjjjj in the stream too resync reading
> + * \return TRUE if the syncword is found.
> + */
> +static int nuv_resync(AVFormatContext *s, int64_t pos_limit) {
> +    AVIOContext *pb = s->pb;
> +    uint32_t tag;
> +
> +    tag = avio_rb32(pb);
> +    while(!url_feof(pb) && avio_tell(pb) < pos_limit) {
> +        if(tag != MKBETAG('R','T','j','j')) {
> +            tag = (tag << 8) | avio_rb32(pb);

this looks strange, is it intended to shift by 8 and or 32bit in ?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110912/19dbc329/attachment.asc>


More information about the ffmpeg-devel mailing list