[FFmpeg-devel] [PATCH] BFI demuxer
Sisir Koppaka
sisir.koppaka
Sat Apr 12 16:39:56 CEST 2008
On Sat, Apr 12, 2008 at 6:21 PM, Michael Niedermayer <michaelni at gmx.at>
wrote:
> On Sat, Apr 12, 2008 at 12:26:02PM +0530, Sisir Koppaka wrote:
> [...]
> > >
> > >
> > > > + /* Now that the chunk's location is confirmed, we proceed...
> */
> > > > + av_log(NULL, AV_LOG_DEBUG, "\nFound a chunk...");
> > > > + av_log(NULL, AV_LOG_DEBUG,
> > > > + "\nChunk number %d confirmed with IVAS identifier...",
> > > > + bfi->nframes);
> > > > + bfi->chunk_size = get_le32(pb);
> > > > + av_log(NULL, AV_LOG_DEBUG, "\nNext chunk header offset is
> %d",
> > > > + bfi->chunk_size);
> > > > + get_le32(pb);
> > > > + bfi->audio_offset = get_le32(pb);
> > > > + av_log(NULL, AV_LOG_DEBUG, "\nAudio offset is %d",
> > > > + bfi->audio_offset);
> > > > + get_le32(pb);
> > > > + bfi->video_offset = get_le32(pb);
> > > > + av_log(NULL, AV_LOG_DEBUG, "\nVideo offset is %d",
> > > > + bfi->video_offset);
> > > > + bfi->audio_size = bfi->video_offset - bfi->audio_offset;
> > > > + bfi->video_size = bfi->chunk_size - bfi->video_offset;
> > > > + bfi->chunk_header = bfi->chunk_size - bfi->video_offset;
> > > > + av_log(NULL, AV_LOG_DEBUG, "\nReading audio of this
> chunk...");
> > > > + }
> > > > +
> > > > + switch (bfi->avflag) {
> > > > +
> > > > + case 0: //Tossing an audio packet at the
> audio
> > > decoder.
> > > > + ret = av_get_packet(pb, pkt, bfi->audio_size);
> > > > + if (ret < 0)
> > > > + return ret;
> > > > + pkt->stream_index = 1;
> > > > + pkt->pts = bfi->audio_frame;
> > > > + bfi->audio_frame += ret;
> > > > + pkt->duration = 1;
> > >
> > This part of the pkt-> setting should come after av_get_packet,
>
> yes
>
>
> > so couldn't
> > be moved...
>
> It can be moved
>
I merged the switch with the if...else....with a return ret; at the end of
the function.
-----------------
Sisir Koppaka
More information about the ffmpeg-devel
mailing list