Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8301473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:57:57+00:00 2026-06-08T16:57:57+00:00

I want to create lirc command to stop recording. I have 3 files for

  • 0

I want to create lirc command to stop recording. I have 3 files for this:

File: record.c

...
#include "rec_tech.h"
...
void stop_rec_button_clicked_cb(GtkButton *button, gpointer data)
{
    Recording *recording = data;
    close_status_window();
    recording_stop(recording);
}
... 

File: rec_tech.c

...
void recording_stop(Recording *recording)
{
    g_assert(recording);

    GstState state;
    gst_element_get_state(recording->pipeline, &state, NULL, GST_CLOCK_TIME_NONE);
    if (state != GST_STATE_PLAYING) {
        GST_DEBUG ("pipeline in wrong state: %s", gst_element_state_get_name (state));
    } else {
        gst_element_set_state(recording->pipeline, GST_STATE_NULL);
    }
    gst_object_unref(GST_OBJECT(recording->pipeline));
    g_free(recording->filename);
    g_free(recording->station);
    g_free(recording);
}   
... 

file rec_tech.h

...
#ifndef _REC_TECH_H
#define _REC_TECH_H
#include <gst/gst.h>
....
typedef struct {
    GstElement* pipeline;
    char* filename;
    char* station;
} Recording;

Recording*
recording_start(const char* filename);

void
recording_stop(Recording* recording);
...

File: lirc.c

...
#include <lirc/lirc_client.h>
#include "lirc.h"
#include "rec_tech.h"
#include "record.h"

static void execute_lirc_command (char *cmd)
{
        printf("lirc command: %s\n", cmd);

        if (strcasecmp (cmd, "stop recording") == 0) {
            stop_rec_button_clicked_cb(NULL, data);
        }
...

When I try to compile get error in file lirc.c

error: 'data' undeclared (first use in this function)

UPDATE

If in lirc.c add line Recording *data;

...
#include <lirc/lirc_client.h>
#include "lirc.h"
#include "rec_tech.h"
#include "record.h"

Recording *data;    
static void execute_lirc_command (char *cmd)
{
        printf("lirc command: %s\n", cmd);

        if (strcasecmp (cmd, "stop recording") == 0) {
            stop_rec_button_clicked_cb(NULL, data);
        }
...

get this run-time error:

ERROR:rec_tech.c:recording_stop: assertion failed: (recording)

Why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:58:00+00:00Added an answer on June 8, 2026 at 4:58 pm

    The g_assert() in recording_stop() checks that recording is not a null pointer, but the modified call in exec_lirc_command() passes a null pointer. So the assertion fails.

    Moral — do not pass null pointers to functions that are not expecting them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want create object from Canvas3D class(in java) but my Compiler doesn't have this
I want create subdomains like this: domain.com/type/city An examples: domain.com/restaurants/new_york domain.com/hotels/new_york domain.com/restaurants/chicago I have
I want create xml file of this structure: <Devices> <Device Number=58 Name=Default Device >
i want create Dynamic Slideshow in Jquery i'm Write this code var ctx =
i want create image animation , i have 50 images with png format now
I want create a pdf using iText. The method which does this is a
In C# code, I want create a log file for each each method in
I want create a tarball that when extracted the file(s) will be placed at
How to create a TIFF file in PHP? I want create a TIFF file
I'm trying to learn JPA and I want create a simple Java command line

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.