Imported Upstream version 0.4.5+svn3959~dfsg0
authorAlessio Treglia <alessio@debian.org>
Thu, 22 Mar 2012 10:06:18 +0000 (11:06 +0100)
committerAlessio Treglia <alessio@debian.org>
Thu, 22 Mar 2012 10:06:18 +0000 (11:06 +0100)
12 files changed:
applications/mp42ts/main.c
bin/win32/release/nsis_install/gpac_installer.nsi
configure
include/gpac/media_tools.h
modules/mpd_in/mpd_in.c
modules/ogg/ogg_in.c
modules/timedtext/timedtext_dec.c
modules/widgetman/unzip.c
modules/widgetman/widgetman.c
src/export.cpp
src/media_tools/media_import.c
src/utils/os_net.c

index dc4a10ac14a1a9e49e4796b59ff9b6efb6e3adf9..80b22455007485ea5e72e883dfe1d2b4afed8ad5 100644 (file)
 #include <gpac/mpegts.h>
 
 
+#ifdef GPAC_DISABLE_ISOM
+
+#error "Cannot compile MP42TS if GPAC is not built with ISO File Format support"
+
+#else
+
+
 #define DEFAULT_PCR_OFFSET     18000
 
 #define UDP_BUFFER_SIZE        0x40000
@@ -405,7 +412,11 @@ static void fill_isom_es_ifce(M2TSProgram *prog, GF_ESInterface *ifce, GF_ISOFil
                ifce->sl_config->timestampResolution = 90000;
        }
        
+#ifdef GPAC_DISABLE_ISOM_WRITE
+       fprintf(stdout, "Warning: GPAC was compiled without ISOM Write support, can't set SL Config!\n");
+#else
        gf_isom_set_extraction_slc(mp4, track_num, 1, ifce->sl_config);
+#endif
 
        ifce->input_ctrl = mp4_input_ctrl;
        if (priv != ifce->input_udta){
@@ -2197,3 +2208,4 @@ exit:
        return 1;
 }
 
+#endif /*GPAC_DISABLE_ISOM*/
index 367006ecab509d6fc4807e9d2fb95205472494c5..b391018e588c3459b92c50511d125459a98e9052 100644 (file)
@@ -657,169 +657,169 @@ SectionEnd
 !verbose 3
 !include "WinMessages.NSH"
 !verbose 4
+\r
+!ifndef WriteEnvStr_RegKey\r
+  !ifdef ALL_USERS\r
+    !define WriteEnvStr_RegKey \\r
+       'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'\r
+  !else\r
+    !define WriteEnvStr_RegKey 'HKCU "Environment"'\r
+  !endif\r
+!endif
 
 ; AddToPath - Adds the given dir to the search path.
 ;        Input - head of the stack
 ;        Note - Win9x systems requires reboot
 
-Function AddToPath
-  Exch $0
-  Push $1
-  Push $2
-  Push $3
-
-  # don't add if the path doesn't exist
-  IfFileExists $0 "" AddToPath_done
-
-  ReadEnvStr $1 PATH
-  Push "$1;"
-  Push "$0;"
-  Call StrStr
-  Pop $2
-  StrCmp $2 "" "" AddToPath_done
-  Push "$1;"
-  Push "$0\;"
-  Call StrStr
-  Pop $2
-  StrCmp $2 "" "" AddToPath_done
-  GetFullPathName /SHORT $3 $0
-  Push "$1;"
-  Push "$3;"
-  Call StrStr
-  Pop $2
-  StrCmp $2 "" "" AddToPath_done
-  Push "$1;"
-  Push "$3\;"
-  Call StrStr
-  Pop $2
-  StrCmp $2 "" "" AddToPath_done
-
-  Call IsNT
-  Pop $1
-  StrCmp $1 1 AddToPath_NT
-    ; Not on NT
-    StrCpy $1 $WINDIR 2
-    FileOpen $1 "$1\autoexec.bat" a
-    FileSeek $1 -1 END
-    FileReadByte $1 $2
-    IntCmp $2 26 0 +2 +2 # DOS EOF
-      FileSeek $1 -1 END # write over EOF
-    FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
-    FileClose $1
-    SetRebootFlag true
-    Goto AddToPath_done
-
-  AddToPath_NT:
-    ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
-    StrCpy $2 $1 1 -1 # copy last char
-    StrCmp $2 ";" 0 +2 # if last char == ;
-      StrCpy $1 $1 -1 # remove last char
-    StrCmp $1 "" AddToPath_NTdoIt
-      StrCpy $0 "$1;$0"
-    AddToPath_NTdoIt:
-      WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $0
-
-    ReadRegStr $1 HKCU "Environment" "PATH"
-    StrCpy $2 $1 1 -1 # copy last char
-    StrCmp $2 ";" 0 +2 # if last char == ;
-      StrCpy $1 $1 -1 # remove last char
-    StrCmp $1 "" AddToPath_NTdoIt2
-      StrCpy $0 "$1;$0"
-    AddToPath_NTdoIt2:
-      WriteRegExpandStr HKCU "Environment" "PATH" $0
-    SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
-  AddToPath_done:
-    Pop $3
-    Pop $2
-    Pop $1
-    Pop $0
+Function AddToPath\r
+  Exch $0\r
+  Push $1\r
+  Push $2\r
+  Push $3\r
\r
+  # don't add if the path doesn't exist\r
+  IfFileExists "$0\*.*" "" AddToPath_done\r
\r
+  ReadEnvStr $1 PATH\r
+  Push "$1;"\r
+  Push "$0;"\r
+  Call StrStr\r
+  Pop $2\r
+  StrCmp $2 "" "" AddToPath_done\r
+  Push "$1;"\r
+  Push "$0\;"\r
+  Call StrStr\r
+  Pop $2\r
+  StrCmp $2 "" "" AddToPath_done\r
+  GetFullPathName /SHORT $3 $0\r
+  Push "$1;"\r
+  Push "$3;"\r
+  Call StrStr\r
+  Pop $2\r
+  StrCmp $2 "" "" AddToPath_done\r
+  Push "$1;"\r
+  Push "$3\;"\r
+  Call StrStr\r
+  Pop $2\r
+  StrCmp $2 "" "" AddToPath_done\r
\r
+  Call IsNT\r
+  Pop $1\r
+  StrCmp $1 1 AddToPath_NT\r
+    ; Not on NT\r
+    StrCpy $1 $WINDIR 2\r
+    FileOpen $1 "$1\autoexec.bat" a\r
+    FileSeek $1 -1 END\r
+    FileReadByte $1 $2\r
+    IntCmp $2 26 0 +2 +2 # DOS EOF\r
+      FileSeek $1 -1 END # write over EOF\r
+    FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"\r
+    FileClose $1\r
+    SetRebootFlag true\r
+    Goto AddToPath_done\r
\r
+  AddToPath_NT:\r
+    ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"\r
+    StrCpy $2 $1 1 -1 # copy last char\r
+    StrCmp $2 ";" 0 +2 # if last char == ;\r
+      StrCpy $1 $1 -1 # remove last char\r
+    StrCmp $1 "" AddToPath_NTdoIt\r
+      StrCpy $0 "$1;$0"\r
+    AddToPath_NTdoIt:\r
+      WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $0\r
+      SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000\r
\r
+  AddToPath_done:\r
+    Pop $3\r
+    Pop $2\r
+    Pop $1\r
+    Pop $0\r
 FunctionEnd
 
 ; RemoveFromPath - Remove a given dir from the path
 ;     Input: head of the stack
 
-Function un.RemoveFromPath
-  Exch $0
-  Push $1
-  Push $2
-  Push $3
-  Push $4
-  Push $5
-  Push $6
-
-  IntFmt $6 "%c" 26 # DOS EOF
-
-  Call un.IsNT
-  Pop $1
-  StrCmp $1 1 unRemoveFromPath_NT
-    ; Not on NT
-    StrCpy $1 $WINDIR 2
-    FileOpen $1 "$1\autoexec.bat" r
-    GetTempFileName $4
-    FileOpen $2 $4 w
-    GetFullPathName /SHORT $0 $0
-    StrCpy $0 "SET PATH=%PATH%;$0"
-    Goto unRemoveFromPath_dosLoop
-
-    unRemoveFromPath_dosLoop:
-      FileRead $1 $3
-      StrCpy $5 $3 1 -1 # read last char
-      StrCmp $5 $6 0 +2 # if DOS EOF
-        StrCpy $3 $3 -1 # remove DOS EOF so we can compare
-      StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
-      StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
-      StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
-      StrCmp $3 "" unRemoveFromPath_dosLoopEnd
-      FileWrite $2 $3
-      Goto unRemoveFromPath_dosLoop
-      unRemoveFromPath_dosLoopRemoveLine:
-        SetRebootFlag true
-        Goto unRemoveFromPath_dosLoop
-
-    unRemoveFromPath_dosLoopEnd:
-      FileClose $2
-      FileClose $1
-      StrCpy $1 $WINDIR 2
-      Delete "$1\autoexec.bat"
-      CopyFiles /SILENT $4 "$1\autoexec.bat"
-      Delete $4
-      Goto unRemoveFromPath_done
-
-  unRemoveFromPath_NT:
-    ReadRegStr $1 HKCU "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
-    StrCpy $5 $1 1 -1 # copy last char
-    StrCmp $5 ";" +2 # if last char != ;
-      StrCpy $1 "$1;" # append ;
-    Push $1
-    Push "$0;"
-    Call un.StrStr ; Find `$0;` in $1
-    Pop $2 ; pos of our dir
-    StrCmp $2 "" unRemoveFromPath_done
-      ; else, it is in path
-      # $0 - path to add
-      # $1 - path var
-      StrLen $3 "$0;"
-      StrLen $4 $2
-      StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
-      StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
-      StrCpy $3 $5$6
-
-      StrCpy $5 $3 1 -1 # copy last char
-      StrCmp $5 ";" 0 +2 # if last char == ;
-        StrCpy $3 $3 -1 # remove last char
-
-      WriteRegExpandStr HKCU "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3
-      SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
-  unRemoveFromPath_done:
-    Pop $6
-    Pop $5
-    Pop $4
-    Pop $3
-    Pop $2
-    Pop $1
-    Pop $0
+Function un.RemoveFromPath\r
+  Exch $0\r
+  Push $1\r
+  Push $2\r
+  Push $3\r
+  Push $4\r
+  Push $5\r
+  Push $6\r
\r
+  IntFmt $6 "%c" 26 # DOS EOF\r
\r
+  Call un.IsNT\r
+  Pop $1\r
+  StrCmp $1 1 unRemoveFromPath_NT\r
+    ; Not on NT\r
+    StrCpy $1 $WINDIR 2\r
+    FileOpen $1 "$1\autoexec.bat" r\r
+    GetTempFileName $4\r
+    FileOpen $2 $4 w\r
+    GetFullPathName /SHORT $0 $0\r
+    StrCpy $0 "SET PATH=%PATH%;$0"\r
+    Goto unRemoveFromPath_dosLoop\r
\r
+    unRemoveFromPath_dosLoop:\r
+      FileRead $1 $3\r
+      StrCpy $5 $3 1 -1 # read last char\r
+      StrCmp $5 $6 0 +2 # if DOS EOF\r
+        StrCpy $3 $3 -1 # remove DOS EOF so we can compare\r
+      StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine\r
+      StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine\r
+      StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine\r
+      StrCmp $3 "" unRemoveFromPath_dosLoopEnd\r
+      FileWrite $2 $3\r
+      Goto unRemoveFromPath_dosLoop\r
+      unRemoveFromPath_dosLoopRemoveLine:\r
+        SetRebootFlag true\r
+        Goto unRemoveFromPath_dosLoop\r
\r
+    unRemoveFromPath_dosLoopEnd:\r
+      FileClose $2\r
+      FileClose $1\r
+      StrCpy $1 $WINDIR 2\r
+      Delete "$1\autoexec.bat"\r
+      CopyFiles /SILENT $4 "$1\autoexec.bat"\r
+      Delete $4\r
+      Goto unRemoveFromPath_done\r
\r
+  unRemoveFromPath_NT:\r
+    ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"\r
+    StrCpy $5 $1 1 -1 # copy last char\r
+    StrCmp $5 ";" +2 # if last char != ;\r
+      StrCpy $1 "$1;" # append ;\r
+    Push $1\r
+    Push "$0;"\r
+    Call un.StrStr ; Find `$0;` in $1\r
+    Pop $2 ; pos of our dir\r
+    StrCmp $2 "" unRemoveFromPath_done\r
+      ; else, it is in path\r
+      # $0 - path to add\r
+      # $1 - path var\r
+      StrLen $3 "$0;"\r
+      StrLen $4 $2\r
+      StrCpy $5 $1 -$4 # $5 is now the part before the path to remove\r
+      StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove\r
+      StrCpy $3 $5$6\r
\r
+      StrCpy $5 $3 1 -1 # copy last char\r
+      StrCmp $5 ";" 0 +2 # if last char == ;\r
+        StrCpy $3 $3 -1 # remove last char\r
\r
+      WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $3\r
+      SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000\r
\r
+  unRemoveFromPath_done:\r
+    Pop $6\r
+    Pop $5\r
+    Pop $4\r
+    Pop $3\r
+    Pop $2\r
+    Pop $1\r
+    Pop $0\r
 FunctionEnd
 
 ###########################################
@@ -835,20 +835,20 @@ FunctionEnd
 ;   Pop $R0
 ;  ($R0 at this point is 1 or 0)
 
-!macro IsNT un
-Function ${un}IsNT
-  Push $0
-  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
-  StrCmp $0 "" 0 IsNT_yes
-  ; we are not NT.
-  Pop $0
-  Push 0
-  Return
-
-  IsNT_yes:
-    ; NT!!!
-    Pop $0
-    Push 1
+!macro IsNT un\r
+Function ${un}IsNT\r
+  Push $0\r
+  ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion\r
+  StrCmp $0 "" 0 IsNT_yes\r
+  ; we are not NT.\r
+  Pop $0\r
+  Push 0\r
+  Return\r
\r
+  IsNT_yes:\r
+    ; NT!!!\r
+    Pop $0\r
+    Push 1\r
 FunctionEnd
 !macroend
 !insertmacro IsNT ""
@@ -867,36 +867,35 @@ FunctionEnd
 ;   Pop $R0
 ;  ($R0 at this point is "ass string")
 
-!macro StrStr un
-Function ${un}StrStr
-Exch $R1 ; st=haystack,old$R1, $R1=needle
-  Exch    ; st=old$R1,haystack
-  Exch $R2 ; st=old$R1,old$R2, $R2=haystack
-  Push $R3
-  Push $R4
-  Push $R5
-  StrLen $R3 $R1
-  StrCpy $R4 0
-  ; $R1=needle
-  ; $R2=haystack
-  ; $R3=len(needle)
-  ; $R4=cnt
-  ; $R5=tmp
-  loop:
-    StrCpy $R5 $R2 $R3 $R4
-    StrCmp $R5 $R1 done
-    StrCmp $R5 "" done
-    IntOp $R4 $R4 + 1
-    Goto loop
-done:
-  StrCpy $R1 $R2 "" $R4
-  Pop $R5
-  Pop $R4
-  Pop $R3
-  Pop $R2
-  Exch $R1
-FunctionEnd
-!macroend
-!insertmacro StrStr ""
+!macro StrStr un\r
+Function ${un}StrStr\r
+Exch $R1 ; st=haystack,old$R1, $R1=needle\r
+  Exch    ; st=old$R1,haystack\r
+  Exch $R2 ; st=old$R1,old$R2, $R2=haystack\r
+  Push $R3\r
+  Push $R4\r
+  Push $R5\r
+  StrLen $R3 $R1\r
+  StrCpy $R4 0\r
+  ; $R1=needle\r
+  ; $R2=haystack\r
+  ; $R3=len(needle)\r
+  ; $R4=cnt\r
+  ; $R5=tmp\r
+  loop:\r
+    StrCpy $R5 $R2 $R3 $R4\r
+    StrCmp $R5 $R1 done\r
+    StrCmp $R5 "" done\r
+    IntOp $R4 $R4 + 1\r
+    Goto loop\r
+done:\r
+  StrCpy $R1 $R2 "" $R4\r
+  Pop $R5\r
+  Pop $R4\r
+  Pop $R3\r
+  Pop $R2\r
+  Exch $R1\r
+FunctionEnd\r
+!macroend\r
+!insertmacro StrStr ""\r
 !insertmacro StrStr "un."
-
index 4c956c1240c389aa9f1aa1f14584ba5aa1c847b8..d08a25d0c0a1597e33795910acb6e016827651f3 100755 (executable)
--- a/configure
+++ b/configure
@@ -2504,13 +2504,17 @@ if test "$has_libxml2" = "yes"; then
 fi
 if test "$disable_m2ts_mux" = "yes" -o "$disable_m2ts" = "yes" ; then
     echo "DISABLE_M2TS=yes" >> config.mak
+else
+    echo "DISABLE_M2TS=no" >> config.mak
 fi
 
 echo "GPAC_USE_TINYGL=$has_tinygl" >> config.mak
 echo "OGL_INCLS=$INCL3D" >> config.mak
 
 if test "$disable_isoff" = "yes" -o "$disable_isoff_write" = "yes" ; then
-       echo "DISABLE_ISOFF=$disable_isoff" >> config.mak
+       echo "DISABLE_ISOFF=yes" >> config.mak
+else
+        echo "DISABLE_ISOFF=no" >> config.mak
 fi
 
 echo "HAS_OPENGL=$has_opengl" >> config.mak
index a9bf5c7ceff26bc27481cb8082728a9b3d67c138..bd3b2a828d5fc4bcbc723fd517dcd442756ee2ba 100644 (file)
@@ -38,7 +38,11 @@ extern "C" {
 /*creates (if needed) a GF_ESD for the given track - THIS IS RESERVED for local playback
 only, since the OTI used when emulated is not standard...*/
 GF_ESD *gf_media_map_esd(GF_ISOFile *mp4, u32 track);
+#endif
 
+#ifndef GPAC_DISABLE_ISOM_WRITE
+/*changes pixel aspect ratio for visual tracks if supported. Negative values remove any PAR info*/
+GF_Err gf_media_change_par(GF_ISOFile *file, u32 track, s32 ar_num, s32 ar_den);
 #endif
 
 
@@ -248,10 +252,6 @@ GF_Err gf_media_avc_rewrite_samples(GF_ISOFile *file, u32 track, u32 prev_size_i
 #endif /*GPAC_DISABLE_MEDIA_IMPORT*/
 
 
-/*changes pixel aspect ratio for visual tracks if supported. Negative values remove any PAR info*/
-GF_Err gf_media_change_par(GF_ISOFile *file, u32 track, s32 ar_num, s32 ar_den);
-
-
 #ifndef GPAC_DISABLE_ISOM_WRITE
 
 /*starts MPD file */
index 48d4751b0c3d4f04c4b35464de5562201f624363..d73d4b429ad9fd98d14f98b6a4b2ea3f81d254f9 100644 (file)
@@ -209,10 +209,12 @@ void MPD_NetIO_Segment(void *cbk, GF_NETIO_Parameter *param)
     if ((param->msg_type == GF_NETIO_PARSE_HEADER) && !strcmp(param->name, "Content-Type")) {
                if (!group->service_mime) {
                        group->service_mime = gf_strdup(param->value);
-               } else if (strcmp(group->service_mime, param->value)) {
+               } else if (stricmp(group->service_mime, param->value)) {
                        GF_MPD_Representation *rep = gf_list_get(group->adaptation_set->representations, group->active_rep_index);
                        if (! MPD_GetMimeType(NULL, rep, group->adaptation_set) ) rep->mime_type = gf_strdup(param->value);
                        rep->disabled = 1;
+                       GF_LOG(GF_LOG_WARNING, GF_LOG_MODULE,
+                               ("[MPD_IN] Disabling representation since mime does not match: expected %s, but had %s for %s!\n", group->service_mime, param->value, gf_dm_sess_get_resource_name(group->segment_dnload)));
                        group->force_switch_bandwidth = 1;
                        gf_dm_sess_abort(group->segment_dnload);
                        return;
@@ -1688,9 +1690,10 @@ restart_period:
                                }
                        }
 
-                       if (e == GF_OK || group->segment_must_be_streamed) {
+                       if (local_file_name && (e == GF_OK || group->segment_must_be_streamed )) {
                                gf_mx_p(mpdin->dl_mutex);
                                assert(group->nb_cached_segments<group->max_cached_segments);
+                               assert( local_file_name );
                                group->cached[group->nb_cached_segments].cache = gf_strdup(local_file_name);
                                group->cached[group->nb_cached_segments].url = gf_strdup( resource_name );
                                group->cached[group->nb_cached_segments].start_range = 0;
index 4c8ced56b8cb6f90ca150c78f0152f82921c067c..522557f41e4223e5de9147521c7ed48608757ec8 100644 (file)
@@ -390,7 +390,8 @@ void OGG_SignalEndOfStream(OGGReader *read, OGGStream *st)
        }
 }
 
-GFINLINE void OGG_SendPackets(OGGReader *read, OGGStream *st, ogg_packet *oggpacket)
+/*GFINLINE*/
+void OGG_SendPackets(OGGReader *read, OGGStream *st, ogg_packet *oggpacket)
 {
        GF_SLHeader slh;
        memset(&slh, 0, sizeof(GF_SLHeader));
index 26c08367398b2c785920bd4c52f1562671ab3585..a674431e05c0b1f5c15978789ff7a1eb70effff1 100644 (file)
@@ -63,7 +63,7 @@
 
        The decoder only accepts complete timed text units TTU(1). In band reconfig (TTU(5) is not supported,
        nor fragmented TTUs (2, 3, 4).
-       UTF16 support should workbut MP4Box does not support it at encoding time.
+       UTF16 support should work but MP4Box does not support it at encoding time.
 */
 
 typedef struct
index df1430c4cd818d2470473d0807ce54edc9ee98ba..c3feb088560a4f1ce0877b9ff195da20aabde3e4 100644 (file)
@@ -1142,7 +1142,7 @@ int mymkdir(dirname)
 }
 
 int makedir (newdir)
-    char *newdir;
+    const char *newdir;
 {
   char *buffer ;
   char *p;
index 75e3df3f66cac24d86f9c82b6879adc26eaf9bea..593f60b2f5aacd4da5f216b94f2e1d73b9922ec9 100644 (file)
@@ -73,7 +73,7 @@ static Bool is_same_path(const char *p1, const char *p2, u32 len)
 
 static void widget_package_extract_file(GF_WidgetPackage *wpack, GF_WidgetPackageResource *res)
 {
-       u32 i, count;
+       u32 i;
 
        if (wpack->is_zip) {
                unz_global_info gi;
@@ -115,7 +115,9 @@ static void widget_package_extract_file(GF_WidgetPackage *wpack, GF_WidgetPackag
                        break;
                }
                unzClose(uf);
+#ifndef GPAC_DISABLE_ISOM
        } else {
+               u32 count;
                GF_ISOFile *isom = gf_isom_open(wpack->package_path, GF_ISOM_OPEN_READ, 0);
                if (!isom ) return;
 
@@ -134,6 +136,7 @@ static void widget_package_extract_file(GF_WidgetPackage *wpack, GF_WidgetPackag
                        break;
                }
                gf_isom_close(isom);
+#endif /*GPAC_DISABLE_ISOM*/
        }
 
 }
@@ -228,8 +231,13 @@ static Bool widget_package_relocate_uri(void *__self, const char *parent_uri, co
        return 0;
 }
 
+
 static GF_WidgetPackage *widget_isom_new(GF_WidgetManager *wm, const char *path)
 {
+#ifdef GPAC_DISABLE_ISOM
+       GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[Widgetman] GPAC was compiled without ISO File Format support\n"));
+       return NULL;
+#else
        GF_WidgetPackageResource *pack_res;
        char szPath[GF_MAX_PATH];
        const char *dir;
@@ -311,6 +319,7 @@ static GF_WidgetPackage *widget_isom_new(GF_WidgetManager *wm, const char *path)
        gf_list_add(wm->term->uri_relocators, wzip);
        gf_mx_v(wm->term->net_mx);
        return wzip;
+#endif /*GPAC_DISABLE_ISOM*/
 }
 
 static GF_WidgetPackage *widget_zip_new(GF_WidgetManager *wm, const char *path)
@@ -410,10 +419,12 @@ GF_WidgetPackage *widget_package_new(GF_WidgetManager *wm, const char *path)
        if (gf_unzip_probe(path)) {
                return widget_zip_new(wm, path);
        }
+#ifndef GPAC_DISABLE_ISOM
        /*ISOFF-based packaged widget */
        else if (gf_isom_probe_file(path)) {
                return widget_isom_new(wm, path);
        }
+#endif
        return NULL;
 }
 
index 0e67cd5f2c9e0d2f335f0a0e3c54d18e8169e136..6d63bd96b49c8c69796a0b7a455392dc91f665ca 100644 (file)
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_get_timed_meta_data_info) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_box_new) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_box_del) )
+#ifndef GPAC_DISABLE_ISOM_WRITE
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_box_write) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_box_size) )
+#endif
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_open_progressive) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_get_missing_bytes) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_is_fragmented) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_get_meta_item_info) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_get_meta_type) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_has_meta_xml) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_isom_extract_meta_xml) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_isom_extract_meta_item) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_has_movie) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_has_segment) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_is_single_av) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_3gp_config_update) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_new_text_description) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_new_text_sample) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_isom_delete_text_sample) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_text_reset) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_text_add_text) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_text_add_style) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_set_meta_xml) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_set_meta_xml_memory) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_remove_meta_xml) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_isom_extract_meta_xml) )
-#pragma comment (linker, EXPORT_SYMBOL(gf_isom_extract_meta_item) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_apple_set_tag) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_get_next_alternate_group_id) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_set_ipod_compatible) )
 
 /*isomedia_dev.h exports*/
 #pragma comment (linker, EXPORT_SYMBOL(gf_isom_parse_texte_sample) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_isom_delete_text_sample) )
 
 #ifndef GPAC_DISABLE_STREAMING
 #pragma comment (linker, EXPORT_SYMBOL(gf_rtp_streamer_new) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_media_avc_rewrite_samples) )
 #endif /*GPAC_DISABLE_MEDIA_IMPORT*/
 
+#ifndef GPAC_DISABLE_ISOM_WRITE
 #pragma comment (linker, EXPORT_SYMBOL(gf_media_change_par) )
-
+#endif
 
 #ifndef GPAC_DISABLE_AV_PARSERS
 #pragma comment (linker, EXPORT_SYMBOL(gf_avc_get_sps_info) )
index f097a4abe57fb8e21b263c286522e7c9b0d7d773..5b632f59a4a10b89fc4d8a5642e1c07797a1b7c8 100644 (file)
@@ -6846,6 +6846,7 @@ GF_Err gf_media_change_pl(GF_ISOFile *file, u32 track, u32 profile, u32 level)
 #endif /*GPAC_DISABLE_MEDIA_IMPORT*/
 
 
+#ifndef GPAC_DISABLE_ISOM_WRITE
 GF_EXPORT
 GF_Err gf_media_change_par(GF_ISOFile *file, u32 track, s32 ar_num, s32 ar_den)
 {
@@ -6897,3 +6898,4 @@ GF_Err gf_media_change_par(GF_ISOFile *file, u32 track, s32 ar_num, s32 ar_den)
        }
        return gf_isom_set_track_layout_info(file, track, tk_w<<16, tk_h<<16, 0, 0, 0);
 }
+#endif /*GPAC_DISABLE_ISOM_WRITE*/
index 569916e1f49cd371199f5bb3e1f9fcc1be607bcf..412a803cd62e94f31171f326703308c4a5179742 100644 (file)
@@ -256,12 +256,14 @@ Bool gf_net_is_ipv6(const char *address)
 }
 
 #ifdef GPAC_HAS_IPV6
+#define MAX_PEER_NAME_LEN 1024
 static struct addrinfo *gf_sk_get_ipv6_addr(const char *PeerName, u16 PortNumber, int family, int flags, int sock_type)
 {
        struct  addrinfo *res=NULL;
        struct  addrinfo hints;
-       char node[50], portstring[20], *service, *dest;
-
+       char node[MAX_PEER_NAME_LEN], portstring[20];
+       char *service, *dest;
+       service = dest = NULL;
 #ifdef WIN32
                if (!wsa_init) {
                        WSADATA Data;
@@ -281,11 +283,12 @@ static struct addrinfo *gf_sk_get_ipv6_addr(const char *PeerName, u16 PortNumber
                service = (char *)portstring;
        }
        if (PeerName) {
-               strcpy(node, PeerName);
+               strncpy(node, PeerName, MAX_PEER_NAME_LEN);
                if (node[0]=='[') {
                        node[strlen(node)-1] = 0;
-                       strcpy(node, &node[1]);
+                       strncpy(node, &node[1], MAX_PEER_NAME_LEN);
                }
+               node[MAX_PEER_NAME_LEN - 1] = 0;
                dest = (char *) node;
        }
        if (getaddrinfo((const char *)dest, (const char *)service, &hints, &res) != 0) return NULL;