[FFmpeg-devel] Fix FFM-based audio streaming from FFmpeg to FFserver

Michael Niedermayer michaelni
Tue Mar 16 23:02:07 CET 2010


On Tue, Mar 16, 2010 at 02:21:55PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Tue, Mar 16, 2010 at 1:37 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Tue, Mar 16, 2010 at 10:08:14AM -0400, Ronald S. Bultje wrote:
> >> On Tue, Mar 16, 2010 at 9:58 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> >> > and it must be clear how to free these contexts
> >>
> >> avcodec_free_context()? :-). (I know, doesn't exist, "shall I implement ..".)
> >
> > the clone should be identical to the original ideally and thus be freed
> > like the original
> 
> I'm affraid free()ing AVCodecContext is a bit of a mess.

well then this is a sperate problem that should be fixed


> 
> I suppose what I should do instead is create a local function for

my interrest in this just droped by 99%
a clone function is usefull, yet another local hack for a special case
is unmaintainable. It will break in no time, especially without regression
tests. And with reg tests i know i will curse the continous need to
fix it after every second addition to AVCodecContext.
Sorry but i think any design for which a addition to AVCodecContext in
avcodec.h requires one to go over the source and to update all the local
hacks that copy it (for rt*p, for ffserver, ...) is not practical



> ctx-copying, and then (in the function, as you suggest):

> - extradata should be NULL, because the encoder should set it

that wont work for decoders and it wont work once te encoder has been
inited


> - rc_eq should be owned by me (and thus duplicated) as per its doxy in avcodec.h

yes, probably


> - priv_data should be NULL, because it's set/owned by encoder

yes, probably


> - rc_override, slice_offset, get_formats, internal_buffer? All these
> would be initialized to their default value in this particular case,
> which would work, but then the function might not be as broadly
> appliccable as wanted.

yes, but please keep a full list of fields in the source of the clone
function that are not completely correctly copied so one does not
end with a "ohh well which fields are left? ... compares clone() and
struct definiton for hours"


> - intra_matrix, inter_matrix,

alloc + copy id guess or NULL with comment in source that we skiped them


> palctrl,

NULL as deprecated


> reget_buffer, execute,
> thread_opaque, hwaccel, execute2?

NULL as useless without priv_data

Also maybe you can use AVOption to simplify copying. (and we can extend
AVOptions if you have ideas that would simplify clone())

[...]
-- 
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/20100316/93783a9f/attachment.pgp>



More information about the ffmpeg-devel mailing list