Subtitles disappears?

Jan 3, 2012 at 3:36 PM

I'm using version 2.2011.1101.0 build from source and I have built a player which depends on Core, TimedText, Utilities, Plugins and SmoothStreaming with the various nested dependencies.

I'm playing back a stream with SUBT subtitles and the first time it is played, I can see subtitles. Then I play another stream with subtitles and that too is working perfectly. Going back to the previous stream again causes the subtitles to disappear and no subtitles are ever shown again no matter what stream I play back.

It seems to be related to caching. Using wireshark I can see the player is requesting the chunks of subtitles but only the first time, then the requests are no longer hitting the network and I can only assume they are handled by the browser cache.

Are there anyone out there how has this working or has experienced something similar?

Jan 3, 2012 at 6:13 PM

The format of the subtitles are SUBT and it is initially being parsed with InStreamTimedTextPlugin. When it is working the Player_DataReceived is being called, but that part isn't called when the problem shows it self. 

A couple of answers on the following questions could help me get to the bottom of this:

Can I assume from the above that it isn't the rendering that is at fault here?

The Player_DataReceived method is called when another plugin has received date right?

I guess the "other plugin" is a chunk downloader of the smooth streaming sort. Is this running in a separate thread?

I sorry to say that I don't grasp all what is going on, but answers to the above questions would help me a lot.

Jul 29, 2013 at 9:44 AM
I also have the same problem.
have you sloved it?
Jul 29, 2013 at 10:50 AM
Didn't find a bug in the code but I changed the subtitle pulling strategy to be agressive ie. all subtitles are pulled when the movie starts.
Jul 30, 2013 at 8:55 AM
Thanks for your reply!But i still do not know how to do.
I have read the SMF source code for several times, i am puzzled that why the captions disappear suddenly. Yes! suddenly!
so, if you can describe more, i will appreciate it .
Regards.
Aug 2, 2013 at 9:26 AM
I have sloved this problem!

Move the code "_refreshTimer.Tick += _refreshTimer_Tick; " from ChunkDownloadManager constructor to AddRequest method.
Aug 2, 2013 at 11:10 AM
Great news. May I suggest you submit a fix on https://bitbucket.org/tchristensen/mmp-player-framework ? (not official source for the project but a publication I have done since the code wasn't available under public SCM).
Aug 2, 2013 at 11:24 AM
Could you elaborate how this change works? As I read the current code, the Tick method is set when the ChunkDownloadManager is created and unset when the ChunkDownloadManager instance is disposed. Are you suggesting that the DispatchTimer looses the Tick methods somewhere along the way?
Aug 5, 2013 at 2:58 AM
I thought that's because MEF feature(Import,Export).
As we know that the error always happens on the second time.
you saying right:the Tick method is set when the ChunkDownloadManager is created and unset when the ChunkDownloadManager instance is disposed.
Actually, the ChunkDownloadManager as IMediaPlugin is a Singleton .I did not see all the source code,but i noticed ExportPluginAttribute feature something like that.
So the second time ,the constructor will not be executed,which means the _refreshTimer_Tick method will lose .
Aug 6, 2013 at 8:10 AM
yuanstef wrote:
I thought that's because MEF feature(Import,Export).
As we know that the error always happens on the second time.
you saying right:the Tick method is set when the ChunkDownloadManager is created and unset when the ChunkDownloadManager instance is disposed.
Actually, the ChunkDownloadManager as IMediaPlugin is a Singleton .I did not see all the source code,but i noticed ExportPluginAttribute feature something like that.
So the second time ,the constructor will not be executed,which means the _refreshTimer_Tick method will lose .
So like this - ie added to both AddRequest and AddRequests?
        /// <summary>
        /// Optimized version designed for adding multiple requests at once
        /// </summary>
        public void AddRequests(IEnumerable<Tuple<MediaTrack, TimeSpan>> Requests)
        {
            foreach (var Request in Requests)
            {
                _requests.Add(new DownloadRequest(Request.Item1, Request.Item2));
            }
            NotifyRequestAdded();

            if (ChunkDownloadStrategy == ChunkDownloadStrategy.AsNeeded && !_refreshTimer.IsEnabled)
            {
                _refreshTimer.Tick += _refreshTimer_Tick;
                _refreshTimer.Start();
                _mediaPlugin.SeekCompleted += new Action<IMediaPlugin>(_mediaPlugin_SeekCompleted);
            }
        }

        public void AddRequest(MediaTrack track, TimeSpan chunkTimestamp)
        {
            var request = new DownloadRequest(track, chunkTimestamp);
            _requests.Add(request);
            NotifyRequestAdded();

            if (ChunkDownloadStrategy == ChunkDownloadStrategy.AsNeeded && !_refreshTimer.IsEnabled)
            {
                _refreshTimer.Tick += _refreshTimer_Tick;
                _refreshTimer.Start();
                _mediaPlugin.SeekCompleted += new Action<IMediaPlugin>(_mediaPlugin_SeekCompleted);
            }
        }
Aug 7, 2013 at 6:30 AM
Edited Aug 8, 2013 at 3:38 AM
The AddRequests Method will always run when we try to change audio or caption stream,but AddRequest method won't.

In my opinion,the AddRequest Method doesn't need to add the code.