Hi guys

Another problem with '->|' and '|<-'         .....   :-(

dvbcut can save mpgs in one of 4 formats. 
Let me refer to these as A.B.C.D
A = DVD (DVBCUT multiplexer)
B = MPEG program stream (DVBCUT multiplexer)
C = MPEG program stream/DVD (libavformat)
D = MPEG transport stream (libavformat)

dvbcut can load any of the above formats for further editing.
It also loads my NUV files from mythtv (program stream of some sort).

Previously I have been having problems with playaudio after opening 
a NUV file when the current position is close to end of file. 
Michael has provided a fix for that. (Thanks again)

Now I have found reason to save files in format C, and have discovered
that when using dvbcut to re-edit them, the playaudio does not work again.
This is due to 'sh.fileposition > stopreadpos', and is regardless of  
current edit position - i.e. it happens anywhere in the middle of the file, not 
just at the ends.

I think it also happens in older code , so is not due to Michaels latest patch.

I attach a section of mpgfile with additional debug statements.
In particular, the exit points are labelled #1 .. #4

when attempting '->|' in files of format C, playaudio() exits at 
'RETURN #3'. 
when attempting '|<-' then it exits at 'RETURN  #2'

When attempting either '->|' or '|<-' in files of format D then 
playaudio exits at RETURN #2.

For files of format A and B everything is ok.

Is this a 'bug' in the code or a fundamental incomatibility with those formats?

# -----------------------------
code extract from mpgfile::playaudio():
(after applying most recent patch from MR)

  streamhandle sh(idx[seekpic].getpos().packetposition());
  streamdata 
*sd=sh.newstream(audiostream(aud),s[audiostream(aud)].type,istransportstream());

  while (sd->empty()) {
    int streamreader_result = streamreader(sh); // allows extra debug
    //MR original: if (sh.fileposition > stopreadpos || streamreader(sh)<=0)
    if (sh.fileposition > stopreadpos || streamreader_result <= 0)
    {
      //extra debug
      if (sh.fileposition > stopreadpos) fprintf(stderr, "sh.fileposition > 
stopreadpos\n");
      if (streamreader_result <= 0) fprintf(stderr, "streamreader_result <= 
0\n");
      fprintf(stderr, "playaudio()RETURN #2\n");
      return; // data does not reach the point in time from which we like to 
start playing
    }
    while (!sd->empty() &&
           
!(sd->itemlist().begin()->headerhaspts()&&sd->itemlist().begin()->data_alignment_indicator()))
      sd->pop();
    }

  for(;;) {
    int streamreader_result = streamreader(sh); // allows extra debug
    //MR original: (sh.fileposition > stopreadpos || streamreader(sh)<=0)
    if (sh.fileposition > stopreadpos || streamreader_result<=0)
    {
      //extra debug
      if (sh.fileposition > stopreadpos) fprintf(stderr, "sh.fileposition > 
stopreadpos\n");
      if (streamreader_result <= 0) fprintf(stderr, "streamreader_result <= 
0\n");
      fprintf(stderr, "playaudio()RETURN #3\n");
      return; // data does not reach the point in time from which we like to 
start playing
    }
    if (sd->empty())
      continue;



-- 
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com

Powered by Outblaze

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
DVBCUT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dvbcut-user

Reply via email to