[vlc-commits] DCP: kill warnings

Jean-Baptiste Kempf git at videolan.org
Wed Feb 19 16:24:51 CET 2014


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Feb 19 16:18:53 2014 +0100| [50f1dcb7204dad1d5ed017eee2ade85d07d57701] | committer: Jean-Baptiste Kempf

DCP: kill warnings

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=50f1dcb7204dad1d5ed017eee2ade85d07d57701
---

 modules/access/dcp/dcp.cpp       |   26 +++++++++++++-------------
 modules/access/dcp/dcpparser.cpp |   12 ++++++++++++
 modules/access/dcp/dcpparser.h   |    2 +-
 3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/modules/access/dcp/dcp.cpp b/modules/access/dcp/dcp.cpp
index 06ad48a..578ac91 100644
--- a/modules/access/dcp/dcp.cpp
+++ b/modules/access/dcp/dcp.cpp
@@ -136,17 +136,17 @@ class demux_sys_t
     uint32_t frame_no;
 
     /* frame rate */
-    unsigned int frame_rate_num;
-    unsigned int frame_rate_denom;
+    int frame_rate_num;
+    int frame_rate_denom;
 
     /* total number of frames */
     uint32_t frames_total;
 
     /* current video reel */
-    int i_video_reel;
+    unsigned int i_video_reel;
 
     /* current audio reel */
-    int i_audio_reel;
+    unsigned int i_audio_reel;
 
     uint8_t i_chans_to_reorder;            /* do we need channel reordering */
     uint8_t pi_chan_table[AOUT_CHAN_MAX];
@@ -156,8 +156,8 @@ class demux_sys_t
 
     demux_sys_t():
         PictureEssType ( ESS_UNKNOWN ),
-        v_videoReader( NULL ),
-        v_audioReader( NULL ),
+        v_videoReader(),
+        v_audioReader(),
         p_video_es( NULL ),
         p_audio_es( NULL ),
         p_dcp( NULL ),
@@ -318,7 +318,7 @@ static int Open( vlc_object_t *obj )
 
     /* Open video file */
     EssenceType_t essInter;
-    for ( int i = 0; i < ( p_sys->p_dcp->video_reels.size() ); i++ )
+    for ( size_t i = 0; i < ( p_sys->p_dcp->video_reels.size() ); i++ )
     {
         EssenceType( p_sys->p_dcp->video_reels[i].filename.c_str(), essInter );
         if ( i == 0 )
@@ -487,14 +487,14 @@ static int Open( vlc_object_t *obj )
     if ( (AudioEssType == ESS_PCM_24b_48k) || (AudioEssType == ESS_PCM_24b_96k) ) {
         PCM::AudioDescriptor AudioDesc;
 
-        for ( int i=0; i < ( p_sys->p_dcp->audio_reels.size() ); i++)
+        for ( size_t i = 0; i < ( p_sys->p_dcp->audio_reels.size() ); i++)
         {
             if ( i != 0 )
             {
                 EssenceType( p_sys->p_dcp->audio_reels[i].filename.c_str(), AudioEssTypeCompare );
                 if ( AudioEssTypeCompare != AudioEssType )
                 {
-                    msg_Err( p_demux, "Integrity check failed : different audio essence types",
+                    msg_Err( p_demux, "Integrity check failed : different audio essence types in %s",
                     p_sys->p_dcp->audio_reels[i].filename.c_str() );
                     retval = VLC_EGENERIC;
                     goto error;
@@ -832,21 +832,21 @@ void CloseDcpAndMxf( demux_t *p_demux )
         case ESS_UNKNOWN:
             break;
         case ESS_JPEG_2000:
-            for ( int i = 0; i < p_sys->v_videoReader.size(); i++ )
+            for ( size_t i = 0; i < p_sys->v_videoReader.size(); i++ )
             {
                 if( p_sys->v_videoReader[i].p_PicMXFReader )
                     p_sys->v_videoReader[i].p_PicMXFReader->Close();
             }
             break;
         case ESS_JPEG_2000_S:
-            for ( int i = 0; i < p_sys->v_videoReader.size(); i++ )
+            for ( size_t i = 0; i < p_sys->v_videoReader.size(); i++ )
             {
                 if( p_sys->v_videoReader[i].p_PicMXFSReader )
                     p_sys->v_videoReader[i].p_PicMXFSReader->Close();
             }
             break;
         case ESS_MPEG2_VES:
-            for ( int i = 0; i < p_sys->v_videoReader.size(); i++ )
+            for ( size_t i = 0; i < p_sys->v_videoReader.size(); i++ )
             {
                 if( p_sys->v_videoReader[i].p_VideoMXFReader )
                     p_sys->v_videoReader[i].p_VideoMXFReader->Close();
@@ -856,7 +856,7 @@ void CloseDcpAndMxf( demux_t *p_demux )
             break;
     }
 
-    for ( int i = 0; i < p_sys->v_audioReader.size(); i++ )
+    for ( size_t i = 0; i < p_sys->v_audioReader.size(); i++ )
     {
         if( p_sys->v_audioReader[i].p_AudioMXFReader )
             p_sys->v_audioReader[i].p_AudioMXFReader->Close();
diff --git a/modules/access/dcp/dcpparser.cpp b/modules/access/dcp/dcpparser.cpp
index 607c5bb..8e43104 100644
--- a/modules/access/dcp/dcpparser.cpp
+++ b/modules/access/dcp/dcpparser.cpp
@@ -442,6 +442,9 @@ int Asset::Parse( xml_reader_t *p_xmlReader, string p_node, int p_type)
                                 case ASSET_SIZE:
                                     /* Asset tags not in AssetMap */
                                     break;
+                                default:
+                                    msg_Warn(this->p_demux, "Unknow ASSET_TAG: %i", _tag );
+                                    break;
                             }
                             /* break the for loop as a tag is found*/
                             break;
@@ -527,6 +530,9 @@ int Asset::ParsePKL( xml_reader_t *p_xmlReader)
                                 case ASSET_CHUNK_LIST:
                                     /* Asset tags not in PKL */
                                     break;
+                                default:
+                                    msg_Warn(this->p_demux, "Unknow ASSET_TAG: %i", _tag );
+                                    break;
                             }
                             /* break the for loop as a tag is found*/
                             break;
@@ -807,6 +813,9 @@ int PKL::Parse()
                                     goto error;
                                 this->s_group_id = s_value;
                                 break;
+                            default:
+                                msg_Warn(this->p_demux, "Unknow PKG_TAG: %i", _tag );
+                                break;
                         }
                         /* break the for loop as a tag is found*/
                         break;
@@ -1301,6 +1310,9 @@ int CPL::Parse()
                                     goto error;
                                 this->s_content_kind = s_value;
                                 break;
+                            default:
+                                msg_Warn(this->p_demux, "Unknow CPL_TAG: %i", _tag );
+                                break;
                         }
 
                         /* break the for loop as a tag is found*/
diff --git a/modules/access/dcp/dcpparser.h b/modules/access/dcp/dcpparser.h
index e7f19cb..531fd66 100644
--- a/modules/access/dcp/dcpparser.h
+++ b/modules/access/dcp/dcpparser.h
@@ -71,7 +71,7 @@ struct info_reel
     int i_entrypoint;
     int i_duration;
     int i_correction;       /* entrypoint - sum of previous durations */
-    int i_absolute_end;     /* correction + duration */
+    uint32_t i_absolute_end;     /* correction + duration */
 };
 
 /* This struct stores the most important information about the DCP */



More information about the vlc-commits mailing list