[FFmpeg-devel] patch for libdc1394.c

Alessandro Sappia a.sappia
Sun Jan 6 02:18:32 CET 2008


Alessandro Sappia ha scritto:
> Roman Shaposhnik ha scritto:
>   
>     
>   
>>    I see no reason for this change.
>>
>>   
>>     
> well, launching with no fps or no video mode defined,
> the current logic ends with a non working fps and video mode
>
> the current logic is:
>     for (fmt = dc1394_frame_formats; fmt->width; fmt++)
>          if (fmt->pix_fmt == ap->pix_fmt && fmt->width == ap->width &&
> fmt->height == ap->height)
>                break;
>
> as you may check, it no ap->pix_fmt,ap->width, ap->height, the choice of
> this for
> will be the last (default) one.
> That's not a problem for libdc1394 because it will always get the right
> default value, but
> (lines 93 and following)?
>     vst->codec->time_base.den = fps->frame_rate;
>     vst->codec->time_base.num = 1000;
>     vst->codec->width = fmt->width;
>     vst->codec->height = fmt->height;
>     vst->codec->pix_fmt = fmt->pix_fmt;
>
> As you may see the above logic set a non working framerate den (0)
> and wrong width, height, pix_fmt.
>
> this end up in a
> picture size invalid (0x0)
> [libdc1394 @ 0x8417854]Can't prepare camera for the DMA capture
>
> (output from the clean source tree)
>   
and... moreover, on line 161 of libdc1394.c, in function dc1394_read_packet
there is a
dc1394->packet.pts = (dc1394->current_frame * 1000000) / dc1394->fps;
obsiouvly the default value (zero) leads to a FPE.

My two cents

Alessandro




More information about the ffmpeg-devel mailing list