[FFmpeg-devel] [PATCH] matroska : Fix writing packets to a non-seekable AVIOContext

Michael Niedermayer michaelni at gmx.at
Wed Mar 7 07:24:09 CET 2012


On Tue, Mar 06, 2012 at 03:24:41PM -0800, Aaron Colwell wrote:
> Hi,
> 
> This patch fixes streaming matroska with ffserver. cluster_pos was not
> getting set properly which was causing packet writing to fail elsewhere.
> All the other code in this method uses pb for writing so I believe the
> s->pb here was just a typo.
> 
> Aaron
> 
> ---
>  libavformat/matroskaenc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index 0b36725..6522273 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -1151,7 +1151,7 @@ static int mkv_write_packet_internal(AVFormatContext
> *s, AVPacket *pkt)
>      }
> 
>      if (!mkv->cluster_pos) {
> -        mkv->cluster_pos = avio_tell(s->pb);
> +        mkv->cluster_pos = avio_tell(pb);

I think the problem is that ffserver produces avio_tell() == 0 values
and that causes
"if (mkv->cluster_pos &&"
to fail
but iam guessing here a bit from your description of what the problem
is so i could be wrong

If that is correct then to fix it, i think the best would be either to
make ffserver produce normal advancing url_tell() values
or
To change the default "not set" value of cluster_pos to something else
than 0 and change all the checks as well.


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

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- 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/20120307/ac7c701f/attachment.asc>


More information about the ffmpeg-devel mailing list