Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions libvisual-plugins/plugins/input/mplayer/input_mplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#define _GNU_SOURCE /* for function mremap */

#include <config.h>

#include <limits.h>
Expand Down Expand Up @@ -180,9 +178,11 @@ int inp_mplayer_init( VisPluginData *plugin )
return -6;
}

priv->mmap_area = mremap( priv->mmap_area, sizeof( mplayer_data_t ),
sizeof( mplayer_data_t ) + priv->mmap_area->bs,
0 );
const int buffer_size = priv->mmap_area->bs;
munmap( priv->mmap_area, sizeof( mplayer_data_t ) );

priv->mmap_area = mmap( 0, sizeof( mplayer_data_t ) + buffer_size,
PROT_READ, MAP_SHARED, priv->fd, 0 );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a need to set mmap_area first to NULL? It looks like mmap() is guaranteed to set mmap_area regardless of success or error.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaixiong you're right, fixed and pushed.

if ( priv->mmap_area == (void *)-1 )
{
visual_log( VISUAL_LOG_CRITICAL,
Expand Down
12 changes: 6 additions & 6 deletions libvisual-plugins/po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: libvisual-plugins 0.4.0\n"
"Report-Msgid-Bugs-To: https://github.com/Libvisual/libvisual/issues/\n"
"POT-Creation-Date: 2023-01-21 03:37+0100\n"
"POT-Creation-Date: 2023-02-14 16:26+0100\n"
"PO-Revision-Date: 2017-11-23 18:08:07+0200\n"
"Last-Translator: Chris Leick <c.leick@vollbio.de>\n"
"Language-Team: German <debian-l10n-german@lists.debian.org>\n"
Expand Down Expand Up @@ -470,26 +470,26 @@ msgstr "Eingabeschnittstellen konnten nicht verbunden werden."
msgid "The jack server seems to have shutdown"
msgstr "Der Jack-Server scheint heruntergefahren zu sein."

#: plugins/input/mplayer/input_mplayer.c:98
#: plugins/input/mplayer/input_mplayer.c:96
msgid "Use data exported from MPlayer"
msgstr "Vom Mplayer exportierte Daten werden benutzt."

#: plugins/input/mplayer/input_mplayer.c:99
#: plugins/input/mplayer/input_mplayer.c:97
msgid "This plugin uses data exported from 'mplayer -af export'"
msgstr ""
"Diese Erweiterung verwendet per »mplayer -af export« exportierte Daten."

#: plugins/input/mplayer/input_mplayer.c:155
#: plugins/input/mplayer/input_mplayer.c:153
#, c-format
msgid "Could not open file '%s': %s"
msgstr "Datei »%s« kann nicht geöffnet werden: %s"

#: plugins/input/mplayer/input_mplayer.c:166
#: plugins/input/mplayer/input_mplayer.c:164
msgid "No audio channel available"
msgstr "kein Audiokanal verfügbar"

# https://de.wikipedia.org/wiki/Sampling_(Musik)#Audiosample
#: plugins/input/mplayer/input_mplayer.c:174
#: plugins/input/mplayer/input_mplayer.c:172
#, c-format
msgid ""
"Data in wrong format. It should be 2 channels with 512 16bit samples. There "
Expand Down
12 changes: 6 additions & 6 deletions libvisual-plugins/po/es_AR.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Libvisual plugins 0.3.0\n"
"Report-Msgid-Bugs-To: https://github.com/Libvisual/libvisual/issues/\n"
"POT-Creation-Date: 2023-01-21 03:37+0100\n"
"POT-Creation-Date: 2023-02-14 16:26+0100\n"
"PO-Revision-Date: 2005-03-16 00:11-0300\n"
"Last-Translator: Duilio Javier Protti <dprotti@users.sourceforge.net>\n"
"Language-Team: Spanish <es@li.org>\n"
Expand Down Expand Up @@ -456,24 +456,24 @@ msgstr "No se puede conectar los puertos de entrada"
msgid "The jack server seems to have shutdown"
msgstr "El servidor jack parece haberse caído"

#: plugins/input/mplayer/input_mplayer.c:98
#: plugins/input/mplayer/input_mplayer.c:96
msgid "Use data exported from MPlayer"
msgstr "Usa datos exportados desde MPlayer"

#: plugins/input/mplayer/input_mplayer.c:99
#: plugins/input/mplayer/input_mplayer.c:97
msgid "This plugin uses data exported from 'mplayer -af export'"
msgstr "Este plugin usa datos exportados desde 'mplayer -af export'"

#: plugins/input/mplayer/input_mplayer.c:155
#: plugins/input/mplayer/input_mplayer.c:153
#, c-format
msgid "Could not open file '%s': %s"
msgstr "No se puede abrir el archivo '%s': %s"

#: plugins/input/mplayer/input_mplayer.c:166
#: plugins/input/mplayer/input_mplayer.c:164
msgid "No audio channel available"
msgstr "No hay canal de audio disponible"

#: plugins/input/mplayer/input_mplayer.c:174
#: plugins/input/mplayer/input_mplayer.c:172
#, c-format
msgid ""
"Data in wrong format. It should be 2 channels with 512 16bit samples. There "
Expand Down
12 changes: 6 additions & 6 deletions libvisual-plugins/po/es_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Libvisual plugins 0.3.0\n"
"Report-Msgid-Bugs-To: https://github.com/Libvisual/libvisual/issues/\n"
"POT-Creation-Date: 2023-01-21 03:37+0100\n"
"POT-Creation-Date: 2023-02-14 16:26+0100\n"
"PO-Revision-Date: 2005-03-16 00:11-0300\n"
"Last-Translator: Duilio Javier Protti <dprotti@users.sourceforge.net>\n"
"Language-Team: Spanish <es@li.org>\n"
Expand Down Expand Up @@ -456,24 +456,24 @@ msgstr "No se puede conectar los puertos de entrada"
msgid "The jack server seems to have shutdown"
msgstr "El servidor jack parece haberse caído"

#: plugins/input/mplayer/input_mplayer.c:98
#: plugins/input/mplayer/input_mplayer.c:96
msgid "Use data exported from MPlayer"
msgstr "Usa datos exportados desde MPlayer"

#: plugins/input/mplayer/input_mplayer.c:99
#: plugins/input/mplayer/input_mplayer.c:97
msgid "This plugin uses data exported from 'mplayer -af export'"
msgstr "Este plugin usa datos exportados desde 'mplayer -af export'"

#: plugins/input/mplayer/input_mplayer.c:155
#: plugins/input/mplayer/input_mplayer.c:153
#, c-format
msgid "Could not open file '%s': %s"
msgstr "No se puede abrir el archivo '%s': %s"

#: plugins/input/mplayer/input_mplayer.c:166
#: plugins/input/mplayer/input_mplayer.c:164
msgid "No audio channel available"
msgstr "No hay canal de audio disponible"

#: plugins/input/mplayer/input_mplayer.c:174
#: plugins/input/mplayer/input_mplayer.c:172
#, c-format
msgid ""
"Data in wrong format. It should be 2 channels with 512 16bit samples. There "
Expand Down
12 changes: 6 additions & 6 deletions libvisual-plugins/po/libvisual-plugins-0.4.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: libvisual-plugins 0.4.1\n"
"Report-Msgid-Bugs-To: https://github.com/Libvisual/libvisual/issues/\n"
"POT-Creation-Date: 2023-01-21 03:37+0100\n"
"POT-Creation-Date: 2023-02-14 16:26+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -434,24 +434,24 @@ msgstr ""
msgid "The jack server seems to have shutdown"
msgstr ""

#: plugins/input/mplayer/input_mplayer.c:98
#: plugins/input/mplayer/input_mplayer.c:96
msgid "Use data exported from MPlayer"
msgstr ""

#: plugins/input/mplayer/input_mplayer.c:99
#: plugins/input/mplayer/input_mplayer.c:97
msgid "This plugin uses data exported from 'mplayer -af export'"
msgstr ""

#: plugins/input/mplayer/input_mplayer.c:155
#: plugins/input/mplayer/input_mplayer.c:153
#, c-format
msgid "Could not open file '%s': %s"
msgstr ""

#: plugins/input/mplayer/input_mplayer.c:166
#: plugins/input/mplayer/input_mplayer.c:164
msgid "No audio channel available"
msgstr ""

#: plugins/input/mplayer/input_mplayer.c:174
#: plugins/input/mplayer/input_mplayer.c:172
#, c-format
msgid ""
"Data in wrong format. It should be 2 channels with 512 16bit samples. There "
Expand Down