# HG changeset patch # User reimar # Date 1287828883 0 # Node ID 5aae26f4bb59b31ee61aca8bab8c950d58abc0e2 # Parent bf593e3827d9d552a8a0e711c4be8fa0741af4e4 Simplify and fix capture feature to not always return an error. diff -r bf593e3827d9 -r 5aae26f4bb59 command.c --- a/command.c Fri Oct 22 20:39:43 2010 +0000 +++ b/command.c Sat Oct 23 10:14:43 2010 +0000 @@ -1118,18 +1118,20 @@ if (!mpctx->stream) return M_PROPERTY_UNAVAILABLE; + if (!capture_dump) { + mp_msg(MSGT_GLOBAL, MSGL_ERR, + "Capturing not enabled (forgot -capture parameter?)\n"); + return M_PROPERTY_ERROR; + } ret = m_property_flag(prop, action, arg, &capturing); if (ret == M_PROPERTY_OK && capturing != !!mpctx->stream->capture_file) { if (capturing) { - if (capture_dump && !(mpctx->stream->capture_file = fopen(stream_dump_name, "wb"))) { + mpctx->stream->capture_file = fopen(stream_dump_name, "wb"); + if (!mpctx->stream->capture_file) { mp_msg(MSGT_GLOBAL, MSGL_ERR, "Error opening capture file: %s\n", strerror(errno)); ret = M_PROPERTY_ERROR; - } else { - mp_msg(MSGT_GLOBAL, MSGL_ERR, - "Capturing not enabled (forgot -capture parameter?)\n"); - ret = M_PROPERTY_ERROR; } } else { fclose(mpctx->stream->capture_file);