[FFmpeg-soc] Safe to use AVPacket::priv for pointing to AVFormatContext when using playlist?

Baptiste Coudurier baptiste.coudurier at gmail.com
Fri Jun 12 10:08:38 CEST 2009


On 6/12/2009 12:52 AM, Geza Kovacs wrote:
> Hi all,
> 
> Since (in ffplay) the decode_thread for audio and video lags the packet
> buffering thread, in the case when different packets were read by
> different demuxers and need to be decoded using different decoders (ie
> h264/aac in mp4 followed by theora/vorbis in ogg in a playlist), it
> appears it's necessary to keep track of the AVFormatContext which read
> that packet in order to determine the decoder to use for that particular
> packet. Thus I'd like to store said pointer somewhere accessible to the
> decoder thread, and associated with each packet.
> 
> Since AVPacket::priv appears to be used only by mmap_read_frame() and
> mmap_release_buffer(), which is only used by Video4Linux, is it safe to
> use that variable for storing the pointer to AVFormatContext or should I
> create a new variable in AVPacket for this (which to my understanding
> would break ABI compatibility with older versions)?

It seems AVPacket->priv is private to the demuxer so I guess it must not
be altered by something else nor accessed outside the demuxer.

Maybe a new stream should be added in this case and the finished one
should be closed. pkt->stream_index will then point to the correct stream.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org


More information about the FFmpeg-soc mailing list