[FFmpeg-devel] [PATCH] R3D REDCODE demuxer
Michael Niedermayer
michaelni
Mon Jan 19 23:51:54 CET 2009
On Sun, Jan 18, 2009 at 05:42:36PM -0800, Baptiste Coudurier wrote:
> Hi Michael,
>
> Michael Niedermayer wrote:
[...]
> >> [...]
> >> +
> >> + st->filename = av_mallocz(258);
> >> + if (!st->filename)
> >> + return AVERROR(ENOMEM);
> >> + get_buffer(s->pb, st->filename, 257);
> >> + dprintf(s, "filename %s\n", st->filename);
> >
> > it might be cleaner to merge all the dprintf() and put them at the end of
> > each function
>
> Ok, factorized some debug print.
hmm, ive more thought of something like what is done in h264.c:
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
av_log(h->s.avctx, AV_LOG_DEBUG, "slice:%d %s mb:%d %c%s%s pps:%u frame:%d poc:%d/%d ref:%d/%d qp:%d loop:%d:%d:%d weight:%d%s %s\n",
h->slice_num,
(s->picture_structure==PICT_FRAME ? "F" : s->picture_structure==PICT_TOP_FIELD ? "T" : "B"),
first_mb_in_slice,
av_get_pict_type_char(h->slice_type), h->slice_type_fixed ? " fix" : "", h->nal_unit_type == NAL_IDR_SLICE ? " IDR" : "",
pps_id, h->frame_num,
s->current_picture_ptr->field_poc[0], s->current_picture_ptr->field_poc[1],
h->ref_count[0], h->ref_count[1],
s->qscale,
h->deblocking_filter, h->slice_alpha_c0_offset/2, h->slice_beta_offset/2,
h->use_weight,
h->use_weight==1 && h->use_weight_chroma ? "c" : "",
h->slice_type == FF_B_TYPE ? (h->direct_spatial_mv_pred ? "SPAT" : "TEMP") : ""
);
but its your code, this is just how i would do it, a nice sideeffect is that
no #define DEBUG & recompile is needed to see the stuff
>
> > [...]
> >> +static int r3d_read_reos(AVFormatContext *s)
> >> +{
> >> + R3DContext *r3d = s->priv_data;
> >> + int tmp;
> >> +
> >> + r3d->rdvo_offset = get_be32(s->pb);
> >> + get_be32(s->pb); // rdvs offset
> >> + get_be32(s->pb); // rdao offset
> >> + get_be32(s->pb); // rdas offset
> >> +
> >> + tmp = get_be32(s->pb);
> >> + dprintf(s, "num video chunks %d\n", tmp);
> >> +
> >> + tmp = get_be32(s->pb);
> >> + dprintf(s, "num audio chunks %d\n", tmp);
> >> +
> >> + url_fskip(s->pb, 6*4);
> >> + return 0;
> >> +}
> >
> > always returns 0 thus doesnt need to return anything yet
>
> Changed.
>
> Thanks for the review. Updated patch attached.
looks ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- 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/20090119/86e48388/attachment.pgp>
More information about the ffmpeg-devel
mailing list