[FFmpeg-devel] [PATCH 2/7] lavf: factor AVStream st out
Michael Niedermayer
michaelni at gmx.at
Wed Jul 25 00:45:31 CEST 2012
On Wed, Jul 25, 2012 at 12:35:31AM +0200, Stefano Sabatini wrote:
> On date Tuesday 2012-07-24 18:15:34 +0200, Michael Niedermayer encoded:
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> > libavformat/utils.c | 10 ++++++----
> > 1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > index e348fbd..fba08aa 100644
> > --- a/libavformat/utils.c
> > +++ b/libavformat/utils.c
> > @@ -1383,6 +1383,7 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
> > const int genpts = s->flags & AVFMT_FLAG_GENPTS;
> > int eof = 0;
> > int ret;
> > + AVStream *st;
> >
> > if (!genpts) {
> > ret = s->packet_buffer ? read_from_packet_buffer(&s->packet_buffer,
> > @@ -1452,11 +1453,12 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
> >
> > return_packet:
> >
> > - if(s->streams[pkt->stream_index]->skip_samples) {
> > + st = s->streams[pkt->stream_index];
>
> > + if(st->skip_samples) {
>
> nit: if_(...
>
> > uint8_t *p = av_packet_new_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES, 10);
> > - AV_WL32(p, s->streams[pkt->stream_index]->skip_samples);
> > - av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %d\n", s->streams[pkt->stream_index]->skip_samples);
> > - s->streams[pkt->stream_index]->skip_samples = 0;
> > + AV_WL32(p, st->skip_samples);
> > + av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %d\n", st->skip_samples);
> > + st->skip_samples = 0;
> > }
> >
>
> Looks good otherwise, thanks.
applied
thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- 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/20120725/7a9ee3d7/attachment.asc>
More information about the ffmpeg-devel
mailing list