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

Ronald S. Bultje rsbultje
Tue Mar 16 19:21:55 CET 2010


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.

I suppose what I should do instead is create a local function for
ctx-copying, and then (in the function, as you suggest):
- extradata should be NULL, because the encoder should set it
- rc_eq should be owned by me (and thus duplicated) as per its doxy in avcodec.h
- priv_data should be NULL, because it's set/owned by encoder
- 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.
- intra_matrix, inter_matrix, palctrl, reget_buffer, execute,
thread_opaque, hwaccel, execute2?
- I'm not doing anything with decoding-specific function pointers such
as get_buffer(), so I can leave those untouched?

Ronald



More information about the ffmpeg-devel mailing list