[FFmpeg-devel] Google Summer of Code participation

Michael Niedermayer michaelni
Wed Apr 8 15:41:16 CEST 2009


On Wed, Apr 08, 2009 at 02:00:24AM +0200, Thilo Borgmann wrote:
>
>
> Michael Niedermayer schrieb:
>>> Alternatively I can change the function in place and the calling 
>>> av_find_stream_info too, maybe in a seperate patch... this would avoid 
>>> unnecessary "crowding"...
>>>     
>>
>> yes please do
>>
>>   
> This is patch "tb.changedTry_decode_frame.patch" then.
>
>
>
>
> Michael Niedermayer schrieb:
>>
>>> @@ -1586,9 +1586,9 @@ static int audio_decode_frame(VideoState *is, 
>>> double *pts_ptr)
>>>          /* NOTE: the audio packet can contain several frames */
>>>          while (is->audio_pkt_size > 0) {
>>>              data_size = sizeof(is->audio_buf1);
>>> -            len1 = avcodec_decode_audio2(dec,
>>> +            len1 = avcodec_decode_audio3(dec,
>>>                                          (int16_t *)is->audio_buf1, 
>>> &data_size,
>>> -                                        is->audio_pkt_data, 
>>> is->audio_pkt_size);
>>> +                                        pkt);
>>>              if (len1 < 0) {
>>>                  /* if error, we skip the frame */
>>>                  is->audio_pkt_size = 0;
>>>     
>>
>> is that the same?
>>
>>   
> Fixed in revision 2.
> The last two lines which are altered in ffplay.c (audio_decode_frame):
> ::::
> -        is->audio_pkt_data = pkt->data;
> -        is->audio_pkt_size = pkt->size;
> +        avpkt.data = pkt->data;
> +        avpkt.size = pkt->size;
> ::::
> These may have become deprecated now, as the original 
> is->audio_pkt_{data,size} are not changed anymore. I may be wrong but I 
> think these two lines are for cleaning up. If I'm right, these can be 
> deleted now but I'm not 110% sure about that, may be you'll have a look.

your change to ffplay.c still looks wrong

also maybe you could split the patch a little the changes to ffplay dont
depend on changes to ffmpeg nor apiexample ...

[...]

> diff --git a/libavcodec/api-example.c b/libavcodec/api-example.c
> index 2a47fea..45eaa5b 100644
> --- a/libavcodec/api-example.c
> +++ b/libavcodec/api-example.c
> @@ -115,10 +115,14 @@ static void audio_decode_example(const char *outfilename, const char *filename)
>  {
>      AVCodec *codec;
>      AVCodecContext *c= NULL;
> -    int out_size, size, len;
> +    int out_size, len;
>      FILE *f, *outfile;
>      uint8_t *outbuf;
> -    uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE], *inbuf_ptr;
> +    uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
> +    AVPacket avpkt;
> +

> +    /* initialize the packet */
> +    av_init_packet(&avpkt);

the comment is useless, it just repeats the name of the function

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- 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/20090408/427e8263/attachment.pgp>



More information about the ffmpeg-devel mailing list