Browse Source

avf: fix audio writing in the output-example

av_init_packet does not reset data and size fields in AVPacket,
avcodec_encode_audio2 can use preallocated AVPacket.
tags/n0.11
Luca Barbato 13 years ago
parent
commit
28db30aa29
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/output-example.c

+ 1
- 1
libavformat/output-example.c View File

@@ -138,7 +138,7 @@ static void get_audio_frame(int16_t *samples, int frame_size, int nb_channels)
static void write_audio_frame(AVFormatContext *oc, AVStream *st)
{
AVCodecContext *c;
AVPacket pkt;
AVPacket pkt = { 0 }; // data and size must be 0;
AVFrame *frame = avcodec_alloc_frame();
int got_packet;



Loading…
Cancel
Save