[FFmpeg-devel] [PATCH] RTMP seek support

Michael Niedermayer michaelni
Sun Apr 11 00:10:11 CEST 2010


On Sat, Apr 10, 2010 at 09:26:31AM -0700, Howard Chu wrote:
> Michael Niedermayer wrote:
>> On Wed, Apr 07, 2010 at 08:48:44AM -0700, Howard Chu wrote:
>>> Michael Niedermayer wrote:
>>>> so will you fix it? or will you knowingly round the wrong direction
>>>> because there are other unrelated problems?
>>>
>>> I've been trying to fix it. But while you're telling me that it's wrong, 
>>> no
>>> one is telling me how to do it right.
>>
>> av_rescale_rnd() in this case
>
> One more go-round.
[...]

> Index: libavformat/librtmp.c
> ===================================================================
> --- libavformat/librtmp.c	(revision 22813)
> +++ libavformat/librtmp.c	(working copy)
> @@ -124,10 +141,12 @@
>      RTMP *r = s->priv_data;
>  
>      if (flags & AVSEEK_FLAG_BYTE)
> -        return AVERROR_NOTSUPP;
> +        return AVERROR(ENOSYS);
>  
>      /* seeks are in milliseconds */
> -    timestamp = av_rescale(timestamp, AV_TIME_BASE, 1000);
> +    if (stream_index < 0)
> +        timestamp = av_rescale_rnd(timestamp, 1000, AV_TIME_BASE, AV_ROUND_DOWN);

the rounding direction depends on the the flags for the old seeking
API


> +
>      if (!RTMP_SendSeek(r, timestamp))
>          return -1;
>      return timestamp;

> Index: libavformat/aviobuf.c
> ===================================================================
> --- libavformat/aviobuf.c	(revision 22813)
> +++ libavformat/aviobuf.c	(working copy)
> @@ -698,8 +698,11 @@
>          return AVERROR(ENOSYS);
>      ret = s->read_seek(h, stream_index, timestamp, flags);
>      if(ret >= 0) {
> +        int64_t pos;
>          s->buf_ptr = s->buf_end; // Flush buffer
> -        s->pos = s->seek(h, 0, SEEK_CUR);
> +        pos = s->seek(h, 0, SEEK_CUR);
> +        if (pos != AVERROR(ENOSYS))
> +            s->pos = pos;
>      }
>      return ret;
>  }

this should be a seperate patch

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- 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/20100411/c8d79a3d/attachment.pgp>



More information about the ffmpeg-devel mailing list