[MPlayer-cvslog] r37259 - trunk/command.c

ib subversion at mplayerhq.hu
Thu Aug 28 21:34:05 CEST 2014


Author: ib
Date: Thu Aug 28 21:34:05 2014
New Revision: 37259

Log:
Check existence of a demuxer when updating global_sub_size.

The GUI may call mpctx_get_global_sub_info() which forces
updating global_sub_size even if there isn't yet a demuxer.

This closes Trac #2201.

Modified:
   trunk/command.c

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	Thu Aug 28 20:36:23 2014	(r37258)
+++ trunk/command.c	Thu Aug 28 21:34:05 2014	(r37259)
@@ -155,7 +155,7 @@ static void update_global_sub_size(MPCon
 
     // update number of demuxer sub streams
     for (i = 0; i < MAX_S_STREAMS; i++)
-        if (mpctx->demuxer->s_streams[i])
+        if (mpctx->demuxer && mpctx->demuxer->s_streams[i])
             cnt++;
     if (cnt > mpctx->sub_counts[SUB_SOURCE_DEMUX])
         mpctx->sub_counts[SUB_SOURCE_DEMUX] = cnt;
@@ -168,7 +168,7 @@ static void update_global_sub_size(MPCon
     // update global_sub_pos if we auto-detected a demuxer sub
     if (mpctx->global_sub_pos == -1) {
         int sub_id = -1;
-        if (mpctx->demuxer->sub)
+        if (mpctx->demuxer && mpctx->demuxer->sub)
             sub_id = mpctx->demuxer->sub->id;
         if (sub_id < 0)
             sub_id = dvdsub_id;


More information about the MPlayer-cvslog mailing list