[FFmpeg-devel] [PATCH 2/2] Support playing SMV files.

Michael Niedermayer michaelni at gmx.at
Tue May 21 22:50:48 CEST 2013


On Tue, May 21, 2013 at 07:21:08PM +0000, Ash Hughes wrote:
> Does this still need more work? ffmpeg now plays and converts all of the samples correctly with this patch, so far as I can see.

seems i forgot about this patch
thanks for the ping

[...]

> +static inline void smv_img_pnt(uint8_t *dst_data[4], uint8_t *src_data[4],
> +                               const int src_linesizes[4],
> +                               enum PixelFormat pix_fmt, int width, int height,
> +                               int nlines)
> +{
> +    const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
> +    int i, planes_nb = 0;
> +
> +    if (desc->flags & PIX_FMT_HWACCEL)
> +        return;
> +
> +    for (i = 0; i < desc->nb_components; i++)
> +        planes_nb = FFMAX(planes_nb, desc->comp[i].plane + 1);
> +
> +    for (i = 0; i < planes_nb; i++) {
> +        int h = height;
> +        if (i == 1 || i == 2) {

> +            h= -((-height)>>desc->log2_chroma_h);

FF_CEIL_RSHIFT()


[...]
> @@ -432,10 +445,13 @@ static int wav_read_packet(AVFormatContext *s,
>  smv_retry:
>          audio_dts = s->streams[0]->cur_dts;
>          video_dts = s->streams[1]->cur_dts;
> +
>          if (audio_dts != AV_NOPTS_VALUE && video_dts != AV_NOPTS_VALUE) {
> -            audio_dts = av_rescale_q(audio_dts, s->streams[0]->time_base, AV_TIME_BASE_Q);
> -            video_dts = av_rescale_q(video_dts, s->streams[1]->time_base, AV_TIME_BASE_Q);
> -            wav->smv_last_stream = video_dts >= audio_dts;
> +            audio_dts = abs(av_rescale_q(audio_dts, s->streams[0]->time_base, AV_TIME_BASE_Q));
> +            video_dts = abs(av_rescale_q(video_dts, s->streams[1]->time_base, AV_TIME_BASE_Q));

what does the abs do here ?

also you might want to add yourself to MAINTAINERS and setup a
public git clone of ffmpeg where you maintain the code if you agree to
maintain it once its in ffmpeg ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130521/38f11be5/attachment.asc>


More information about the ffmpeg-devel mailing list