Play partial rar sets, why no support?
#1
I wounder if anyone of the developers could explain why it's not possible to start playing partial rar sets of movies? Is it on purpose or ?
I have tested and verified its possible to trick XBMC to start playing a movie by creating empty rar files (only 7 byte rar header). Once started its possible to remove all empty files.
Apparently XBMC scans for the files at start and only plays a few frames if the set is not complete.
Anyone got any pointers to the code where this might be fixed?


Background: Have developed a nzb streaming addon and would really like to skip tricking XBMC to play partial rar sets...
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#2
it's actually almost supported.

see FileRar.cpp l174. 'noidx' refers to mplayer -noidx from the xbox days.
you need to use this code to set the the is_streamed flag in the demuxer, see DVDDemuxFFmpeg.cpp l310
Reply
#3
Thanks! I'll look into if I understand anything ;D
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#4
And I dont... Sad
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#5
Looked a bit more at the code:

Code:
// perform 'noidx' check
      CFileInfo* pFile = g_RarManager.GetFileInRar(m_strRarPath,m_strPathInRar);
      if (pFile)
      {
        if (pFile->m_iIsSeekable == -1)
        {
          if (Seek(-1,SEEK_END) == -1)
          {
            m_bSeekable = false;
            pFile->m_iIsSeekable = 0;
          }
        }
        else
          m_bSeekable = (pFile->m_iIsSeekable == 1);
      }
From what I understand the "if (pFile->m_iIsSeekable == -1) {" will always be true since m_iIsSeekable is set static to -1 in RarManager. But then I get lost with the Seekable stuff. From what I understand it needs to be set to false to assume it's streamed but then in DVDDemuxFFmpeg.cpp " it is checked if its possible to seek within the file
Code:
if(m_pInput->Seek(0, SEEK_POSSIBLE) == 0)
.

So in one case we are checking if we can seek to the end and in the other if its possible to seek...

I'm probably on the completely wrong track and just babbling Big Grin
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#6
not really, the SEEK_POSSIBLE is the new wine, written after the code you quote. basically, you have to do that test when SEEK_POSSIBLE is performed, and return false if we can't seek. the is_streamed flag should then be set iirc and all is good.
Reply
#7
Does the is_streamed flag stop you from jumping/seeking in the stream?
Is the SEEK_POSSIBLE test really correct to do? in the case of a incomplete rar set, from the moment the movie start it's just possible to seek to the end of the last downloaded rar, but this is constantly changing as the download continues..
Actually I'm not 100% sure what happens when I make the "fake" rars ...
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#8
is_streamed is the way to go about it. it will

1) allow growing files
2) disable seeking.

in particular for avi's, where the index is stored at the end of the file, 2) is imperative. if it's not done, an index will be calculated, only containing entries for the data that was avail when the index is created, thus you can't have growing files.
Reply
#9
I have been thinking about this for quite some time Big Grin .

When trying to play a incomplete rar set the movie flickers and then log states
PHP Code:
XFILE::CFileRar::Seek Timeout waiting for seek to finish 

When looking at the code in FileRar.cpp line 452

PHP Code:
m_pExtract->GetDataIO().SetUnpackToMemory(m_szBuffer,MAXWINMEMSIZE);
  
m_pExtract->GetDataIO().hSeek->Set();
  
m_pExtract->GetDataIO().hBufferFilled->Set();
  if( !
m_pExtract->GetDataIO().hSeekDone->WaitMSec(SEEKTIMOUT))
  {
    
CLog::Log(LOGERROR"%s - Timeout waiting for seek to finish"__FUNCTION__);
    return -
1;
  } 

I'm not sure where it comes from, but the check in line 309 in DVDDemuxFFmpeg.cpp
PHP Code:
if(m_pInput->Seek(0SEEK_POSSIBLE) == 0)
      
m_ioContext->is_streamed 1
is not returning the correct result (imho) or should the check be extended with a check if its a rar we are playing and if we cant SEEK_END we m_ioContext->is_streamed = 1 ?
I suck at C++ so bear with me..
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#10
FWIW, there is a bug with some info on the current state of affairs.. here :

http://trac.xbmc.org/ticket/6888

If you end up resolving this issue, you could probably also resolve this ticket! Big Grin

=darwin
Reply
#11
darwin Wrote:FWIW, there is a bug with some info on the current state of affairs.. here :

http://trac.xbmc.org/ticket/6888

If you end up resolving this issue, you could probably also resolve this ticket! Big Grin

=darwin


Thanks for the info! I updated the trac ticket with my findings, just hope someone who can code knows what to do.. Big Grin
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#12
If I understand spiff correctly, you need to alter CFileRar::Seek so that if SEEK_POSSIBLE is the requested seek mode, you try and seek to the end of the file. If that returns -1 (i.e. the seek to the end of file failed) then we know that seeking is not working, so return 0 from the SEEK_POSSIBLE call. So something like:
Code:
if (we've been passed SEEK_POSSIBLE)
{
  if (Seek(-1, SEEK_END) == -1)
    return 0;
  return (whatever is supposed to be returned in the case of SEEK_POSSIBLE working);
}
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Play partial rar sets, why no support?0