> Just to cover the obvious... you aren't passing audio (or subtitle)
> packets to the video decoder are you?
>
No, here is more of the code :
else if (pkt->stream_index == is->video_stream) {
AVCodecContext *pCodecCtx = ic->streams[pkt->stream_index]->codec;
pFrame=avcodec_alloc_frame();
pFrameRGB=avcodec_alloc_frame();
if(pFrameRGB==NULL)
return -1;
numBytes=avpicture_get_size(PIX_FMT_RGB24, 320,
240);
buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
avpicture_fill((AVPicture
*)pFrameRGB, buffer, PIX_FMT_RGB24,
320, 240);
i=0;
while(av_read_frame(ic, pkt)>=0)
{
// Decode video frame
avcodec_decode_video(pCodecCtx, pFrame,
&frameFinished,
pkt->data, pkt->size);
//Did we get a video frame?
if(frameFinished) {
//Convert the image from its
native format to RGB
// img_convert((AVPicture
*)pFrameRGB, PIX_FMT_RGB24,
//(AVPicture*)pFrame,
pCodecCtx->pix_fmt, &pCodecCtx->width,
//pCodecCtx->height);
//Save the frame to disk
if(++i>=5)
{
SaveFrame2(pFrame,
pCodecCtx->width, pCodecCtx->height, i);
}
}
av_free_packet(pkt);
}
As You can see, I'm working with video stream. Audio is decoded before, and I
can hear a bit of it playing before crash. No subtitles are present.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user