]> git.sesse.net Git - vlc/blobdiff - modules/stream_filter/record.c
stream_filter: dash: have vlc_object accessible from, at least, segments
[vlc] / modules / stream_filter / record.c
index 388296bb4aded21fb679a71b23c86d112bc514ed..8bcef68c585c6ba05935b5e320c1d2ee83003b21 100644 (file)
@@ -6,19 +6,19 @@
  *
  * Author: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -91,6 +91,7 @@ static int Open ( vlc_object_t *p_this )
     s->pf_read = Read;
     s->pf_peek = Peek;
     s->pf_control = Control;
+    stream_FilterSetDefaultReadDir( s );
 
     return VLC_SUCCESS;
 }
@@ -184,19 +185,23 @@ static int Start( stream_t *s, const char *psz_extension )
 
     /* Create file name
      * TODO allow prefix configuration */
-    psz_file = input_CreateFilename( VLC_OBJECT(s), psz_path, INPUT_RECORD_PREFIX, psz_extension );
+    psz_file = input_CreateFilename( s->p_input, psz_path, INPUT_RECORD_PREFIX, psz_extension );
 
     free( psz_path );
 
     if( !psz_file )
         return VLC_ENOMEM;
 
-    f = utf8_fopen( psz_file, "wb" );
+    f = vlc_fopen( psz_file, "wb" );
     if( !f )
     {
         free( psz_file );
         return VLC_EGENERIC;
     }
+
+    /* signal new record file */
+    var_SetString( s->p_libvlc, "record-file", psz_file );
+
     msg_Dbg( s, "Recording into %s", psz_file );
     free( psz_file );