[vlc-commits] [Git][videolan/vlc][master] test: record: remove file when it exists
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Jun 24 10:48:10 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
478155af by Alexandre Janniaux at 2023-06-24T10:29:29+00:00
test: record: remove file when it exists
We need to remove the file after the test, in particular because that's
what `make distcheck` will expect, and it will error out if the file is
left at the test location.
However, the current design of the recording feature doesn't guarantee
that the file will exist as soon as the recording event is signaled, or
even that it will even exist after the media player and libvlc instance
are released, if no track data has been pushed to the pipeline.
- - - - -
1 changed file:
- test/libvlc/media_player_record.c
Changes:
=====================================
test/libvlc/media_player_record.c
=====================================
@@ -56,6 +56,7 @@ static void test_media_player_record(const char** argv, int argc)
libvlc_media_player_play (mp);
const char path[] = "./";
+ char *filepath;
libvlc_media_player_record(mp, true, path);
@@ -72,12 +73,23 @@ static void test_media_player_record(const char** argv, int argc)
const struct libvlc_event_t *ev = event_ctx_wait_event(&ctx);
assert(!ev->u.media_player_record_changed.recording);
assert(ev->u.media_player_record_changed.recorded_file_path != NULL);
+ filepath = strdup(ev->u.media_player_record_changed.recorded_file_path);
+ assert(filepath != NULL);
event_ctx_release(&ctx);
}
libvlc_media_player_stop_async (mp);
libvlc_media_player_release (mp);
libvlc_release (vlc);
+
+ res = unlink(filepath);
+ /** TODO:
+ * We should check assert(res == 0);, but the record is currently
+ * creating a stream output pipeline instance for recording with
+ * a specific mux after the end of the Open() of the recording
+ * module, with a file{no-overwrite} option. It means that the
+ * file might not exist yet. */
+ free(filepath);
}
int main(void)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/478155afd868a125215eeb3c232cfee86dc6c55e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/478155afd868a125215eeb3c232cfee86dc6c55e
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list