[FFmpeg-devel] Google Summer of Code participation
Michael Niedermayer
michaelni
Wed Apr 8 23:36:45 CEST 2009
On Wed, Apr 08, 2009 at 11:29:25PM +0200, Thilo Borgmann wrote:
>
>
> Michael Niedermayer schrieb:
>> On Wed, Apr 08, 2009 at 07:39:41PM +0200, Thilo Borgmann wrote:
>>
>>> Ok. I see two possibilities in that case.
>>> First, assure that the context variables are assigned the value before
>>> leaving the function or
>>> second, to use a local AVPacket just before the call to
>>> avcodec_decode_audio3() and let the context variables be used for
>>> iterating through the buffer.
>>> Which one do you like more or another possibility?
>>>
>>
>> Put a AVPacket in the context and use that
>>
> I've had another look into ffplay and I hope that I got the clue now and
> that this patch fits... please let me know.
>
> TB
> diff --git a/ffplay.c b/ffplay.c
> index 18422e2..d48e009 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -135,9 +135,8 @@ typedef struct VideoState {
> uint8_t *audio_buf;
> unsigned int audio_buf_size; /* in bytes */
> int audio_buf_index; /* in bytes */
> + AVPacket avpkt;
i would prefer audio_pkt_temp as name
[...]
> @@ -1797,6 +1797,7 @@ static int stream_component_open(VideoState *is, int stream_index)
> is->audio_diff_threshold = 2.0 * SDL_AUDIO_BUFFER_SIZE / enc->sample_rate;
>
> memset(&is->audio_pkt, 0, sizeof(is->audio_pkt));
> + memset(&is->avpkt, 0, sizeof(is->avpkt));
> packet_queue_init(&is->audioq);
> SDL_PauseAudio(0);
> break;
is this needed?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- 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/0807f2f1/attachment.pgp>
More information about the ffmpeg-devel
mailing list