// If created, then initialise from properties
if ( st != NULL )
{
- AVCodecContext *c = &st->codec;
+ AVCodecContext *c = st->codec;
c->codec_id = codec_id;
c->codec_type = CODEC_TYPE_AUDIO;
int audio_input_frame_size = 0;
// Get the context
- AVCodecContext *c = &st->codec;
+ AVCodecContext *c = st->codec;
// Find the encoder
AVCodec *codec = avcodec_find_encoder( c->codec_id );
if ( c->frame_size <= 1 )
{
audio_input_frame_size = audio_outbuf_size / c->channels;
- switch(st->codec.codec_id)
+ switch(st->codec->codec_id)
{
case CODEC_ID_PCM_S16LE:
case CODEC_ID_PCM_S16BE:
static void close_audio( AVFormatContext *oc, AVStream *st )
{
- avcodec_close( &st->codec );
+ avcodec_close( st->codec );
}
/** Add a video output stream
if ( st != NULL )
{
- AVCodecContext *c = &st->codec;
+ AVCodecContext *c = st->codec;
c->codec_id = codec_id;
c->codec_type = CODEC_TYPE_VIDEO;
static int open_video(AVFormatContext *oc, AVStream *st)
{
// Get the codec
- AVCodecContext *video_enc = &st->codec;
+ AVCodecContext *video_enc = st->codec;
// find the video encoder
AVCodec *codec = avcodec_find_encoder( video_enc->codec_id );
void close_video(AVFormatContext *oc, AVStream *st)
{
- avcodec_close(&st->codec);
+ avcodec_close(st->codec);
}
static inline long time_difference( struct timeval *time1 )
// Allocate picture
if ( video_st )
- output = alloc_picture( video_st->codec.pix_fmt, width, height );
+ output = alloc_picture( video_st->codec->pix_fmt, width, height );
// Last check - need at least one stream
if ( audio_st == NULL && video_st == NULL )
AVPacket pkt;
av_init_packet( &pkt );
- c = &audio_st->codec;
+ c = audio_st->codec;
sample_fifo_fetch( fifo, buffer, channels * audio_input_frame_size );
frame = mlt_deque_pop_front( queue );
frame_properties = MLT_FRAME_PROPERTIES( frame );
- c = &video_st->codec;
+ c = video_st->codec;
if ( mlt_properties_get_int( frame_properties, "rendered" ) )
{
}
}
- img_convert( ( AVPicture * )output, video_st->codec.pix_fmt, ( AVPicture * )input, PIX_FMT_YUV422, width, height );
+ img_convert( ( AVPicture * )output, video_st->codec->pix_fmt, ( AVPicture * )input, PIX_FMT_YUV422, width, height );
}
if (oc->oformat->flags & AVFMT_RAWPICTURE)
for( i = 0; i < context->nb_streams; i++ )
{
// Get the codec context
- AVCodecContext *codec_context = &context->streams[ i ]->codec;
+ AVCodecContext *codec_context = context->streams[ i ]->codec;
// Determine the type and obtain the first index of each type
switch( codec_context->codec_type )
AVStream *stream = context->streams[ index ];
// Get codec context
- AVCodecContext *codec_context = &stream->codec;
+ AVCodecContext *codec_context = stream->codec;
// Packet
AVPacket pkt;
AVStream *stream = context->streams[ index ];
// Get codec context
- AVCodecContext *codec_context = &stream->codec;
+ AVCodecContext *codec_context = stream->codec;
// Get the codec
AVCodec *codec = mlt_properties_get_data( properties, "video_codec", NULL );
AVStream *stream = context->streams[ index ];
// Get codec context
- AVCodecContext *codec_context = &stream->codec;
+ AVCodecContext *codec_context = stream->codec;
// Packet
AVPacket pkt;
AVStream *stream = context->streams[ index ];
// Get codec context
- AVCodecContext *codec_context = &stream->codec;
+ AVCodecContext *codec_context = stream->codec;
// Get the codec
AVCodec *codec = mlt_properties_get_data( properties, "audio_codec", NULL );