[MPlayer-dev-eng] demuxer question

Alexander Neundorf neundorf at dellingsoft.de
Fri May 17 11:33:40 CEST 2002


Hi,

I'm currently writing a raw dv (as played by playdv and produced by dvgrab 
--format raw)  demuxer and decoder using libdv for mplayer.
Video is already working :-)

Now I have a problem with the following function:

int demux_rawdv_fill_buffer(demuxer_t *demuxer) {
   rawdv_frames_t *frames = (rawdv_frames_t *)demuxer->priv;
   sh_video_t *sh_video = demuxer->video->sh;
   stream_seek(demuxer->stream, frames->current_filepos);
   ds_read_packet(demuxer->video, demuxer->stream, frames->frame_size,
          frames->current_frame/sh_video->fps, frames->current_filepos,0);

 /*  if (demuxer->audio) {
      /* put Audio to audio buffer */
      stream_seek(demuxer->stream, frames->current_filepos);
      ds_read_packet (demuxer->audio, demuxer->stream, frames->frame_size,
              frames->current_frame/sh_video->fps, frames->current_filepos,0);
   }*/
   frames->current_filepos+=frames->frame_size;
   frames->current_frame++;
   return 1;
}

Now I don't know exactly how to do the audio part.
The decoding functions for audio and video of libdv both operate on the same 
buffer. Since a dv stream is quite big, it wouldn't be optimal to handle the 
stream twice through mplayer (ok, didn't test yet). 
Is there another way than reading the same frame twice from the file and 
putting it into both the audio- and video "streams" (see the commented-out 
lines) ?

Bye
Alex



More information about the MPlayer-dev-eng mailing list